Open vipsland opened 2 years ago
add header try again
i did but i get...
[ 91%] Linking CXX executable range_del_aggregator_bench
[ 91%] Linking CXX executable memtablerep_bench
[ 92%] Linking CXX executable table_reader_bench
/usr/bin/ld: /usr/bin/ld: libterarkdb.a(options.cc.o): in function `terarkdb::ColumnFamilyOptions::ColumnFamilyOptions()':
/usr/local/src/src/terarkdb/options/options.cc:131: undefined reference to `terarkdb::NewTerarkZipTableFactory(terarkdb::TerarkZipTableOptions const&, std::shared_ptr<terarkdb::TableFactory>)'
libterarkdb.a(options.cc.o): in function `terarkdb::ColumnFamilyOptions::ColumnFamilyOptions()':
/usr/local/src/src/terarkdb/options/options.cc:131: undefined reference to `terarkdb::NewTerarkZipTableFactory(terarkdb::TerarkZipTableOptions const&, std::shared_ptr<terarkdb::TableFactory>)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/cache_bench.dir/build.make:108: cache_bench] Error 1
make[1]: *** [CMakeFiles/Makefile2:293: CMakeFiles/cache_bench.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/range_del_aggregator_bench.dir/build.make:108: range_del_aggregator_bench] Error 1
make[1]: *** [CMakeFiles/Makefile2:363: CMakeFiles/range_del_aggregator_bench.dir/all] Error 2
/usr/bin/ld: collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/memtablerep_bench.dir/build.make:108: memtablerep_bench] Error 1
make[1]: *** [CMakeFiles/Makefile2:328: CMakeFiles/memtablerep_bench.dir/all] Error 2
libterarkdb.a(options.cc.o): in function `terarkdb::ColumnFamilyOptions::ColumnFamilyOptions()':
/usr/local/src/src/terarkdb/options/options.cc:131: undefined reference to `terarkdb::NewTerarkZipTableFactory(terarkdb::TerarkZipTableOptions const&, std::shared_ptr<terarkdb::TableFactory>)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/table_reader_bench.dir/build.make:108: table_reader_bench] Error 1
make[1]: *** [CMakeFiles/Makefile2:398: CMakeFiles/table_reader_bench.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
rocksdb::DB* db; rocksdb::Options options;
// Your db options here options.create_if_missing = true; options.wal_bytes_per_sync = 32768; options.bytes_per_sync = 32768;
// TerarkZipTable need a fallback
options because you can indicate which LSM level you want to start using TerarkZipTable
// For example, by setting tzt_options.terarkZipMinLevel = 2, TerarkDB will use your fallback Table on level 0 and 1.
std::shared_ptr
rocksdb::TerarkZipTableOptions tzt_options; // TerarkZipTable requires a temp directory other than data directory, a slow device is acceptable tzt_options.localTempDir = "/tmp"; tzt_options.indexNestLevel = 3; tzt_options.sampleRatio = 0.01; tzt_options.terarkZipMinLevel = 2; // Start using TerarkZipTable from level 2
table_factory.reset( rocksdb::NewTerarkZipTableFactory(tzt_options, table_factory));
options.table_factory = table_factory;
// Open DB auto status = rocksdb::DB::Open(options, "/tmp/testdb2", &db);
// Operations std::string value; auto s = db->Put(rocksdb::WriteOptions(), "key1", "value1"); s = db->Get(rocksdb::ReadOptions(), "key1", &value); assert(s.ok()); assert("value1" == value);
s = db->Delete(rocksdb::WriteOptions(), "key1"); assert(s.ok());
is this your need?
no, i mean i'm ediitng this file directly https://github.com/bytedance/terarkdb/blob/dev.1.4/options/options.cc
how to force it to use terarkzip as default? (doing so to make my language binding easier. no need to write binding)
the code i shown is not working
i've edited options/options.cc with error below. can anyone pls help? coz i got the code to make all request defaulting to use terarkzip coz my NON-C++ language binding for rocksdb doesn't have the terarkzip option binding.
pls help. thx