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;
|
opt->rep.comparator = cmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rocksdb_options_set_merger_operator(
|
void rocksdb_options_set_merge_operator(
|
||||||
rocksdb_options_t* opt,
|
rocksdb_options_t* opt,
|
||||||
rocksdb_mergeoperator_t* merge_operator) {
|
rocksdb_mergeoperator_t* merge_operator) {
|
||||||
opt->rep.merge_operator = std::shared_ptr<MergeOperator>(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
|
// Create new database
|
||||||
rocksdb_close(db);
|
rocksdb_close(db);
|
||||||
rocksdb_destroy_db(options, dbname, &err);
|
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);
|
db = rocksdb_open(options, dbname, &err);
|
||||||
CheckNoError(err);
|
CheckNoError(err);
|
||||||
rocksdb_put(db, woptions, "foo", 3, "foovalue", 8, &err);
|
rocksdb_put(db, woptions, "foo", 3, "foovalue", 8, &err);
|
||||||
@ -431,8 +431,6 @@ int main(int argc, char** argv) {
|
|||||||
CheckNoError(err);
|
CheckNoError(err);
|
||||||
CheckGet(db, roptions, "bar", "fake");
|
CheckGet(db, roptions, "bar", "fake");
|
||||||
|
|
||||||
rocksdb_options_set_merger_operator(options, NULL);
|
|
||||||
rocksdb_mergeoperator_destroy(merge_operator);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StartPhase("cleanup");
|
StartPhase("cleanup");
|
||||||
|
@ -216,8 +216,7 @@ extern void rocksdb_options_destroy(rocksdb_options_t*);
|
|||||||
extern void rocksdb_options_set_comparator(
|
extern void rocksdb_options_set_comparator(
|
||||||
rocksdb_options_t*,
|
rocksdb_options_t*,
|
||||||
rocksdb_comparator_t*);
|
rocksdb_comparator_t*);
|
||||||
extern void rocksdb_options_set_merger_operator(
|
extern void rocksdb_options_set_merge_operator(rocksdb_options_t*,
|
||||||
rocksdb_options_t*,
|
|
||||||
rocksdb_mergeoperator_t*);
|
rocksdb_mergeoperator_t*);
|
||||||
extern void rocksdb_options_set_compression_per_level(
|
extern void rocksdb_options_set_compression_per_level(
|
||||||
rocksdb_options_t* opt,
|
rocksdb_options_t* opt,
|
||||||
|
Loading…
Reference in New Issue
Block a user