]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/utilities/options/options_util.cc
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rocksdb / utilities / options / options_util.cc
index 353725552b33e92fb35ab682df23ce15a6bb5ce8..00c4b981a6534402cbf3ce57a0a967ddaff0d830 100644 (file)
@@ -7,7 +7,6 @@
 
 #include "rocksdb/utilities/options_util.h"
 
-#include "env/composite_env_wrapper.h"
 #include "file/filename.h"
 #include "options/options_parser.h"
 #include "rocksdb/convenience.h"
@@ -34,8 +33,8 @@ Status LoadOptionsFromFile(const ConfigOptions& config_options,
                            std::vector<ColumnFamilyDescriptor>* cf_descs,
                            std::shared_ptr<Cache>* cache) {
   RocksDBOptionsParser parser;
-  LegacyFileSystemWrapper fs(config_options.env);
-  Status s = parser.Parse(config_options, file_name, &fs);
+  const auto& fs = config_options.env->GetFileSystem();
+  Status s = parser.Parse(config_options, file_name, fs.get());
   if (!s.ok()) {
     return s;
   }
@@ -58,8 +57,8 @@ Status LoadOptionsFromFile(const ConfigOptions& config_options,
   return Status::OK();
 }
 
-Status GetLatestOptionsFileName(const std::string& dbpath,
-                                Env* env, std::string* options_file_name) {
+Status GetLatestOptionsFileName(const std::string& dbpath, Env* env,
+                                std::string* options_file_name) {
   Status s;
   std::string latest_file_name;
   uint64_t latest_time_stamp = 0;
@@ -122,7 +121,7 @@ Status CheckOptionsCompatibility(
     const std::string& dbpath, Env* env, const DBOptions& db_options,
     const std::vector<ColumnFamilyDescriptor>& cf_descs,
     bool ignore_unknown_options) {
-  ConfigOptions config_options;
+  ConfigOptions config_options(db_options);
   config_options.sanity_level = ConfigOptions::kSanityLevelLooselyCompatible;
   config_options.ignore_unknown_options = ignore_unknown_options;
   config_options.input_strings_escaped = true;
@@ -149,12 +148,11 @@ Status CheckOptionsCompatibility(
     cf_opts.push_back(cf_desc.options);
   }
 
-  LegacyFileSystemWrapper fs(config_options.env);
+  const auto& fs = config_options.env->GetFileSystem();
 
   return RocksDBOptionsParser::VerifyRocksDBOptionsFromFile(
-
       config_options, db_options, cf_names, cf_opts,
-      dbpath + "/" + options_file_name, &fs);
+      dbpath + "/" + options_file_name, fs.get());
 }
 
 }  // namespace ROCKSDB_NAMESPACE