// 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
#include <string>
#include <vector>
-#include "options/options_helper.h"
#include "options/options_sanity_check.h"
#include "rocksdb/env.h"
#include "rocksdb/options.h"
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);
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,
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:
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();