Revision 48fd619a47c17d044aa9d36adab55659fcac1985 authored by Adam Retter on 20 October 2016, 01:21:22 UTC, committed by Yueh-Hsuan Chiang on 20 October 2016, 01:21:22 UTC
* [bugfix] Make sure the Native Library is initialized. Closes https://github.com/facebook/rocksdb/issues/989

* [bugfix] Just load the native libraries once
1 parent 48e4e84
Raw File
xfunc.cc
//  Copyright (c) 2011-present, 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
back to top