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

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


The following commit(s) were added to refs/heads/smart_contract_merge by this 
push:
     new 2c4de9c0 merge master
2c4de9c0 is described below

commit 2c4de9c0ae058b596cba1db09e5ded962318ecbd
Author: cjcchen <[email protected]>
AuthorDate: Fri Feb 14 02:21:17 2025 +0800

    merge master
---
 benchmark/protocols/cassandra/BUILD                | 16 ----
 .../protocols/cassandra/kv_server_performance.cpp  | 89 ----------------------
 benchmark/protocols/cassandra/kv_service_tools.cpp | 57 --------------
 benchmark/protocols/pbft/BUILD                     | 18 +++++
 benchmark/protocols/poe/BUILD                      | 19 ++++-
 benchmark/protocols/poe/kv_server_performance.cpp  | 35 ++++-----
 benchmark/protocols/simple_pbft/BUILD              | 16 ----
 .../simple_pbft/kv_server_performance.cpp          | 88 ---------------------
 .../protocols/simple_pbft/kv_service_tools.cpp     | 57 --------------
 9 files changed, 51 insertions(+), 344 deletions(-)

diff --git a/benchmark/protocols/cassandra/BUILD 
b/benchmark/protocols/cassandra/BUILD
deleted file mode 100644
index fc92a5e7..00000000
--- a/benchmark/protocols/cassandra/BUILD
+++ /dev/null
@@ -1,16 +0,0 @@
-package(default_visibility = ["//visibility:private"])
-
-load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
-
-cc_binary(
-    name = "kv_server_performance",
-    srcs = ["kv_server_performance.cpp"],
-    deps = [
-        "//chain/storage:memory_db",
-        "//executor/kv:kv_executor",
-        "//platform/config:resdb_config_utils",
-        "//platform/consensus/ordering/cassandra/framework:consensus",
-        "//service/utils:server_factory",
-    ],
-)
-
diff --git a/benchmark/protocols/cassandra/kv_server_performance.cpp 
b/benchmark/protocols/cassandra/kv_server_performance.cpp
deleted file mode 100644
index dcf09e16..00000000
--- a/benchmark/protocols/cassandra/kv_server_performance.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2019-2022 ExpoLab, UC Davis
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- */
-
-#include <glog/logging.h>
-
-#include "chain/storage/memory_db.h"
-#include "executor/kv/kv_executor.h"
-#include "platform/config/resdb_config_utils.h"
-#include "platform/consensus/ordering/cassandra/framework/consensus.h"
-#include "platform/networkstrate/service_network.h"
-#include "platform/statistic/stats.h"
-#include "proto/kv/kv.pb.h"
-
-using namespace resdb;
-using namespace resdb::cassandra;
-using namespace resdb::storage;
-
-void ShowUsage() {
-  printf("<config> <private_key> <cert_file> [logging_dir]\n");
-}
-
-std::string GetRandomKey() {
-  int num1 = rand() % 10;
-  int num2 = rand() % 10;
-  return std::to_string(num1) + std::to_string(num2);
-}
-
-int main(int argc, char** argv) {
-  if (argc < 3) {
-    ShowUsage();
-    exit(0);
-  }
-
-  // google::InitGoogleLogging(argv[0]);
-  // FLAGS_minloglevel = google::GLOG_WARNING;
-
-  char* config_file = argv[1];
-  char* private_key_file = argv[2];
-  char* cert_file = argv[3];
-
-  if (argc >= 5) {
-    auto monitor_port = Stats::GetGlobalStats(5);
-    monitor_port->SetPrometheus(argv[4]);
-  }
-
-  std::unique_ptr<ResDBConfig> config =
-      GenerateResDBConfig(config_file, private_key_file, cert_file);
-
-  config->RunningPerformance(true);
-  ResConfigData config_data = config->GetConfigData();
-
-  auto performance_consens = std::make_unique<Consensus>(
-      *config, std::make_unique<KVExecutor>(std::make_unique<MemoryDB>()));
-  performance_consens->SetupPerformanceDataFunc([]() {
-    KVRequest request;
-    request.set_cmd(KVRequest::SET);
-    request.set_key(GetRandomKey());
-    request.set_value("helloworld");
-    std::string request_data;
-    request.SerializeToString(&request_data);
-    return request_data;
-  });
-
-  auto server =
-      std::make_unique<ServiceNetwork>(*config, 
std::move(performance_consens));
-  server->Run();
-}
diff --git a/benchmark/protocols/cassandra/kv_service_tools.cpp 
b/benchmark/protocols/cassandra/kv_service_tools.cpp
deleted file mode 100644
index 17858ef2..00000000
--- a/benchmark/protocols/cassandra/kv_service_tools.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2019-2022 ExpoLab, UC Davis
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- */
-
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <fstream>
-
-#include "common/proto/signature_info.pb.h"
-#include "interface/kv/kv_client.h"
-#include "platform/config/resdb_config_utils.h"
-
-using resdb::GenerateReplicaInfo;
-using resdb::GenerateResDBConfig;
-using resdb::KVClient;
-using resdb::ReplicaInfo;
-using resdb::ResDBConfig;
-
-int main(int argc, char** argv) {
-  if (argc < 2) {
-    printf("<config path>\n");
-    return 0;
-  }
-  std::string client_config_file = argv[1];
-  ResDBConfig config = GenerateResDBConfig(client_config_file);
-
-  config.SetClientTimeoutMs(100000);
-
-  KVClient client(config);
-
-  client.Set("start", "value");
-  printf("start benchmark\n");
-}
diff --git a/benchmark/protocols/pbft/BUILD b/benchmark/protocols/pbft/BUILD
index 659280d9..f99e8206 100644
--- a/benchmark/protocols/pbft/BUILD
+++ b/benchmark/protocols/pbft/BUILD
@@ -1,3 +1,21 @@
+# 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.
+#
+
 package(default_visibility = ["//visibility:private"])
 
 load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
diff --git a/benchmark/protocols/poe/BUILD b/benchmark/protocols/poe/BUILD
index e7bbde3b..7f1cc05e 100644
--- a/benchmark/protocols/poe/BUILD
+++ b/benchmark/protocols/poe/BUILD
@@ -1,3 +1,21 @@
+# 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.
+#
+
 package(default_visibility = ["//visibility:private"])
 
 load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
@@ -13,4 +31,3 @@ cc_binary(
         "//service/utils:server_factory",
     ],
 )
-
diff --git a/benchmark/protocols/poe/kv_server_performance.cpp 
b/benchmark/protocols/poe/kv_server_performance.cpp
index 494db828..90a220a1 100644
--- a/benchmark/protocols/poe/kv_server_performance.cpp
+++ b/benchmark/protocols/poe/kv_server_performance.cpp
@@ -1,26 +1,20 @@
 /*
- * Copyright (c) 2019-2022 ExpoLab, UC Davis
+ * 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
  *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
+ *   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 <glog/logging.h>
@@ -82,6 +76,7 @@ int main(int argc, char** argv) {
     request.SerializeToString(&request_data);
     return request_data;
   });
+
   auto server =
       std::make_unique<ServiceNetwork>(*config, 
std::move(performance_consens));
   server->Run();
diff --git a/benchmark/protocols/simple_pbft/BUILD 
b/benchmark/protocols/simple_pbft/BUILD
deleted file mode 100644
index 8aa647e1..00000000
--- a/benchmark/protocols/simple_pbft/BUILD
+++ /dev/null
@@ -1,16 +0,0 @@
-package(default_visibility = ["//visibility:private"])
-
-load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
-
-cc_binary(
-    name = "kv_server_performance",
-    srcs = ["kv_server_performance.cpp"],
-    deps = [
-        "//chain/storage:memory_db",
-        "//executor/kv:kv_executor",
-        "//platform/config:resdb_config_utils",
-        "//platform/consensus/ordering/simple_pbft/framework:consensus",
-        "//service/utils:server_factory",
-    ],
-)
-
diff --git a/benchmark/protocols/simple_pbft/kv_server_performance.cpp 
b/benchmark/protocols/simple_pbft/kv_server_performance.cpp
deleted file mode 100644
index 6bdcba45..00000000
--- a/benchmark/protocols/simple_pbft/kv_server_performance.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2019-2022 ExpoLab, UC Davis
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- */
-
-#include <glog/logging.h>
-
-#include "chain/storage/memory_db.h"
-#include "executor/kv/kv_executor.h"
-#include "platform/config/resdb_config_utils.h"
-#include "platform/consensus/ordering/simple_pbft/framework/consensus.h"
-#include "platform/networkstrate/service_network.h"
-#include "platform/statistic/stats.h"
-#include "proto/kv/kv.pb.h"
-
-using namespace resdb;
-using namespace resdb::simple_pbft;
-using namespace resdb::storage;
-
-void ShowUsage() {
-  printf("<config> <private_key> <cert_file> [logging_dir]\n");
-}
-
-std::string GetRandomKey() {
-  int num1 = rand() % 10;
-  int num2 = rand() % 10;
-  return std::to_string(num1) + std::to_string(num2);
-}
-
-int main(int argc, char** argv) {
-  if (argc < 3) {
-    ShowUsage();
-    exit(0);
-  }
-
-  // google::InitGoogleLogging(argv[0]);
-  // FLAGS_minloglevel = google::GLOG_WARNING;
-
-  char* config_file = argv[1];
-  char* private_key_file = argv[2];
-  char* cert_file = argv[3];
-
-  if (argc >= 5) {
-    auto monitor_port = Stats::GetGlobalStats(5);
-    monitor_port->SetPrometheus(argv[4]);
-  }
-
-  std::unique_ptr<ResDBConfig> config =
-      GenerateResDBConfig(config_file, private_key_file, cert_file);
-
-  config->RunningPerformance(true);
-  ResConfigData config_data = config->GetConfigData();
-
-  auto performance_consens = std::make_unique<Consensus>(
-      *config, std::make_unique<KVExecutor>(std::make_unique<MemoryDB>()));
-  performance_consens->SetupPerformanceDataFunc([]() {
-    KVRequest request;
-    request.set_cmd(KVRequest::SET);
-    request.set_key(GetRandomKey());
-    request.set_value("helloword");
-    std::string request_data;
-    request.SerializeToString(&request_data);
-    return request_data;
-  });
-  auto server =
-      std::make_unique<ServiceNetwork>(*config, 
std::move(performance_consens));
-  server->Run();
-}
diff --git a/benchmark/protocols/simple_pbft/kv_service_tools.cpp 
b/benchmark/protocols/simple_pbft/kv_service_tools.cpp
deleted file mode 100644
index 17858ef2..00000000
--- a/benchmark/protocols/simple_pbft/kv_service_tools.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2019-2022 ExpoLab, UC Davis
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- */
-
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <fstream>
-
-#include "common/proto/signature_info.pb.h"
-#include "interface/kv/kv_client.h"
-#include "platform/config/resdb_config_utils.h"
-
-using resdb::GenerateReplicaInfo;
-using resdb::GenerateResDBConfig;
-using resdb::KVClient;
-using resdb::ReplicaInfo;
-using resdb::ResDBConfig;
-
-int main(int argc, char** argv) {
-  if (argc < 2) {
-    printf("<config path>\n");
-    return 0;
-  }
-  std::string client_config_file = argv[1];
-  ResDBConfig config = GenerateResDBConfig(client_config_file);
-
-  config.SetClientTimeoutMs(100000);
-
-  KVClient client(config);
-
-  client.Set("start", "value");
-  printf("start benchmark\n");
-}

Reply via email to