]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/options/options_parser.h
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / rocksdb / options / options_parser.h
index ba173c5786c7b7a7d39e5e5c3755dafd44562647..5aab3e7e9b6b87a096d4ec798d43cd4d900199e6 100644 (file)
@@ -1,7 +1,7 @@
 // Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
-// This source code is licensed under the BSD-style license found in the
-// LICENSE file in the root directory of this source tree. An additional grant
-// of patent rights can be found in the PATENTS file in the same directory.
+//  This source code is licensed under both the GPLv2 (found in the
+//  COPYING file in the root directory) and Apache 2.0 License
+//  (found in the LICENSE.Apache file in the root directory).
 
 #pragma once
 
@@ -9,7 +9,6 @@
 #include <string>
 #include <vector>
 
-#include "options/options_helper.h"
 #include "options/options_sanity_check.h"
 #include "rocksdb/env.h"
 #include "rocksdb/options.h"
@@ -38,13 +37,19 @@ Status PersistRocksDBOptions(const DBOptions& db_opt,
                              const std::vector<ColumnFamilyOptions>& cf_opts,
                              const std::string& file_name, Env* env);
 
+extern bool AreEqualOptions(
+    const char* opt1, const char* opt2, const OptionTypeInfo& type_info,
+    const std::string& opt_name,
+    const std::unordered_map<std::string, std::string>* opt_map);
+
 class RocksDBOptionsParser {
  public:
   explicit RocksDBOptionsParser();
   ~RocksDBOptionsParser() {}
   void Reset();
 
-  Status Parse(const std::string& file_name, Env* env);
+  Status Parse(const std::string& file_name, Env* env,
+               bool ignore_unknown_options = false);
   static std::string TrimAndRemoveComment(const std::string& line,
                                           const bool trim_only = false);
 
@@ -68,7 +73,8 @@ class RocksDBOptionsParser {
       const DBOptions& db_opt, const std::vector<std::string>& cf_names,
       const std::vector<ColumnFamilyOptions>& cf_opts,
       const std::string& file_name, Env* env,
-      OptionsSanityCheckLevel sanity_check_level = kSanityLevelExactMatch);
+      OptionsSanityCheckLevel sanity_check_level = kSanityLevelExactMatch,
+      bool ignore_unknown_options = false);
 
   static Status VerifyDBOptions(
       const DBOptions& base_opt, const DBOptions& new_opt,
@@ -84,11 +90,6 @@ class RocksDBOptionsParser {
       const TableFactory* base_tf, const TableFactory* file_tf,
       OptionsSanityCheckLevel sanity_check_level = kSanityLevelExactMatch);
 
-  static Status VerifyBlockBasedTableFactory(
-      const BlockBasedTableFactory* base_tf,
-      const BlockBasedTableFactory* file_tf,
-      OptionsSanityCheckLevel sanity_check_level);
-
   static Status ExtraParserCheck(const RocksDBOptionsParser& input_parser);
 
  protected:
@@ -103,10 +104,10 @@ class RocksDBOptionsParser {
   Status ParseStatement(std::string* name, std::string* value,
                         const std::string& line, const int line_num);
 
-  Status EndSection(
-      const OptionSection section, const std::string& title,
-      const std::string& section_arg,
-      const std::unordered_map<std::string, std::string>& opt_map);
+  Status EndSection(const OptionSection section, const std::string& title,
+                    const std::string& section_arg,
+                    const std::unordered_map<std::string, std::string>& opt_map,
+                    bool ignore_unknown_options);
 
   Status ValidityCheck();