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

junchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-resilientdb.git


The following commit(s) were added to refs/heads/master by this push:
     new efce5f30 rm rocksdb
efce5f30 is described below

commit efce5f3097d5d49afa464c78af77c8cdd5a06305
Author: Ubuntu <[email protected]>
AuthorDate: Sun May 5 00:04:30 2024 +0000

    rm rocksdb
---
 LICENSE                                   |   9 -
 README.md                                 |   2 +-
 WORKSPACE                                 |  20 --
 chain/storage/BUILD                       |  15 --
 chain/storage/kv_storage_test.cpp         |   8 +-
 chain/storage/proto/BUILD                 |  10 -
 chain/storage/proto/rocksdb_config.proto  |  30 ---
 chain/storage/rocksdb.cpp                 | 291 ------------------------------
 chain/storage/rocksdb.h                   |  80 --------
 chain/storage/setting/BUILD               |  14 --
 platform/proto/BUILD                      |   2 -
 platform/proto/replica_info.proto         |   2 -
 service/kv/BUILD                          |   2 -
 service/kv/kv_service.cpp                 |   8 -
 service/tools/config/server/server.config |   5 -
 third_party/BUILD                         |  14 --
 third_party/rocksdb.BUILD                 |  98 ----------
 third_party/zstd.BUILD                    |   5 -
 18 files changed, 2 insertions(+), 613 deletions(-)

diff --git a/LICENSE b/LICENSE
index 931e6e0f..6013705f 100644
--- a/LICENSE
+++ b/LICENSE
@@ -238,15 +238,6 @@ The text of each license is also included in 
licenses/LICENSE-[project].txt.
 * gtest (https://github.com/google/googletest)
 * gflag (https://github.com/gflags/gflags)
 
-================================================================
-GPL-2.0 licenses 
-================================================================
-The following components are provided under the BSD-3-Clause License. See 
project link for details.
-The text of each license is also included in the source code.
-
-* zstd (https://github.com/facebook/zstd)
-* rocksdb (https://github.com/facebook/rocksdb)
-
 ================================================================
 Public Domain
 ================================================================
diff --git a/README.md b/README.md
index 9e14458a..399f75c3 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@
 2. ResilientDB requires deploying at least **3f+1** replicas, where **f (f > 
0)** is the maximum number of arbitrary (or malicious) replicas.
 3. ResilientDB supports primary-backup architecture, which designates one of 
the replicas as the **primary** (replica with identifier **0**). The primary 
replica initiates consensus on a client transaction, while backups agree to 
follow a non-malicious primary.
 4. ResilientDB exposes a wide range of interfaces such as a **Key-Value** 
store, **Smart Contracts**, **UTXO**, and **Python SDK**. Following are some of 
the decentralized applications (DApps) built on top of ResilientDB: **[NFT 
Marketplace](https://nft.resilientdb.com/)** and 
**[Debitable](https://debitable.resilientdb.com/)**.
-5. To persist blockchain, chain state, and metadata, ResilientDB provides 
durability through  **LevelDB** and **RocksDB**.
+5. To persist blockchain, chain state, and metadata, ResilientDB provides 
durability through  **LevelDB**.
 6. ResilientDB provides access to a seamless **GUI display** for deployment 
and maintenance, and supports  **Grafana** for plotting monitoring data. 
 7. **[Historial Facts]** The ResilientDB project was founded by **[Mohammad 
Sadoghi](https://expolab.org/)** along with his students ([Suyash 
Gupta](https://gupta-suyash.github.io/index.html) as the lead Architect, 
[Sajjad Rahnama](https://sajjadrahnama.com/) as the lead System Designer, and 
[Jelle Hellings](https://www.jhellings.nl/)) at **[UC 
Davis](https://www.ucdavis.edu/)** in 2018 and was open-sourced in late 2019. 
On September 30, 2021, we released ResilientDB v-3.0. In 2022, Resi [...]
 
diff --git a/WORKSPACE b/WORKSPACE
index ea67f3e5..29b5bc0c 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -176,26 +176,6 @@ http_archive(
     url = "https://github.com/madler/zlib/archive/v1.2.11.tar.gz";,
 )
 
-bind(
-    name = "zstd",
-    actual = "//third_party:zstd",
-)
-
-http_archive(
-    name = "com_facebook_zstd",
-    build_file_content = all_content,
-    strip_prefix = "zstd-1.5.2",
-    url = "https://github.com/facebook/zstd/archive/refs/tags/v1.5.2.zip";,
-)
-
-http_archive(
-    name = "com_github_facebook_rocksdb",
-    build_file = "@com_resdb_nexres//third_party:rocksdb.BUILD",
-    sha256 = 
"928cbd416c0531e9b2e7fa74864ce0d7097dca3f5a8c31f31459772a28dbfcba",
-    strip_prefix = "rocksdb-7.2.2",
-    url = "https://github.com/facebook/rocksdb/archive/refs/tags/v7.2.2.zip";,
-)
-
 http_archive(
     name = "pybind11_bazel",
     strip_prefix = "pybind11_bazel-2.11.1.bzl.1",
diff --git a/chain/storage/BUILD b/chain/storage/BUILD
index 0ffb39b5..19108fa9 100644
--- a/chain/storage/BUILD
+++ b/chain/storage/BUILD
@@ -56,27 +56,12 @@ cc_library(
     ],
 )
 
-cc_library(
-    name = "rocksdb",
-    srcs = ["rocksdb.cpp"],
-    hdrs = ["rocksdb.h"],
-    tags = ["manual"],
-    deps = [
-        ":storage",
-        "//chain/storage/proto:kv_cc_proto",
-        "//chain/storage/proto:rocksdb_config_cc_proto",
-        "//common:comm",
-        "//third_party:rocksdb",
-    ],
-)
-
 cc_test(
     name = "kv_storage_test",
     srcs = ["kv_storage_test.cpp"],
     deps = [
         ":leveldb",
         ":memory_db",
-        ":rocksdb",
         "//common/test:test_main",
     ],
 )
diff --git a/chain/storage/kv_storage_test.cpp 
b/chain/storage/kv_storage_test.cpp
index 701dcbd9..fd8c4bfd 100644
--- a/chain/storage/kv_storage_test.cpp
+++ b/chain/storage/kv_storage_test.cpp
@@ -25,7 +25,6 @@
 
 #include "chain/storage/leveldb.h"
 #include "chain/storage/memory_db.h"
-#include "chain/storage/rocksdb.h"
 
 namespace resdb {
 namespace storage {
@@ -34,7 +33,6 @@ namespace {
 enum StorageType {
   MEM = 0,
   LEVELDB = 1,
-  ROCKSDB = 2,
 };
 
 class KVStorageTest : public ::testing::TestWithParam<StorageType> {
@@ -49,10 +47,6 @@ class KVStorageTest : public 
::testing::TestWithParam<StorageType> {
         Reset();
         storage = NewResLevelDB(path_);
         break;
-      case ROCKSDB:
-        Reset();
-        storage = NewResRocksDB(path_);
-        break;
     }
   }
 
@@ -225,7 +219,7 @@ TEST_P(KVStorageTest, GetHistory) {
 }
 
 INSTANTIATE_TEST_CASE_P(KVStorageTest, KVStorageTest,
-                        ::testing::Values(MEM, LEVELDB, ROCKSDB));
+                        ::testing::Values(MEM, LEVELDB));
 
 }  // namespace
 }  // namespace storage
diff --git a/chain/storage/proto/BUILD b/chain/storage/proto/BUILD
index 55d10eeb..0b1c7263 100644
--- a/chain/storage/proto/BUILD
+++ b/chain/storage/proto/BUILD
@@ -42,13 +42,3 @@ cc_proto_library(
     name = "leveldb_config_cc_proto",
     deps = [":leveldb_config_proto"],
 )
-
-proto_library(
-    name = "rocksdb_config_proto",
-    srcs = ["rocksdb_config.proto"],
-)
-
-cc_proto_library(
-    name = "rocksdb_config_cc_proto",
-    deps = [":rocksdb_config_proto"],
-)
diff --git a/chain/storage/proto/rocksdb_config.proto 
b/chain/storage/proto/rocksdb_config.proto
deleted file mode 100644
index bb03566c..00000000
--- a/chain/storage/proto/rocksdb_config.proto
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-syntax = "proto3";
-
-package resdb.storage;
-
-message RocksDBInfo {
-  uint32 num_threads = 2;
-  uint32 write_buffer_size_mb = 3;
-  uint32 write_batch_size = 4;
-  string path = 5;
-}
-
diff --git a/chain/storage/rocksdb.cpp b/chain/storage/rocksdb.cpp
deleted file mode 100644
index 86efd3e3..00000000
--- a/chain/storage/rocksdb.cpp
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "chain/storage/rocksdb.h"
-
-#include <glog/logging.h>
-
-#include "chain/storage/proto/kv.pb.h"
-
-namespace resdb {
-namespace storage {
-
-std::unique_ptr<Storage> NewResRocksDB(const std::string& path,
-                                       std::optional<RocksDBInfo> config) {
-  if (config == std::nullopt) {
-    config = RocksDBInfo();
-  }
-  (*config).set_path(path);
-  return std::make_unique<ResRocksDB>(config);
-}
-
-std::unique_ptr<Storage> NewResRocksDB(std::optional<RocksDBInfo> config) {
-  return std::make_unique<ResRocksDB>(config);
-}
-
-ResRocksDB::ResRocksDB(std::optional<RocksDBInfo> config) {
-  std::string path = "/tmp/nexres-rocksdb";
-  if (config.has_value()) {
-    num_threads_ = (*config).num_threads();
-    write_buffer_size_ = (*config).write_buffer_size_mb() << 20;
-    write_batch_size_ = (*config).write_batch_size();
-    if ((*config).path() != "") {
-      LOG(ERROR) << "Custom path for RocksDB provided in config: "
-                 << (*config).path();
-      path = (*config).path();
-    }
-  }
-  CreateDB(path);
-}
-
-void ResRocksDB::CreateDB(const std::string& path) {
-  rocksdb::Options options;
-  options.create_if_missing = true;
-  if (num_threads_ > 1) options.IncreaseParallelism(num_threads_);
-  options.OptimizeLevelStyleCompaction();
-  options.write_buffer_size = write_buffer_size_;
-
-  rocksdb::DB* db = nullptr;
-  rocksdb::Status status = rocksdb::DB::Open(options, path, &db);
-  if (status.ok()) {
-    db_ = std::unique_ptr<rocksdb::DB>(db);
-    LOG(ERROR) << "Successfully opened RocksDB in path: " << path;
-  } else {
-    LOG(ERROR) << "RocksDB status fail";
-  }
-  assert(status.ok());
-  LOG(ERROR) << "Successfully opened RocksDB";
-}
-
-ResRocksDB::~ResRocksDB() {
-  if (db_) {
-    db_.reset();
-  }
-}
-
-int ResRocksDB::SetValue(const std::string& key, const std::string& value) {
-  batch_.Put(key, value);
-
-  if (batch_.Count() >= write_batch_size_) {
-    rocksdb::Status status = db_->Write(rocksdb::WriteOptions(), &batch_);
-    if (status.ok()) {
-      batch_.Clear();
-    } else {
-      LOG(ERROR) << "write value fail:" << status.ToString();
-      return -1;
-    }
-  }
-  return 0;
-}
-
-std::string ResRocksDB::GetValue(const std::string& key) {
-  std::string value = "";
-  rocksdb::Status status = db_->Get(rocksdb::ReadOptions(), key, &value);
-  if (status.ok()) {
-    return value;
-  } else {
-    return "";
-  }
-}
-
-std::string ResRocksDB::GetAllValues(void) {
-  std::string values = "[";
-  rocksdb::Iterator* itr = db_->NewIterator(rocksdb::ReadOptions());
-  bool first_iteration = true;
-  for (itr->SeekToFirst(); itr->Valid(); itr->Next()) {
-    if (!first_iteration) values.append(",");
-    first_iteration = false;
-    values.append(itr->value().ToString());
-  }
-  values.append("]");
-
-  delete itr;
-  return values;
-}
-
-std::string ResRocksDB::GetRange(const std::string& min_key,
-                                 const std::string& max_key) {
-  std::string values = "[";
-  rocksdb::Iterator* itr = db_->NewIterator(rocksdb::ReadOptions());
-  bool first_iteration = true;
-  for (itr->Seek(min_key); itr->Valid() && itr->key().ToString() <= max_key;
-       itr->Next()) {
-    if (!first_iteration) values.append(",");
-    first_iteration = false;
-    values.append(itr->value().ToString());
-  }
-  values.append("]");
-
-  delete itr;
-  return values;
-}
-
-bool ResRocksDB::Flush() {
-  rocksdb::Status status = db_->Write(rocksdb::WriteOptions(), &batch_);
-  if (status.ok()) {
-    batch_.Clear();
-    return true;
-  }
-  LOG(ERROR) << "write value fail:" << status.ToString();
-  return false;
-}
-int ResRocksDB::SetValueWithVersion(const std::string& key,
-                                    const std::string& value, int version) {
-  std::string value_str = GetValue(key);
-  ValueHistory history;
-  if (!history.ParseFromString(value_str)) {
-    LOG(ERROR) << "old_value parse fail";
-    return -2;
-  }
-
-  int last_v = 0;
-  if (history.value_size() > 0) {
-    last_v = history.value(history.value_size() - 1).version();
-  }
-
-  if (last_v != version) {
-    LOG(ERROR) << "version does not match:" << version
-               << " old version:" << last_v;
-    return -2;
-  }
-
-  Value* new_value = history.add_value();
-  new_value->set_value(value);
-  new_value->set_version(version + 1);
-
-  history.SerializeToString(&value_str);
-  return SetValue(key, value_str);
-}
-
-std::pair<std::string, int> ResRocksDB::GetValueWithVersion(
-    const std::string& key, int version) {
-  std::string value_str = GetValue(key);
-  ValueHistory history;
-  if (!history.ParseFromString(value_str)) {
-    LOG(ERROR) << "old_value parse fail";
-    return std::make_pair("", 0);
-  }
-  if (history.value_size() == 0) {
-    return std::make_pair("", 0);
-  }
-  if (version > 0) {
-    for (int i = history.value_size() - 1; i >= 0; --i) {
-      if (history.value(i).version() == version) {
-        return std::make_pair(history.value(i).value(),
-                              history.value(i).version());
-      }
-      if (history.value(i).version() < version) {
-        break;
-      }
-    }
-  }
-  int last_idx = history.value_size() - 1;
-  return std::make_pair(history.value(last_idx).value(),
-                        history.value(last_idx).version());
-}
-
-// Return a map of <key, <value, version>>
-std::map<std::string, std::pair<std::string, int>> ResRocksDB::GetAllItems() {
-  std::map<std::string, std::pair<std::string, int>> resp;
-
-  rocksdb::Iterator* it = db_->NewIterator(rocksdb::ReadOptions());
-  for (it->SeekToFirst(); it->Valid(); it->Next()) {
-    ValueHistory history;
-    if (!history.ParseFromString(it->value().ToString()) ||
-        history.value_size() == 0) {
-      LOG(ERROR) << "old_value parse fail";
-      continue;
-    }
-    const Value& value = history.value(history.value_size() - 1);
-    resp.insert(std::make_pair(it->key().ToString(),
-                               std::make_pair(value.value(), 
value.version())));
-  }
-  delete it;
-
-  return resp;
-}
-
-std::map<std::string, std::pair<std::string, int>> ResRocksDB::GetKeyRange(
-    const std::string& min_key, const std::string& max_key) {
-  std::map<std::string, std::pair<std::string, int>> resp;
-
-  rocksdb::Iterator* it = db_->NewIterator(rocksdb::ReadOptions());
-  for (it->Seek(min_key); it->Valid() && it->key().ToString() <= max_key;
-       it->Next()) {
-    ValueHistory history;
-    if (!history.ParseFromString(it->value().ToString()) ||
-        history.value_size() == 0) {
-      LOG(ERROR) << "old_value parse fail";
-      continue;
-    }
-    const Value& value = history.value(history.value_size() - 1);
-    resp.insert(std::make_pair(it->key().ToString(),
-                               std::make_pair(value.value(), 
value.version())));
-  }
-  delete it;
-
-  return resp;
-}
-
-// Return a list of <value, version>
-std::vector<std::pair<std::string, int>> ResRocksDB::GetHistory(
-    const std::string& key, int min_version, int max_version) {
-  std::vector<std::pair<std::string, int>> resp;
-  std::string value_str = GetValue(key);
-  ValueHistory history;
-  if (!history.ParseFromString(value_str)) {
-    LOG(ERROR) << "old_value parse fail";
-    return resp;
-  }
-
-  for (int i = history.value_size() - 1; i >= 0; --i) {
-    if (history.value(i).version() < min_version) {
-      break;
-    }
-    if (history.value(i).version() <= max_version) {
-      resp.push_back(
-          std::make_pair(history.value(i).value(), 
history.value(i).version()));
-    }
-  }
-
-  return resp;
-}
-
-// Return a list of <value, version>
-std::vector<std::pair<std::string, int>> ResRocksDB::GetTopHistory(
-    const std::string& key, int top_number) {
-  std::vector<std::pair<std::string, int>> resp;
-  std::string value_str = GetValue(key);
-  ValueHistory history;
-  if (!history.ParseFromString(value_str)) {
-    LOG(ERROR) << "old_value parse fail";
-    return resp;
-  }
-
-  for (int i = history.value_size() - 1;
-       i >= 0 && resp.size() < static_cast<size_t>(top_number); --i) {
-    resp.push_back(
-        std::make_pair(history.value(i).value(), history.value(i).version()));
-  }
-
-  return resp;
-}
-
-}  // namespace storage
-}  // namespace resdb
diff --git a/chain/storage/rocksdb.h b/chain/storage/rocksdb.h
deleted file mode 100644
index c3e35564..00000000
--- a/chain/storage/rocksdb.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <memory>
-#include <optional>
-#include <string>
-
-#include "chain/storage/proto/rocksdb_config.pb.h"
-#include "chain/storage/storage.h"
-#include "rocksdb/db.h"
-#include "rocksdb/write_batch.h"
-
-namespace resdb {
-namespace storage {
-
-std::unique_ptr<Storage> NewResRocksDB(
-    const std::string& path, std::optional<RocksDBInfo> config = std::nullopt);
-std::unique_ptr<Storage> NewResRocksDB(
-    std::optional<RocksDBInfo> config = std::nullopt);
-
-class ResRocksDB : public Storage {
- public:
-  ResRocksDB(std::optional<RocksDBInfo> config_data = std::nullopt);
-  virtual ~ResRocksDB();
-  int SetValue(const std::string& key, const std::string& value) override;
-  std::string GetValue(const std::string& key) override;
-  std::string GetAllValues(void) override;
-  std::string GetRange(const std::string& min_key,
-                       const std::string& max_key) override;
-
-  int SetValueWithVersion(const std::string& key, const std::string& value,
-                          int version) override;
-  std::pair<std::string, int> GetValueWithVersion(const std::string& key,
-                                                  int version) override;
-
-  // Return a map of <key, <value, version>>
-  std::map<std::string, std::pair<std::string, int>> GetAllItems() override;
-  std::map<std::string, std::pair<std::string, int>> GetKeyRange(
-      const std::string& min_key, const std::string& max_key) override;
-
-  // Return a list of <value, version>
-  std::vector<std::pair<std::string, int>> GetHistory(const std::string& key,
-                                                      int min_version,
-                                                      int max_version) 
override;
-  std::vector<std::pair<std::string, int>> GetTopHistory(
-      const std::string& key, int top_number) override;
-
-  bool Flush() override;
-
- private:
-  void CreateDB(const std::string& path);
-
- private:
-  std::unique_ptr<::rocksdb::DB> db_ = nullptr;
-  ::rocksdb::WriteBatch batch_;
-  unsigned int num_threads_ = 1;
-  unsigned int write_buffer_size_ = 64 << 20;
-  unsigned int write_batch_size_ = 1;
-};
-
-}  // namespace storage
-}  // namespace resdb
diff --git a/chain/storage/setting/BUILD b/chain/storage/setting/BUILD
index 7e36c9ee..25d11b4e 100644
--- a/chain/storage/setting/BUILD
+++ b/chain/storage/setting/BUILD
@@ -26,12 +26,6 @@ bool_flag(
     visibility = ["//visibility:public"],
 )
 
-bool_flag(
-    name = "enable_rocksdb",
-    build_setting_default = False,
-    visibility = ["//visibility:public"],
-)
-
 config_setting(
     name = "enable_leveldb_setting",
     values = {
@@ -39,11 +33,3 @@ config_setting(
     },
     visibility = ["//visibility:public"],
 )
-
-config_setting(
-    name = "enable_rocksdb_setting",
-    values = {
-        "define": "enable_rocksdb=True",
-    },
-    visibility = ["//visibility:public"],
-)
diff --git a/platform/proto/BUILD b/platform/proto/BUILD
index 88c70e27..3b9166c3 100644
--- a/platform/proto/BUILD
+++ b/platform/proto/BUILD
@@ -38,7 +38,6 @@ proto_library(
     srcs = ["replica_info.proto"],
     deps = [
         "//chain/storage/proto:leveldb_config_proto",
-        "//chain/storage/proto:rocksdb_config_proto",
         "//common/proto:signature_info_proto",
     ],
 )
@@ -55,7 +54,6 @@ python_proto_library(
     protos = [
         ":replica_info_proto",
         "//chain/storage/proto:leveldb_config_proto",
-        "//chain/storage/proto:rocksdb_config_proto",
     ],
     deps = [
         "//common/proto:signature_info_py_proto",
diff --git a/platform/proto/replica_info.proto 
b/platform/proto/replica_info.proto
index 5df8ec1c..eaeac73e 100644
--- a/platform/proto/replica_info.proto
+++ b/platform/proto/replica_info.proto
@@ -23,7 +23,6 @@ package resdb;
 
 import "common/proto/signature_info.proto";
 import "chain/storage/proto/leveldb_config.proto";
-import "chain/storage/proto/rocksdb_config.proto";
 
 message ReplicaInfo {
     int64 id = 1;
@@ -40,7 +39,6 @@ message RegionInfo {
 message ResConfigData{
   repeated RegionInfo region = 1;
   int32 self_region_id = 2;
-  optional storage.RocksDBInfo rocksdb_info = 3;
   optional storage.LevelDBInfo leveldb_info = 4;
   optional bool enable_viewchange = 5;
   optional int32 view_change_timeout_ms = 10;
diff --git a/service/kv/BUILD b/service/kv/BUILD
index a79b779b..0e44111f 100644
--- a/service/kv/BUILD
+++ b/service/kv/BUILD
@@ -26,7 +26,6 @@ cc_binary(
     srcs = ["kv_service.cpp"],
     copts = select({
         "//chain/storage/setting:enable_leveldb_setting": ["-DENABLE_LEVELDB"],
-        "//chain/storage/setting:enable_rocksdb_setting": ["-DENABLE_ROCKSDB"],
         "//conditions:default": [],
     }),
     deps = [
@@ -38,7 +37,6 @@ cc_binary(
         "//chain/storage:memory_db",
     ] + select({
         "//chain/storage/setting:enable_leveldb_setting": 
["//chain/storage:leveldb"],
-        "//chain/storage/setting:enable_rocksdb_setting": 
["//chain/storage:rocksdb"],
         "//conditions:default": [],
     }),
 )
diff --git a/service/kv/kv_service.cpp b/service/kv/kv_service.cpp
index 6cd20e1e..eda6647c 100644
--- a/service/kv/kv_service.cpp
+++ b/service/kv/kv_service.cpp
@@ -27,9 +27,6 @@
 #ifdef ENABLE_LEVELDB
 #include "chain/storage/leveldb.h"
 #endif
-#ifdef ENABLE_ROCKSDB
-#include "chain/storage/rocksdb.h"
-#endif
 
 using namespace resdb;
 using namespace resdb::storage;
@@ -40,11 +37,6 @@ void ShowUsage() {
 
 std::unique_ptr<Storage> NewStorage(const std::string& db_path,
                                     const ResConfigData& config_data) {
-#ifdef ENABLE_ROCKSDB
-  LOG(INFO) << "use rocksdb storage.";
-  return NewResRocksDB(db_path, config_data);
-#endif
-
 #ifdef ENABLE_LEVELDB
   LOG(INFO) << "use leveldb storage.";
   return NewResLevelDB(db_path, config_data);
diff --git a/service/tools/config/server/server.config 
b/service/tools/config/server/server.config
index 7c6680f4..b9e57d18 100644
--- a/service/tools/config/server/server.config
+++ b/service/tools/config/server/server.config
@@ -23,11 +23,6 @@
     region_id: 1,
   },
   self_region_id:1,
-  rocksdb_info : {
-    num_threads:1,
-    write_buffer_size_mb:32,
-    write_batch_size:1,
-  },
   leveldb_info : {
     write_buffer_size_mb:128,
     write_batch_size:1,
diff --git a/third_party/BUILD b/third_party/BUILD
index 9d13dacb..8d2b1b8a 100644
--- a/third_party/BUILD
+++ b/third_party/BUILD
@@ -21,14 +21,6 @@ package(default_visibility = ["//visibility:public"])
 
 load("@rules_foreign_cc//foreign_cc:defs.bzl", "configure_make", "make")
 
-cc_library(
-    name = "rocksdb",
-    tags = ["manual"],
-    deps = [
-        "@com_github_facebook_rocksdb//:rocksdb",
-    ],
-)
-
 cc_library(
     name = "prometheus",
     deps = [
@@ -43,12 +35,6 @@ cc_library(
     ],
 )
 
-make(
-    name = "zstd",
-    lib_source = "@com_facebook_zstd//:all_srcs",
-    out_static_libs = ["libzstd.a"],
-)
-
 cc_library(
     name = "leveldb",
     deps = [
diff --git a/third_party/rocksdb.BUILD b/third_party/rocksdb.BUILD
deleted file mode 100644
index d8d42096..00000000
--- a/third_party/rocksdb.BUILD
+++ /dev/null
@@ -1,98 +0,0 @@
-licenses(["notice"])
-
-genrule(
-    name = "build_version",
-    srcs = glob([".git/**/*"]) + [
-        "util/build_version.cc.in",
-    ],
-    outs = [
-        "util/build_version.cc",
-    ],
-    cmd = "grep -v 'define HAS_GIT_CHANGES' $(<) | " +
-          "sed 's/@ROCKSDB_PLUGIN_BUILTINS@//g' | " +
-          "sed 's/@ROCKSDB_PLUGIN_EXTERNS@//g'  > $(@)",
-)
-
-cc_library(
-    name = "rocksdb",
-    srcs =
-        glob(
-            [
-                "**/*.h",
-                "**/*.cc",
-                "utilities/*.cc",
-            ],
-            exclude = [
-                "java/**/*",
-                "fuzz/**",
-                "**/*test.cc",
-                "**/*bench.cc",
-                "microbench/**",
-                "third-party/**",
-                "util/log_write_bench.cc",
-                "db/forward_iterator_bench.cc",
-                "db/db_test2.cc",
-                "db_stress_tool/*.cc",
-                "tools/**/*.cc",
-                "**/**/*example.cc",
-            ],
-        ) + [":build_version"],
-    hdrs = glob([
-        "include/rocksdb/**/*.h",
-    ]),
-    copts = [
-        "-DGFLAGS=gflags",
-        "-DJEMALLOC_NO_DEMANGLE",
-        "-DOS_LINUX",
-        "-DSNAPPY",
-        "-DHAVE_SSE42",
-        "-DZLIB",
-        "-fno-omit-frame-pointer",
-        "-momit-leaf-frame-pointer",
-        "-msse4.2",
-        "-pthread",
-        "-Werror",
-        "-Wsign-compare",
-        "-Wshadow",
-        "-Wno-unused-parameter",
-        "-Wno-unused-variable",
-        "-Woverloaded-virtual",
-        "-Wnon-virtual-dtor",
-        "-Wno-missing-field-initializers",
-        "-std=c++17",
-        "-W",
-        "-Wextra",
-        "-Wall",
-        "-Wsign-compare",
-        "-Wno-unused-lambda-capture",
-        "-Wno-invalid-offsetof",
-        "-Wunused-variable",
-        "-Wshadow",
-        "-O3",
-    ],
-    defines = [
-        "ROCKSDB_FALLOCATE_PRESENT",
-        "ROCKSDB_LIB_IO_POSIX",
-        "ROCKSDB_MALLOC_USABLE_SIZE",
-        "ROCKSDB_PLATFORM_POSIX",
-        "ROCKSDB_SUPPORT_THREAD_LOCAL",
-        "DISABLE_JEMALLOC",
-    ],
-    includes = [
-        ".",
-        "include",
-        "util",
-    ],
-    linkopts = [
-        "-lm",
-        "-ldl",
-        "-lpthread",
-    ],
-    visibility = ["//visibility:public"],
-    deps = [
-        "//external:glog",
-        "//external:gtest",
-        "//external:snappy",
-        "//external:zlib",
-    ],
-)
diff --git a/third_party/zstd.BUILD b/third_party/zstd.BUILD
deleted file mode 100644
index 912edd7f..00000000
--- a/third_party/zstd.BUILD
+++ /dev/null
@@ -1,5 +0,0 @@
-make(
-    name = "zstd",
-    lib_source = "@com_facebook_zstd//:all_srcs",
-    out_static_libs = ["libzstd.a"],
-)

Reply via email to