|
|
|
@ -30,6 +30,7 @@ |
|
|
|
|
#include "rocksdb/slice_transform.h" |
|
|
|
|
#include "rocksdb/table.h" |
|
|
|
|
#include "rocksdb/utilities/backupable_db.h" |
|
|
|
|
#include "utilities/merge_operators.h" |
|
|
|
|
|
|
|
|
|
using rocksdb::Cache; |
|
|
|
|
using rocksdb::ColumnFamilyDescriptor; |
|
|
|
@ -53,6 +54,7 @@ using rocksdb::FlushOptions; |
|
|
|
|
using rocksdb::Iterator; |
|
|
|
|
using rocksdb::Logger; |
|
|
|
|
using rocksdb::MergeOperator; |
|
|
|
|
using rocksdb::MergeOperators; |
|
|
|
|
using rocksdb::NewBloomFilterPolicy; |
|
|
|
|
using rocksdb::NewLRUCache; |
|
|
|
|
using rocksdb::Options; |
|
|
|
@ -602,6 +604,10 @@ void rocksdb_close(rocksdb_t* db) { |
|
|
|
|
delete db; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void rocksdb_options_set_uint64add_merge_operator(rocksdb_options_t* opt) { |
|
|
|
|
opt->rep.merge_operator = rocksdb::MergeOperators::CreateUInt64AddOperator(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
rocksdb_t* rocksdb_open_column_families( |
|
|
|
|
const rocksdb_options_t* db_options, |
|
|
|
|
const char* name, |
|
|
|
@ -1186,6 +1192,26 @@ void rocksdb_block_based_options_set_whole_key_filtering( |
|
|
|
|
options->rep.whole_key_filtering = v; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void rocksdb_block_based_options_set_format_version( |
|
|
|
|
rocksdb_block_based_table_options_t* options, int v) { |
|
|
|
|
options->rep.format_version = v; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void rocksdb_block_based_options_set_index_type( |
|
|
|
|
rocksdb_block_based_table_options_t* options, int v) { |
|
|
|
|
options->rep.index_type = static_cast<BlockBasedTableOptions::IndexType>(v); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void rocksdb_block_based_options_set_hash_index_allow_collision( |
|
|
|
|
rocksdb_block_based_table_options_t* options, unsigned char v) { |
|
|
|
|
options->rep.hash_index_allow_collision = v; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void rocksdb_block_based_options_set_cache_index_and_filter_blocks( |
|
|
|
|
rocksdb_block_based_table_options_t* options, unsigned char v) { |
|
|
|
|
options->rep.cache_index_and_filter_blocks = v; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void rocksdb_options_set_block_based_table_factory( |
|
|
|
|
rocksdb_options_t *opt, |
|
|
|
|
rocksdb_block_based_table_options_t* table_options) { |
|
|
|
@ -2100,6 +2126,27 @@ rocksdb_slicetransform_t* rocksdb_slicetransform_create_fixed_prefix(size_t pref |
|
|
|
|
return wrapper; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
rocksdb_slicetransform_t* rocksdb_slicetransform_create_noop() { |
|
|
|
|
struct Wrapper : public rocksdb_slicetransform_t { |
|
|
|
|
const SliceTransform* rep_; |
|
|
|
|
~Wrapper() { delete rep_; } |
|
|
|
|
const char* Name() const override { return rep_->Name(); } |
|
|
|
|
Slice Transform(const Slice& src) const override { |
|
|
|
|
return rep_->Transform(src); |
|
|
|
|
} |
|
|
|
|
bool InDomain(const Slice& src) const override { |
|
|
|
|
return rep_->InDomain(src); |
|
|
|
|
} |
|
|
|
|
bool InRange(const Slice& src) const override { return rep_->InRange(src); } |
|
|
|
|
static void DoNothing(void*) { } |
|
|
|
|
}; |
|
|
|
|
Wrapper* wrapper = new Wrapper; |
|
|
|
|
wrapper->rep_ = rocksdb::NewNoopTransform(); |
|
|
|
|
wrapper->state_ = nullptr; |
|
|
|
|
wrapper->destructor_ = &Wrapper::DoNothing; |
|
|
|
|
return wrapper; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
rocksdb_universal_compaction_options_t* rocksdb_universal_compaction_options_create() { |
|
|
|
|
rocksdb_universal_compaction_options_t* result = new rocksdb_universal_compaction_options_t; |
|
|
|
|
result->rep = new rocksdb::CompactionOptionsUniversal; |
|
|
|
|