|
|
@ -17,7 +17,7 @@ |
|
|
|
#include "db/write_batch_internal.h" |
|
|
|
#include "db/write_batch_internal.h" |
|
|
|
#include "utilities/merge_operators.h" |
|
|
|
#include "utilities/merge_operators.h" |
|
|
|
#include "util/testharness.h" |
|
|
|
#include "util/testharness.h" |
|
|
|
#include "utilities/utility_db.h" |
|
|
|
#include "utilities/db_ttl.h" |
|
|
|
|
|
|
|
|
|
|
|
using namespace std; |
|
|
|
using namespace std; |
|
|
|
using namespace rocksdb; |
|
|
|
using namespace rocksdb; |
|
|
@ -80,7 +80,6 @@ std::shared_ptr<DB> OpenDb(const string& dbname, const bool ttl = false, |
|
|
|
const size_t max_successive_merges = 0, |
|
|
|
const size_t max_successive_merges = 0, |
|
|
|
const uint32_t min_partial_merge_operands = 2) { |
|
|
|
const uint32_t min_partial_merge_operands = 2) { |
|
|
|
DB* db; |
|
|
|
DB* db; |
|
|
|
StackableDB* sdb; |
|
|
|
|
|
|
|
Options options; |
|
|
|
Options options; |
|
|
|
options.create_if_missing = true; |
|
|
|
options.create_if_missing = true; |
|
|
|
options.merge_operator = std::make_shared<CountMergeOperator>(); |
|
|
|
options.merge_operator = std::make_shared<CountMergeOperator>(); |
|
|
@ -90,8 +89,9 @@ std::shared_ptr<DB> OpenDb(const string& dbname, const bool ttl = false, |
|
|
|
DestroyDB(dbname, Options()); |
|
|
|
DestroyDB(dbname, Options()); |
|
|
|
if (ttl) { |
|
|
|
if (ttl) { |
|
|
|
cout << "Opening database with TTL\n"; |
|
|
|
cout << "Opening database with TTL\n"; |
|
|
|
s = UtilityDB::OpenTtlDB(options, dbname, &sdb); |
|
|
|
DBWithTTL* db_with_ttl; |
|
|
|
db = sdb; |
|
|
|
s = DBWithTTL::Open(options, dbname, &db_with_ttl); |
|
|
|
|
|
|
|
db = db_with_ttl; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
s = DB::Open(options, dbname, &db); |
|
|
|
s = DB::Open(options, dbname, &db); |
|
|
|
} |
|
|
|
} |
|
|
|