mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-25 22:44:05 +00:00
Fix C API
This commit is contained in:
parent
01c27be5fb
commit
2bf1151a25
2
db/c.cc
2
db/c.cc
|
@ -595,7 +595,7 @@ void rocksdb_options_set_comparator(
|
|||
opt->rep.comparator = cmp;
|
||||
}
|
||||
|
||||
void rocksdb_options_set_merger_operator(
|
||||
void rocksdb_options_set_merge_operator(
|
||||
rocksdb_options_t* opt,
|
||||
rocksdb_mergeoperator_t* merge_operator) {
|
||||
opt->rep.merge_operator = std::shared_ptr<MergeOperator>(merge_operator);
|
||||
|
|
|
@ -416,7 +416,7 @@ int main(int argc, char** argv) {
|
|||
// Create new database
|
||||
rocksdb_close(db);
|
||||
rocksdb_destroy_db(options, dbname, &err);
|
||||
rocksdb_options_set_merger_operator(options, merge_operator);
|
||||
rocksdb_options_set_merge_operator(options, merge_operator);
|
||||
db = rocksdb_open(options, dbname, &err);
|
||||
CheckNoError(err);
|
||||
rocksdb_put(db, woptions, "foo", 3, "foovalue", 8, &err);
|
||||
|
@ -431,8 +431,6 @@ int main(int argc, char** argv) {
|
|||
CheckNoError(err);
|
||||
CheckGet(db, roptions, "bar", "fake");
|
||||
|
||||
rocksdb_options_set_merger_operator(options, NULL);
|
||||
rocksdb_mergeoperator_destroy(merge_operator);
|
||||
}
|
||||
|
||||
StartPhase("cleanup");
|
||||
|
|
|
@ -216,9 +216,8 @@ extern void rocksdb_options_destroy(rocksdb_options_t*);
|
|||
extern void rocksdb_options_set_comparator(
|
||||
rocksdb_options_t*,
|
||||
rocksdb_comparator_t*);
|
||||
extern void rocksdb_options_set_merger_operator(
|
||||
rocksdb_options_t*,
|
||||
rocksdb_mergeoperator_t*);
|
||||
extern void rocksdb_options_set_merge_operator(rocksdb_options_t*,
|
||||
rocksdb_mergeoperator_t*);
|
||||
extern void rocksdb_options_set_compression_per_level(
|
||||
rocksdb_options_t* opt,
|
||||
int* level_values,
|
||||
|
|
Loading…
Reference in a new issue