This is an automated email from the ASF dual-hosted git repository.

hulk pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/incubator-kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new bf15c984 Remove the duplicate open function (#1046)
bf15c984 is described below

commit bf15c984d7045a86412e1bce52bd0a583de92d35
Author: yaphet <[email protected]>
AuthorDate: Thu Oct 27 12:49:19 2022 +0800

    Remove the duplicate open function (#1046)
---
 src/storage/storage.cc      | 4 ----
 src/storage/storage.h       | 4 +---
 tools/kvrocks2redis/main.cc | 2 +-
 3 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/storage/storage.cc b/src/storage/storage.cc
index 554af44c..d3cc0e54 100644
--- a/src/storage/storage.cc
+++ b/src/storage/storage.cc
@@ -327,10 +327,6 @@ Status Storage::Open(bool read_only) {
   return Status::OK();
 }
 
-Status Storage::Open() { return Open(false); }
-
-Status Storage::OpenForReadOnly() { return Open(true); }
-
 Status Storage::CreateBackup() {
   LOG(INFO) << "[storage] Start to create new backup";
   std::lock_guard<std::mutex> lg(config_->backup_mu_);
diff --git a/src/storage/storage.h b/src/storage/storage.h
index 26f4b265..8ffb1fa9 100644
--- a/src/storage/storage.h
+++ b/src/storage/storage.h
@@ -67,9 +67,7 @@ class Storage {
   ~Storage();
 
   void SetWriteOptions(const Config::RocksDB::WriteOptions &config);
-  Status Open(bool read_only);
-  Status Open();
-  Status OpenForReadOnly();
+  Status Open(bool read_only = false);
   void CloseDB();
   void EmptyDB();
   rocksdb::BlockBasedTableOptions InitTableOptions();
diff --git a/tools/kvrocks2redis/main.cc b/tools/kvrocks2redis/main.cc
index aee73719..79a7101c 100644
--- a/tools/kvrocks2redis/main.cc
+++ b/tools/kvrocks2redis/main.cc
@@ -149,7 +149,7 @@ int main(int argc, char *argv[]) {
   kvrocks_config.cluster_enabled = config.cluster_enable;
 
   Engine::Storage storage(&kvrocks_config);
-  s = storage.OpenForReadOnly();
+  s = storage.Open(true);
   if (!s.IsOK()) {
     LOG(ERROR) << "Failed to open: " << s.Msg();
     exit(1);

Reply via email to