]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/examples/options_file_example.cc
import quincy beta 17.1.0
[ceph.git] / ceph / src / rocksdb / examples / options_file_example.cc
index e6a1d0e9a001928b4cc8d9f16d5f2aaa626a3209..92c577b15336e8125ed6c57d54a613bb49fcb269 100644 (file)
 
 using namespace ROCKSDB_NAMESPACE;
 
+#if defined(OS_WIN)
+std::string kDBPath = "C:\\Windows\\TEMP\\rocksdb_options_file_example";
+#else
 std::string kDBPath = "/tmp/rocksdb_options_file_example";
+#endif
 
 namespace {
 // A dummy compaction filter
@@ -79,15 +83,17 @@ int main() {
   // Load the options file.
   DBOptions loaded_db_opt;
   std::vector<ColumnFamilyDescriptor> loaded_cf_descs;
-  s = LoadLatestOptions(kDBPath, Env::Default(), &loaded_db_opt,
+  ConfigOptions config_options;
+  s = LoadLatestOptions(config_options, kDBPath, &loaded_db_opt,
                         &loaded_cf_descs);
   assert(s.ok());
   assert(loaded_db_opt.create_if_missing == db_opt.create_if_missing);
 
   // Initialize pointer options for each column family
   for (size_t i = 0; i < loaded_cf_descs.size(); ++i) {
-    auto* loaded_bbt_opt = reinterpret_cast<BlockBasedTableOptions*>(
-        loaded_cf_descs[0].options.table_factory->GetOptions());
+    auto* loaded_bbt_opt =
+        loaded_cf_descs[0]
+            .options.table_factory->GetOptions<BlockBasedTableOptions>();
     // Expect the same as BlockBasedTableOptions will be loaded form file.
     assert(loaded_bbt_opt->block_size == bbt_opts.block_size);
     // However, block_cache needs to be manually initialized as documented