46f9cd46af
Summary: I split the db-specific test points out into a separate file under db/ directory. There were also a few bugs to fix in xfunc.{h,cc} that prevented it from compiling previously; see https://reviews.facebook.net/D36825. Test Plan: compilation works now, below command works, will also run "make xfunc". $ make check ROCKSDB_XFUNC_TEST='managed_new' tests-regexp='DBTest' -j32 Reviewers: sdong, yhchiang Subscribers: dhruba Differential Revision: https://reviews.facebook.net/D53343
51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
// Copyright (c) 2014, Facebook, Inc. All rights reserved.
|
|
// This source code is licensed under the BSD-style license found in the
|
|
// LICENSE file in the root directory of this source tree. An additional grant
|
|
// of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
#ifdef XFUNC
|
|
#include "util/xfunc.h"
|
|
|
|
#include <string>
|
|
|
|
#include "rocksdb/db.h"
|
|
#include "rocksdb/options.h"
|
|
#include "rocksdb/utilities/optimistic_transaction_db.h"
|
|
#include "rocksdb/write_batch.h"
|
|
|
|
namespace rocksdb {
|
|
|
|
std::string XFuncPoint::xfunc_test_;
|
|
bool XFuncPoint::initialized_ = false;
|
|
bool XFuncPoint::enabled_ = false;
|
|
int XFuncPoint::skip_policy_ = 0;
|
|
|
|
void GetXFTestOptions(Options* options, int skip_policy) {
|
|
if (XFuncPoint::Check("inplace_lock_test") &&
|
|
(!(skip_policy & kSkipNoSnapshot))) {
|
|
options->inplace_update_support = true;
|
|
}
|
|
}
|
|
|
|
void xf_manage_options(ReadOptions* read_options) {
|
|
if (!XFuncPoint::Check("managed_xftest_dropold") &&
|
|
(!XFuncPoint::Check("managed_xftest_release"))) {
|
|
return;
|
|
}
|
|
read_options->managed = true;
|
|
}
|
|
|
|
void xf_transaction_set_memtable_history(
|
|
int32_t* max_write_buffer_number_to_maintain) {
|
|
*max_write_buffer_number_to_maintain = 10;
|
|
}
|
|
|
|
void xf_transaction_clear_memtable_history(
|
|
int32_t* max_write_buffer_number_to_maintain) {
|
|
*max_write_buffer_number_to_maintain = 0;
|
|
}
|
|
|
|
} // namespace rocksdb
|
|
|
|
#endif // XFUNC
|