diff --git a/.licenserc.yaml b/.licenserc.yaml index 9f7aa61c2d..0c90e3d7ef 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -162,7 +162,7 @@ header: - 'src/aio/file_io.h' - 'src/runtime/task/future_types.h' - 'src/runtime/global_config.h' - - 'src/common/gpid.h' + - 'src/utils/gpid.h' - 'src/runtime/rpc/group_address.h' - 'src/utils/logging_provider.h' - 'src/runtime/rpc/message_parser.h' diff --git a/cmake_modules/BaseFunctions.cmake b/cmake_modules/BaseFunctions.cmake index b1dff9b601..33e2c814d6 100644 --- a/cmake_modules/BaseFunctions.cmake +++ b/cmake_modules/BaseFunctions.cmake @@ -156,12 +156,6 @@ function(dsn_add_static_library) dsn_install_library() endfunction(dsn_add_static_library) -function(dsn_add_shared_library) - set(MY_PROJ_TYPE "SHARED") - dsn_add_project() - dsn_install_library() -endfunction(dsn_add_shared_library) - function(dsn_add_executable) set(MY_PROJ_TYPE "EXECUTABLE") dsn_add_project() diff --git a/src/aio/CMakeLists.txt b/src/aio/CMakeLists.txt index 3a27fbe01a..4db5b0d4c4 100644 --- a/src/aio/CMakeLists.txt +++ b/src/aio/CMakeLists.txt @@ -35,6 +35,9 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_runtime + sasl2 + gssapi_krb5 + krb5 rocksdb lz4 zstd diff --git a/src/aio/test/CMakeLists.txt b/src/aio/test/CMakeLists.txt index cbc853d834..08b55e6839 100644 --- a/src/aio/test/CMakeLists.txt +++ b/src/aio/test/CMakeLists.txt @@ -30,8 +30,12 @@ set(MY_PROJ_LIBS dsn_meta_server dsn_ranger dsn_replication_common + sasl2 + gssapi_krb5 + krb5 dsn_aio test_utils + dsn_utils gtest rocksdb lz4 diff --git a/src/base/CMakeLists.txt b/src/base/CMakeLists.txt index 7c117ef4f1..54b78b2345 100644 --- a/src/base/CMakeLists.txt +++ b/src/base/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -set(MY_PROJ_NAME "pegasus_base") +set(MY_PROJ_NAME pegasus_base) if(UNIX) add_compile_options(-fPIC) diff --git a/src/base/test/CMakeLists.txt b/src/base/test/CMakeLists.txt index b7e1c29d0e..7fae9d7d82 100644 --- a/src/base/test/CMakeLists.txt +++ b/src/base/test/CMakeLists.txt @@ -28,10 +28,13 @@ set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS - dsn_runtime - dsn_utils - pegasus_base - gtest) + dsn_runtime + sasl2 + gssapi_krb5 + krb5 + dsn_utils + pegasus_base + gtest) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/block_service/block_service.h b/src/block_service/block_service.h index d351dcf44a..1f4b17b213 100644 --- a/src/block_service/block_service.h +++ b/src/block_service/block_service.h @@ -28,7 +28,7 @@ #include "utils/error_code.h" #include "utils/threadpool_code.h" #include "runtime/task/task_code.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "runtime/rpc/serialization.h" #include "runtime/rpc/rpc_stream.h" #include "runtime/serverlet.h" diff --git a/src/block_service/test/CMakeLists.txt b/src/block_service/test/CMakeLists.txt index b8aaad6520..70a5534df2 100644 --- a/src/block_service/test/CMakeLists.txt +++ b/src/block_service/test/CMakeLists.txt @@ -27,6 +27,9 @@ set(MY_PROJ_LIBS dsn.block_service.local dsn.block_service.hdfs dsn_runtime + sasl2 + gssapi_krb5 + krb5 dsn_utils gtest gtest_main diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 21134b3f4c..00279e1085 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -33,7 +33,9 @@ set(MY_PROJ_SRC "") # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS "") +set(MY_PROJ_LIBS + dsn_utils + dsn_replication_common) # Extra files that will be installed set(MY_BINPLACES "") diff --git a/src/client/partition_resolver.h b/src/client/partition_resolver.h index b870b2c7a2..276c101982 100644 --- a/src/client/partition_resolver.h +++ b/src/client/partition_resolver.h @@ -33,7 +33,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "runtime/rpc/rpc_address.h" #include "runtime/rpc/rpc_message.h" #include "runtime/rpc/serialization.h" diff --git a/src/client/partition_resolver_simple.cpp b/src/client/partition_resolver_simple.cpp index a0fd30224d..32c31d5b25 100644 --- a/src/client/partition_resolver_simple.cpp +++ b/src/client/partition_resolver_simple.cpp @@ -31,7 +31,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "dsn.layer2_types.h" #include "partition_resolver_simple.h" #include "runtime/api_layer1.h" diff --git a/src/client/replication_ddl_client.cpp b/src/client/replication_ddl_client.cpp index e086613050..66d1727c3f 100644 --- a/src/client/replication_ddl_client.cpp +++ b/src/client/replication_ddl_client.cpp @@ -38,7 +38,7 @@ #include "backup_types.h" #include "common//duplication_common.h" #include "common/bulk_load_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/manual_compact.h" #include "common/partition_split_common.h" #include "common/replication.codes.h" @@ -513,8 +513,9 @@ std::string host_name_resolve(bool resolve_ip, std::string value) { if (resolve_ip) { std::string temp; - if (dsn::utils::hostname_from_ip_port(value.c_str(), &temp)) + if (dsn::utils::hostname_from_ip_port(value.c_str(), &temp)) { return temp; + } } return value; } diff --git a/src/client/test/CMakeLists.txt b/src/client/test/CMakeLists.txt index 60f3762760..c0a5d0430a 100644 --- a/src/client/test/CMakeLists.txt +++ b/src/client/test/CMakeLists.txt @@ -25,6 +25,9 @@ set(MY_PROJ_LIBS dsn_client dsn_replication_common dsn_runtime + sasl2 + gssapi_krb5 + krb5 dsn_utils gtest rocksdb diff --git a/src/client_lib/CMakeLists.txt b/src/client_lib/CMakeLists.txt index 0bc95bfb51..52537c5796 100644 --- a/src/client_lib/CMakeLists.txt +++ b/src/client_lib/CMakeLists.txt @@ -16,7 +16,7 @@ # under the License. # TODO(yingchun): should export shared lib too!!! -set(MY_PROJ_NAME "pegasus_client_static") +set(MY_PROJ_NAME pegasus_client_static) add_definitions(-fPIC) diff --git a/src/client_lib/pegasus_scanner_impl.cpp b/src/client_lib/pegasus_scanner_impl.cpp index d161a541f2..92c07095e6 100644 --- a/src/client_lib/pegasus_scanner_impl.cpp +++ b/src/client_lib/pegasus_scanner_impl.cpp @@ -28,7 +28,7 @@ #include #include "base/pegasus_const.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "pegasus/client.h" #include "pegasus/error.h" #include "pegasus_client_impl.h" diff --git a/src/common/backup_common.cpp b/src/common/backup_common.cpp index 0d58b8bf02..17ae8cfc02 100644 --- a/src/common/backup_common.cpp +++ b/src/common/backup_common.cpp @@ -17,7 +17,7 @@ #include "backup_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "runtime/api_layer1.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/common/fs_manager.cpp b/src/common/fs_manager.cpp index 88b1da6603..25d566c97d 100644 --- a/src/common/fs_manager.cpp +++ b/src/common/fs_manager.cpp @@ -33,7 +33,7 @@ #include #include "absl/strings/string_view.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_enums.h" #include "fmt/core.h" #include "replica_admin_types.h" diff --git a/src/common/json_helper.h b/src/common/json_helper.h index 291909bc84..6100b99a4c 100644 --- a/src/common/json_helper.h +++ b/src/common/json_helper.h @@ -50,7 +50,7 @@ #include "utils/error_code.h" #include "utils/threadpool_code.h" #include "runtime/task/task_code.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "meta_admin_types.h" #include "partition_split_types.h" #include "duplication_types.h" diff --git a/src/common/replication.codes.h b/src/common/replication.codes.h index a542e58130..f92b59e43c 100644 --- a/src/common/replication.codes.h +++ b/src/common/replication.codes.h @@ -29,7 +29,7 @@ #include "utils/error_code.h" #include "utils/threadpool_code.h" #include "runtime/task/task_code.h" -#include "common/gpid.h" +#include "utils/gpid.h" DEFINE_THREAD_POOL_CODE(THREAD_POOL_META_SERVER) DEFINE_THREAD_POOL_CODE(THREAD_POOL_META_STATE) diff --git a/src/common/replication_common.cpp b/src/common/replication_common.cpp index a54d4bbfd2..aa2af1a4db 100644 --- a/src/common/replication_common.cpp +++ b/src/common/replication_common.cpp @@ -33,7 +33,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replica_envs.h" #include "common/replication_other_types.h" #include "dsn.layer2_types.h" diff --git a/src/common/storage_serverlet.h b/src/common/storage_serverlet.h index ee1ef3bee2..33ac1929ee 100644 --- a/src/common/storage_serverlet.h +++ b/src/common/storage_serverlet.h @@ -39,7 +39,7 @@ #include "utils/error_code.h" #include "utils/threadpool_code.h" #include "runtime/task/task_code.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "runtime/rpc/serialization.h" #include "runtime/rpc/rpc_stream.h" #include "runtime/serverlet.h" diff --git a/src/common/test/CMakeLists.txt b/src/common/test/CMakeLists.txt index fab0926249..72c1cb1acb 100644 --- a/src/common/test/CMakeLists.txt +++ b/src/common/test/CMakeLists.txt @@ -30,6 +30,10 @@ set(MY_PROJ_LIBS dsn_http dsn_replication_common dsn_runtime + sasl2 + gssapi_krb5 + krb5 + dsn_utils gtest rocksdb lz4 diff --git a/src/common/test/fs_manager_test.cpp b/src/common/test/fs_manager_test.cpp index 2e67dd85f9..808b704fb9 100644 --- a/src/common/test/fs_manager_test.cpp +++ b/src/common/test/fs_manager_test.cpp @@ -26,7 +26,7 @@ #include #include "common/fs_manager.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_other_types.h" #include "gtest/gtest.h" #include "metadata_types.h" diff --git a/src/failure_detector/fd.code.definition.h b/src/failure_detector/fd.code.definition.h index 1f8934aaee..7f7d96dfd3 100644 --- a/src/failure_detector/fd.code.definition.h +++ b/src/failure_detector/fd.code.definition.h @@ -34,7 +34,7 @@ #include "utils/error_code.h" #include "utils/threadpool_code.h" #include "runtime/task/task_code.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "runtime/rpc/serialization.h" #include "runtime/rpc/rpc_stream.h" #include "runtime/serverlet.h" diff --git a/src/failure_detector/test/CMakeLists.txt b/src/failure_detector/test/CMakeLists.txt index 54907d6ee8..308f82cb6b 100644 --- a/src/failure_detector/test/CMakeLists.txt +++ b/src/failure_detector/test/CMakeLists.txt @@ -26,14 +26,28 @@ set(MY_PROJ_NAME dsn.failure_detector.tests) set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS - dsn_runtime dsn_meta_server dsn_ranger + dsn_runtime + sasl2 + gssapi_krb5 + krb5 dsn_replica_server + dsn.security + dsn_nfs + dsn_aio + dsn_dist_cmd dsn_replication_common + dsn.block_service + dsn.block_service.hdfs + dsn.block_service.local dsn.failure_detector - gtest + dsn.replication.zookeeper_provider + zookeeper hashtable + dsn_utils + gtest + test_utils rocksdb lz4 zstd diff --git a/src/geo/bench/CMakeLists.txt b/src/geo/bench/CMakeLists.txt index 559747b59d..4601455723 100644 --- a/src/geo/bench/CMakeLists.txt +++ b/src/geo/bench/CMakeLists.txt @@ -28,17 +28,25 @@ set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS + dsn_runtime + sasl2 + gssapi_krb5 + krb5 + pegasus_geo_lib + pegasus_client_static + dsn_client + dsn_utils + dsn_http + dsn_replication_common absl::flat_hash_set absl::strings - pegasus_geo_lib s2testing s2 - pegasus_client_static + thrift rocksdb lz4 zstd - snappy - dsn_utils) + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/geo/lib/CMakeLists.txt b/src/geo/lib/CMakeLists.txt index 094bfb352c..420bb24844 100644 --- a/src/geo/lib/CMakeLists.txt +++ b/src/geo/lib/CMakeLists.txt @@ -27,10 +27,9 @@ set(MY_PROJ_SRC "") # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS "" - # s2 - # pegasus_client_static - ) +set(MY_PROJ_LIBS + s2 + pegasus_client_static) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/geo/test/CMakeLists.txt b/src/geo/test/CMakeLists.txt index e29d506ae1..3cf968a692 100644 --- a/src/geo/test/CMakeLists.txt +++ b/src/geo/test/CMakeLists.txt @@ -28,12 +28,17 @@ set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS + dsn_runtime + sasl2 + gssapi_krb5 + krb5 absl::flat_hash_set absl::strings pegasus_geo_lib s2testing s2 pegasus_client_static + dsn_client dsn_utils gtest) diff --git a/src/http/CMakeLists.txt b/src/http/CMakeLists.txt index 44f93796d8..56c8f4fc67 100644 --- a/src/http/CMakeLists.txt +++ b/src/http/CMakeLists.txt @@ -21,7 +21,8 @@ set(MY_PROJ_SRC ${THIRDPARTY_ROOT}/build/Source/http-parser/http_parser.c) set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS "") +set(MY_PROJ_LIBS + dsn_replication_common) dsn_add_static_library() diff --git a/src/http/http_server.h b/src/http/http_server.h index 5ae780b983..3839dd780b 100644 --- a/src/http/http_server.h +++ b/src/http/http_server.h @@ -113,12 +113,13 @@ class http_server_base : public http_service { static std::once_flag flag; std::call_once(flag, [&]() { - register_handler("updateConfig", - std::bind(&http_server_base::update_config_handler, - this, - std::placeholders::_1, - std::placeholders::_2), - "ip:port/updateConfig?="); + // undefined reference to `dsn::http_server_base::update_config_handler + // register_handler("updateConfig", + // std::bind(&http_server_base::update_config_handler, + // this, + // std::placeholders::_1, + // std::placeholders::_2), + // "ip:port/updateConfig?="); }); } diff --git a/src/http/test/CMakeLists.txt b/src/http/test/CMakeLists.txt index 4400c0183f..9b2d9ad8ca 100644 --- a/src/http/test/CMakeLists.txt +++ b/src/http/test/CMakeLists.txt @@ -24,12 +24,16 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_http dsn_runtime + sasl2 + gssapi_krb5 + krb5 + dsn_utils curl gtest rocksdb lz4 - zstd - snappy) + snappy + zstd) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/meta/CMakeLists.txt b/src/meta/CMakeLists.txt index 95ecb3b9a8..06dfb8ce6f 100644 --- a/src/meta/CMakeLists.txt +++ b/src/meta/CMakeLists.txt @@ -38,6 +38,12 @@ set(MY_PROJ_LIBS dsn_dist_cmd dsn_http dsn_runtime + sasl2 + gssapi_krb5 + krb5 + dsn_ranger + dsn.security + dsn.task dsn_aio zookeeper hashtable @@ -48,5 +54,6 @@ set(MY_PROJ_LIBS snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES "") -dsn_add_shared_library() +dsn_add_static_library() + add_subdirectory(test) diff --git a/src/meta/app_balance_policy.cpp b/src/meta/app_balance_policy.cpp index 972f8ba5a1..6d1f17be75 100644 --- a/src/meta/app_balance_policy.cpp +++ b/src/meta/app_balance_policy.cpp @@ -23,7 +23,7 @@ #include #include "app_balance_policy.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "meta/load_balance_policy.h" #include "metadata_types.h" #include "utils/flags.h" diff --git a/src/meta/backup_engine.cpp b/src/meta/backup_engine.cpp index c7d3769ce0..18db086397 100644 --- a/src/meta/backup_engine.cpp +++ b/src/meta/backup_engine.cpp @@ -27,7 +27,7 @@ #include "block_service/block_service.h" #include "block_service/block_service_manager.h" #include "common/backup_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/json_helper.h" #include "common/replication.codes.h" #include "dsn.layer2_types.h" diff --git a/src/meta/cluster_balance_policy.h b/src/meta/cluster_balance_policy.h index 474935d897..678beab869 100644 --- a/src/meta/cluster_balance_policy.h +++ b/src/meta/cluster_balance_policy.h @@ -28,7 +28,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "load_balance_policy.h" #include "meta/meta_data.h" #include "metadata_types.h" diff --git a/src/meta/dump_file.h b/src/meta/dump_file.h index 062ffd1fcc..222b4d4453 100644 --- a/src/meta/dump_file.h +++ b/src/meta/dump_file.h @@ -38,7 +38,7 @@ #include "utils/error_code.h" #include "utils/threadpool_code.h" #include "runtime/task/task_code.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "runtime/rpc/serialization.h" #include "runtime/rpc/rpc_stream.h" #include "runtime/serverlet.h" diff --git a/src/meta/duplication/meta_duplication_service.cpp b/src/meta/duplication/meta_duplication_service.cpp index fd1d034f17..7096d24e8d 100644 --- a/src/meta/duplication/meta_duplication_service.cpp +++ b/src/meta/duplication/meta_duplication_service.cpp @@ -23,7 +23,7 @@ #include "common//duplication_common.h" #include "common/common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "common/replication_other_types.h" #include "dsn.layer2_types.h" diff --git a/src/meta/load_balance_policy.h b/src/meta/load_balance_policy.h index f0e06bf0b6..700c561aea 100644 --- a/src/meta/load_balance_policy.h +++ b/src/meta/load_balance_policy.h @@ -30,7 +30,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_other_types.h" #include "meta_data.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/meta/meta_backup_service.h b/src/meta/meta_backup_service.h index e382a8922c..03970df72c 100644 --- a/src/meta/meta_backup_service.h +++ b/src/meta/meta_backup_service.h @@ -33,7 +33,7 @@ #include #include "backup_types.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/json_helper.h" #include "common/replication_other_types.h" #include "meta_rpc_types.h" diff --git a/src/meta/meta_bulk_load_ingestion_context.h b/src/meta/meta_bulk_load_ingestion_context.h index 50e7872d5f..bf31a2954f 100644 --- a/src/meta/meta_bulk_load_ingestion_context.h +++ b/src/meta/meta_bulk_load_ingestion_context.h @@ -21,7 +21,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "runtime/rpc/rpc_address.h" #include "utils/flags.h" diff --git a/src/meta/meta_bulk_load_service.h b/src/meta/meta_bulk_load_service.h index c411d87f44..a138b36be4 100644 --- a/src/meta/meta_bulk_load_service.h +++ b/src/meta/meta_bulk_load_service.h @@ -30,7 +30,7 @@ #include "bulk_load_types.h" #include "common/bulk_load_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/json_helper.h" #include "common/replication_other_types.h" #include "meta/meta_state_service_utils.h" diff --git a/src/meta/meta_data.cpp b/src/meta/meta_data.cpp index a44180d4a0..2da8f3f3bc 100644 --- a/src/meta/meta_data.cpp +++ b/src/meta/meta_data.cpp @@ -27,7 +27,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_enums.h" #include "meta_data.h" #include "runtime/api_layer1.h" diff --git a/src/meta/meta_data.h b/src/meta/meta_data.h index ea236fa5cc..75469896ea 100644 --- a/src/meta/meta_data.h +++ b/src/meta/meta_data.h @@ -39,7 +39,7 @@ #include #include "common/duplication_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/json_helper.h" #include "common/replication_other_types.h" #include "dsn.layer2_types.h" diff --git a/src/meta/meta_http_service.cpp b/src/meta/meta_http_service.cpp index 400fd160ed..23f307c3d5 100644 --- a/src/meta/meta_http_service.cpp +++ b/src/meta/meta_http_service.cpp @@ -30,7 +30,7 @@ #include "bulk_load_types.h" #include "common//duplication_common.h" #include "common/bulk_load_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replica_envs.h" #include "common/replication.codes.h" #include "common/replication_common.h" diff --git a/src/meta/meta_service.cpp b/src/meta/meta_service.cpp index 0acd4890ae..31438a0c96 100644 --- a/src/meta/meta_service.cpp +++ b/src/meta/meta_service.cpp @@ -38,7 +38,7 @@ #include "backup_types.h" #include "bulk_load_types.h" #include "common/common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "dsn.layer2_types.h" #include "duplication_types.h" diff --git a/src/meta/meta_split_service.cpp b/src/meta/meta_split_service.cpp index 33610fc6a4..23ac7fbab5 100644 --- a/src/meta/meta_split_service.cpp +++ b/src/meta/meta_split_service.cpp @@ -24,7 +24,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/json_helper.h" #include "common/replica_envs.h" #include "common/replication.codes.h" diff --git a/src/meta/partition_guardian.h b/src/meta/partition_guardian.h index 9c77da7e52..f43c02bc53 100644 --- a/src/meta/partition_guardian.h +++ b/src/meta/partition_guardian.h @@ -25,7 +25,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "dsn.layer2_types.h" #include "meta_admin_types.h" #include "meta_data.h" diff --git a/src/meta/server_load_balancer.cpp b/src/meta/server_load_balancer.cpp index 04b53f6720..9c7862ff2f 100644 --- a/src/meta/server_load_balancer.cpp +++ b/src/meta/server_load_balancer.cpp @@ -28,7 +28,7 @@ #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "dsn.layer2_types.h" #include "meta/meta_data.h" #include "meta_admin_types.h" diff --git a/src/meta/server_state.h b/src/meta/server_state.h index e8c1c4f070..00be470abe 100644 --- a/src/meta/server_state.h +++ b/src/meta/server_state.h @@ -38,7 +38,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/manual_compact.h" #include "dsn.layer2_types.h" #include "meta/meta_rpc_types.h" diff --git a/src/meta/server_state_restore.cpp b/src/meta/server_state_restore.cpp index b2dada4a25..9b45b6f890 100644 --- a/src/meta/server_state_restore.cpp +++ b/src/meta/server_state_restore.cpp @@ -31,7 +31,7 @@ #include "block_service/block_service.h" #include "block_service/block_service_manager.h" #include "common/backup_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/json_helper.h" #include "common/replication.codes.h" #include "dsn.layer2_types.h" diff --git a/src/meta/table_metrics.h b/src/meta/table_metrics.h index cec35e64b8..c4ad6d6678 100644 --- a/src/meta/table_metrics.h +++ b/src/meta/table_metrics.h @@ -23,7 +23,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "utils/autoref_ptr.h" #include "utils/fmt_logging.h" #include "utils/metrics.h" diff --git a/src/meta/test/CMakeLists.txt b/src/meta/test/CMakeLists.txt index 13a1efe9d1..64d36eedd4 100644 --- a/src/meta/test/CMakeLists.txt +++ b/src/meta/test/CMakeLists.txt @@ -29,22 +29,31 @@ file(GLOB MY_PROJ_SRC set(MY_PROJ_SRC ${MY_PROJ_SRC} misc/misc.cpp) set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS - dsn.replication.zookeeper_provider + dsn_meta_server + dsn_ranger + dsn_dist_cmd dsn_replication_common + dsn.replication.zookeeper_provider + zookeeper + hashtable dsn.block_service - dsn.block_service.local dsn.block_service.hdfs + hdfs + dsn.block_service.local dsn.failure_detector - dsn_dist_cmd + dsn_aio dsn_http - dsn_meta_server - dsn_ranger dsn_runtime - dsn_aio - zookeeper - hashtable + dsn_utils + sasl2 + gssapi_krb5 + krb5 gtest - hdfs) + rocksdb + lz4 + zstd + snappy) + set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES clear.sh diff --git a/src/meta/test/backup_test.cpp b/src/meta/test/backup_test.cpp index b27ba49958..aab0d141a2 100644 --- a/src/meta/test/backup_test.cpp +++ b/src/meta/test/backup_test.cpp @@ -30,7 +30,7 @@ #include #include "backup_types.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "dsn.layer2_types.h" #include "gtest/gtest.h" diff --git a/src/meta/test/balancer_simulator/CMakeLists.txt b/src/meta/test/balancer_simulator/CMakeLists.txt index 69ddfc4a44..f48a7ffcc5 100644 --- a/src/meta/test/balancer_simulator/CMakeLists.txt +++ b/src/meta/test/balancer_simulator/CMakeLists.txt @@ -29,8 +29,25 @@ set(MY_PROJ_LIBS dsn_runtime dsn_meta_server dsn_ranger + dsn_dist_cmd dsn_replication_common - gtest) + dsn.block_service + dsn.block_service.hdfs + dsn.block_service.local + dsn.failure_detector + dsn.replication.zookeeper_provider + zookeeper + hashtable + dsn_utils + sasl2 + gssapi_krb5 + krb5 + gtest + rocksdb + lz4 + zstd + snappy) + set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES "") dsn_add_test() diff --git a/src/meta/test/cluster_balance_policy_test.cpp b/src/meta/test/cluster_balance_policy_test.cpp index 0ade35a6c9..0c459e4baa 100644 --- a/src/meta/test/cluster_balance_policy_test.cpp +++ b/src/meta/test/cluster_balance_policy_test.cpp @@ -27,7 +27,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "dsn.layer2_types.h" #include "gtest/gtest.h" #include "meta/cluster_balance_policy.h" diff --git a/src/meta/test/copy_replica_operation_test.cpp b/src/meta/test/copy_replica_operation_test.cpp index c2f681fd32..439cf173b3 100644 --- a/src/meta/test/copy_replica_operation_test.cpp +++ b/src/meta/test/copy_replica_operation_test.cpp @@ -24,7 +24,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "dsn.layer2_types.h" #include "gtest/gtest.h" #include "meta/app_balance_policy.h" diff --git a/src/meta/test/ford_fulkerson_test.cpp b/src/meta/test/ford_fulkerson_test.cpp index 00b49d9bee..15e4598d6f 100644 --- a/src/meta/test/ford_fulkerson_test.cpp +++ b/src/meta/test/ford_fulkerson_test.cpp @@ -21,7 +21,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "dsn.layer2_types.h" #include "gtest/gtest.h" #include "meta/load_balance_policy.h" diff --git a/src/meta/test/meta_app_operation_test.cpp b/src/meta/test/meta_app_operation_test.cpp index a6f3cce2c1..db9233ff8b 100644 --- a/src/meta/test/meta_app_operation_test.cpp +++ b/src/meta/test/meta_app_operation_test.cpp @@ -26,7 +26,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/json_helper.h" #include "common/replica_envs.h" #include "common/replication.codes.h" diff --git a/src/meta/test/meta_backup_test.cpp b/src/meta/test/meta_backup_test.cpp index da74bc7bfb..4768237377 100644 --- a/src/meta/test/meta_backup_test.cpp +++ b/src/meta/test/meta_backup_test.cpp @@ -24,7 +24,7 @@ #include "backup_types.h" #include "common/backup_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "gtest/gtest.h" #include "meta/backup_engine.h" diff --git a/src/meta/test/meta_bulk_load_ingestion_test.cpp b/src/meta/test/meta_bulk_load_ingestion_test.cpp index 73bb93ae60..38463af024 100644 --- a/src/meta/test/meta_bulk_load_ingestion_test.cpp +++ b/src/meta/test/meta_bulk_load_ingestion_test.cpp @@ -21,7 +21,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "dsn.layer2_types.h" #include "gtest/gtest.h" #include "meta/meta_bulk_load_ingestion_context.h" diff --git a/src/meta/test/meta_bulk_load_service_test.cpp b/src/meta/test/meta_bulk_load_service_test.cpp index d3ae38a1e8..ebc96e4263 100644 --- a/src/meta/test/meta_bulk_load_service_test.cpp +++ b/src/meta/test/meta_bulk_load_service_test.cpp @@ -31,7 +31,7 @@ #include "bulk_load_types.h" #include "common/bulk_load_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/json_helper.h" #include "common/replica_envs.h" #include "common/replication.codes.h" diff --git a/src/meta/test/meta_data.cpp b/src/meta/test/meta_data.cpp index 16bcf7f1c4..2587922d74 100644 --- a/src/meta/test/meta_data.cpp +++ b/src/meta/test/meta_data.cpp @@ -29,7 +29,7 @@ #include #include "client/partition_resolver.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "dsn.layer2_types.h" #include "gtest/gtest.h" #include "meta/meta_data.h" diff --git a/src/meta/test/meta_duplication_service_test.cpp b/src/meta/test/meta_duplication_service_test.cpp index 2e222d0b7a..689804d443 100644 --- a/src/meta/test/meta_duplication_service_test.cpp +++ b/src/meta/test/meta_duplication_service_test.cpp @@ -40,7 +40,7 @@ #include "common/common.h" #include "common/duplication_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "common/replication_other_types.h" #include "dsn.layer2_types.h" diff --git a/src/meta/test/meta_http_service_test.cpp b/src/meta/test/meta_http_service_test.cpp index cc2497ea8a..39ec24057e 100644 --- a/src/meta/test/meta_http_service_test.cpp +++ b/src/meta/test/meta_http_service_test.cpp @@ -26,7 +26,7 @@ #include "backup_types.h" #include "bulk_load_types.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_other_types.h" #include "gtest/gtest.h" #include "http/http_server.h" diff --git a/src/meta/test/meta_partition_guardian_test.cpp b/src/meta/test/meta_partition_guardian_test.cpp index e4f62f1fb5..1941446b5a 100644 --- a/src/meta/test/meta_partition_guardian_test.cpp +++ b/src/meta/test/meta_partition_guardian_test.cpp @@ -37,7 +37,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "common/replication_other_types.h" #include "dsn.layer2_types.h" diff --git a/src/meta/test/meta_service_test_app.h b/src/meta/test/meta_service_test_app.h index b755755919..9c067defca 100644 --- a/src/meta/test/meta_service_test_app.h +++ b/src/meta/test/meta_service_test_app.h @@ -35,7 +35,7 @@ #include "utils/error_code.h" #include "utils/threadpool_code.h" #include "runtime/task/task_code.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "runtime/rpc/serialization.h" #include "runtime/rpc/rpc_stream.h" #include "runtime/serverlet.h" diff --git a/src/meta/test/meta_split_service_test.cpp b/src/meta/test/meta_split_service_test.cpp index 12cb81e203..dcd9fcfd6a 100644 --- a/src/meta/test/meta_split_service_test.cpp +++ b/src/meta/test/meta_split_service_test.cpp @@ -38,7 +38,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/json_helper.h" #include "common/partition_split_common.h" #include "common/replica_envs.h" diff --git a/src/meta/test/meta_state/CMakeLists.txt b/src/meta/test/meta_state/CMakeLists.txt index dbb7be2ebb..5153d7aba4 100644 --- a/src/meta/test/meta_state/CMakeLists.txt +++ b/src/meta/test/meta_state/CMakeLists.txt @@ -31,8 +31,20 @@ set(MY_PROJ_LIBS dsn_replica_server dsn_replication_common dsn_runtime + dsn_aio + sasl2 + gssapi_krb5 + krb5 + dsn_utils + gtest + zookeeper hashtable - gtest) + dsn.replication.zookeeper_provider + rocksdb + lz4 + snappy + zstd) + set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES run.sh diff --git a/src/meta/test/misc/misc.cpp b/src/meta/test/misc/misc.cpp index 25c16d6757..b83378901c 100644 --- a/src/meta/test/misc/misc.cpp +++ b/src/meta/test/misc/misc.cpp @@ -40,7 +40,7 @@ #include #include "common/fs_manager.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_enums.h" #include "common/replication_other_types.h" #include "dsn.layer2_types.h" diff --git a/src/meta/test/state_sync_test.cpp b/src/meta/test/state_sync_test.cpp index ccd83ee744..e64ec2fe97 100644 --- a/src/meta/test/state_sync_test.cpp +++ b/src/meta/test/state_sync_test.cpp @@ -35,7 +35,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "dsn.layer2_types.h" #include "gtest/gtest.h" diff --git a/src/meta/test/update_configuration_test.cpp b/src/meta/test/update_configuration_test.cpp index 2c23d231c2..5a51ea38ce 100644 --- a/src/meta/test/update_configuration_test.cpp +++ b/src/meta/test/update_configuration_test.cpp @@ -37,7 +37,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "common/replication_other_types.h" #include "dsn.layer2_types.h" diff --git a/src/nfs/nfs_node.h b/src/nfs/nfs_node.h index 635562c669..5d0eff0351 100644 --- a/src/nfs/nfs_node.h +++ b/src/nfs/nfs_node.h @@ -31,7 +31,7 @@ #include #include "aio/aio_task.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "runtime/api_task.h" #include "runtime/rpc/rpc_address.h" #include "runtime/task/task_code.h" diff --git a/src/nfs/test/CMakeLists.txt b/src/nfs/test/CMakeLists.txt index 4a22ce4867..a1e73bf622 100644 --- a/src/nfs/test/CMakeLists.txt +++ b/src/nfs/test/CMakeLists.txt @@ -35,15 +35,19 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_nfs + dsn_http dsn_runtime - gtest dsn_aio - dsn_http + dsn_utils + sasl2 + gssapi_krb5 + krb5 + test_utils + gtest rocksdb lz4 zstd - snappy - test_utils) + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/nfs/test/main.cpp b/src/nfs/test/main.cpp index 49ededed03..cc28f4d48d 100644 --- a/src/nfs/test/main.cpp +++ b/src/nfs/test/main.cpp @@ -34,7 +34,7 @@ #include #include "aio/aio_task.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "gtest/gtest.h" #include "nfs/nfs_node.h" #include "runtime/app_model.h" diff --git a/src/perf_counter/test/CMakeLists.txt b/src/perf_counter/test/CMakeLists.txt index 1b1a8d2292..9f18bb2baf 100644 --- a/src/perf_counter/test/CMakeLists.txt +++ b/src/perf_counter/test/CMakeLists.txt @@ -30,6 +30,11 @@ set(MY_PROJ_LIBS dsn_meta_server dsn_ranger dsn_replication_common + dsn_aio + dsn_utils + sasl2 + gssapi_krb5 + krb5 rocksdb lz4 zstd diff --git a/src/redis_protocol/proxy/CMakeLists.txt b/src/redis_protocol/proxy/CMakeLists.txt index b741360568..31c80847cd 100644 --- a/src/redis_protocol/proxy/CMakeLists.txt +++ b/src/redis_protocol/proxy/CMakeLists.txt @@ -26,14 +26,21 @@ set(MY_PROJ_SRC "") # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS pegasus.rproxylib - absl::flat_hash_set - absl::strings - pegasus_geo_lib - event - s2 - pegasus_client_static - ) +set(MY_PROJ_LIBS + pegasus.rproxylib + dsn_utils + absl::flat_hash_set + absl::strings + pegasus_geo_lib + event + s2 + pegasus_client_static + dsn_client + test_utils + rocksdb + lz4 + zstd + snappy) set(MY_BINPLACES "config.ini") diff --git a/src/redis_protocol/proxy_ut/CMakeLists.txt b/src/redis_protocol/proxy_ut/CMakeLists.txt index cf7bb1df37..9dcecd6473 100644 --- a/src/redis_protocol/proxy_ut/CMakeLists.txt +++ b/src/redis_protocol/proxy_ut/CMakeLists.txt @@ -29,15 +29,26 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_BOOST_LIBS Boost::system Boost::filesystem) -set(MY_PROJ_LIBS pegasus.rproxylib - pegasus_base - absl::flat_hash_set - absl::strings - pegasus_geo_lib - s2 - pegasus_client_static - gtest - ) +set(MY_PROJ_LIBS + pegasus.rproxylib + absl::flat_hash_set + absl::strings + pegasus_geo_lib + event + s2 + pegasus_client_static + dsn_client + dsn_runtime + dsn_aio + dsn_utils + sasl2 + gssapi_krb5 + krb5 + gtest + rocksdb + lz4 + zstd + snappy) set(MY_BINPLACES "config.ini" "run.sh") diff --git a/src/replica/CMakeLists.txt b/src/replica/CMakeLists.txt index 5bcd3f57bc..e0a263f67f 100644 --- a/src/replica/CMakeLists.txt +++ b/src/replica/CMakeLists.txt @@ -67,19 +67,23 @@ set(MY_PROJ_LIBS dsn_dist_cmd dsn_http dsn_runtime + sasl2 + gssapi_krb5 + krb5 dsn_aio dsn_meta_server rocksdb lz4 zstd - snappy) + snappy + zookeeper) set(MY_BOOST_LIBS Boost::filesystem) # Extra files that will be installed set(MY_BINPLACES "") -dsn_add_shared_library() +dsn_add_static_library() add_subdirectory(duplication/test) add_subdirectory(backup/test) diff --git a/src/replica/backup/cold_backup_context.h b/src/replica/backup/cold_backup_context.h index 0d2f07ffc7..acc69be068 100644 --- a/src/replica/backup/cold_backup_context.h +++ b/src/replica/backup/cold_backup_context.h @@ -30,7 +30,7 @@ #include "backup_types.h" #include "block_service/block_service.h" #include "common/backup_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/json_helper.h" #include "common/replication_other_types.h" #include "metadata_types.h" diff --git a/src/replica/backup/replica_backup_manager.cpp b/src/replica/backup/replica_backup_manager.cpp index 390860883a..5e1d7bf917 100644 --- a/src/replica/backup/replica_backup_manager.cpp +++ b/src/replica/backup/replica_backup_manager.cpp @@ -28,7 +28,7 @@ #include "backup_types.h" #include "cold_backup_context.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "dsn.layer2_types.h" #include "metadata_types.h" diff --git a/src/replica/backup/replica_backup_server.cpp b/src/replica/backup/replica_backup_server.cpp index 23de8972b3..564241b9d2 100644 --- a/src/replica/backup/replica_backup_server.cpp +++ b/src/replica/backup/replica_backup_server.cpp @@ -20,7 +20,7 @@ #include #include "backup_types.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "replica/replica.h" #include "replica/replica_stub.h" diff --git a/src/replica/backup/test/CMakeLists.txt b/src/replica/backup/test/CMakeLists.txt index bacb77adad..e712120f4c 100644 --- a/src/replica/backup/test/CMakeLists.txt +++ b/src/replica/backup/test/CMakeLists.txt @@ -22,11 +22,23 @@ set(MY_PROJ_LIBS dsn_meta_server dsn_ranger dsn_replica_server + dsn_nfs + dsn_dist_cmd + dsn_runtime + sasl2 + gssapi_krb5 + krb5 + dsn_meta_server dsn_replication_common + dsn.replication.zookeeper_provider + zookeeper + hashtable dsn.block_service + dsn.block_service.hdfs dsn.block_service.local + dsn.failure_detector + dsn_aio dsn_utils - hashtable gtest rocksdb lz4 diff --git a/src/replica/bulk_load/replica_bulk_loader.cpp b/src/replica/bulk_load/replica_bulk_loader.cpp index 6672fdceb3..835bb9340f 100644 --- a/src/replica/bulk_load/replica_bulk_loader.cpp +++ b/src/replica/bulk_load/replica_bulk_loader.cpp @@ -26,7 +26,7 @@ #include "block_service/block_service_manager.h" #include "common/bulk_load_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/json_helper.h" #include "common/replication.codes.h" #include "common/replication_common.h" diff --git a/src/replica/bulk_load/test/CMakeLists.txt b/src/replica/bulk_load/test/CMakeLists.txt index 08abb8f9a7..60ec9b9c11 100644 --- a/src/replica/bulk_load/test/CMakeLists.txt +++ b/src/replica/bulk_load/test/CMakeLists.txt @@ -24,7 +24,21 @@ set(MY_PROJ_LIBS dsn_replica_server dsn_replication_common dsn_runtime + sasl2 + gssapi_krb5 + krb5 + dsn.security + dsn_nfs + dsn_aio + dsn_dist_cmd + dsn.block_service + dsn.block_service.hdfs + dsn.block_service.local + dsn.failure_detector + dsn.replication.zookeeper_provider + zookeeper hashtable + dsn_utils gtest test_utils rocksdb diff --git a/src/replica/bulk_load/test/replica_bulk_loader_test.cpp b/src/replica/bulk_load/test/replica_bulk_loader_test.cpp index 59a00cd28b..b3250459e2 100644 --- a/src/replica/bulk_load/test/replica_bulk_loader_test.cpp +++ b/src/replica/bulk_load/test/replica_bulk_loader_test.cpp @@ -26,7 +26,7 @@ #include #include "common/bulk_load_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/json_helper.h" #include "dsn.layer2_types.h" #include "gtest/gtest.h" diff --git a/src/replica/duplication/duplication_pipeline.cpp b/src/replica/duplication/duplication_pipeline.cpp index 8ce736f517..c32e731408 100644 --- a/src/replica/duplication/duplication_pipeline.cpp +++ b/src/replica/duplication/duplication_pipeline.cpp @@ -42,14 +42,6 @@ namespace dsn { namespace replication { -// // -// mutation_duplicator // -// // - -/*static*/ std::function( - replica_base *, absl::string_view /*remote cluster*/, absl::string_view /*app*/)> - mutation_duplicator::creator; - // // // load_mutation // // // @@ -121,8 +113,8 @@ ship_mutation::ship_mutation(replica_duplicator *duplicator) _stub(duplicator->_replica->get_replica_stub()), METRIC_VAR_INIT_replica(dup_shipped_bytes) { - _mutation_duplicator = new_mutation_duplicator( - duplicator, _duplicator->remote_cluster_name(), _replica->get_app_info()->app_name); + // _mutation_duplicator = new_mutation_duplicator( + // duplicator, _duplicator->remote_cluster_name(), _replica->get_app_info()->app_name); _mutation_duplicator->set_task_environment(duplicator); } diff --git a/src/replica/duplication/duplication_sync_timer.h b/src/replica/duplication/duplication_sync_timer.h index ff1b6c0660..279e3fc608 100644 --- a/src/replica/duplication/duplication_sync_timer.h +++ b/src/replica/duplication/duplication_sync_timer.h @@ -21,7 +21,7 @@ #include #include "common//duplication_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_other_types.h" #include "duplication_types.h" #include "replica/replica.h" diff --git a/src/replica/duplication/mutation_duplicator.h b/src/replica/duplication/mutation_duplicator.h index b1c29e00fa..e9c0fd6180 100644 --- a/src/replica/duplication/mutation_duplicator.h +++ b/src/replica/duplication/mutation_duplicator.h @@ -66,11 +66,6 @@ class mutation_duplicator : public replica_base /// \param cb: Call it when all the given mutations were sent successfully virtual void duplicate(mutation_tuple_set mutations, callback cb) = 0; - // Singleton creator of mutation_duplicator. - static std::function( - replica_base *, absl::string_view /*remote cluster*/, absl::string_view /*app name*/)> - creator; - explicit mutation_duplicator(replica_base *r) : replica_base(r) {} virtual ~mutation_duplicator() = default; @@ -83,11 +78,11 @@ class mutation_duplicator : public replica_base pipeline::environment _env; }; -inline std::unique_ptr new_mutation_duplicator( - replica_base *r, absl::string_view remote_cluster_address, absl::string_view app) -{ - return mutation_duplicator::creator(r, remote_cluster_address, app); -} +// inline std::unique_ptr new_mutation_duplicator( +// replica_base *r, absl::string_view remote_cluster_address, absl::string_view app) +//{ +// return mutation_duplicator::create(r, remote_cluster_address, app); +//} } // namespace replication } // namespace dsn diff --git a/src/replica/duplication/replica_duplicator.cpp b/src/replica/duplication/replica_duplicator.cpp index 01c01b4059..f7b1f92c12 100644 --- a/src/replica/duplication/replica_duplicator.cpp +++ b/src/replica/duplication/replica_duplicator.cpp @@ -28,7 +28,7 @@ #include #include "common/duplication_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "dsn.layer2_types.h" #include "duplication_pipeline.h" diff --git a/src/replica/duplication/replica_duplicator_manager.cpp b/src/replica/duplication/replica_duplicator_manager.cpp index 03ca071121..25c083568e 100644 --- a/src/replica/duplication/replica_duplicator_manager.cpp +++ b/src/replica/duplication/replica_duplicator_manager.cpp @@ -21,7 +21,7 @@ #include #include "common//duplication_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "replica/duplication/replica_duplicator.h" #include "replica_duplicator_manager.h" #include "utils/autoref_ptr.h" diff --git a/src/replica/duplication/replica_follower.h b/src/replica/duplication/replica_follower.h index 8a8842fccf..03bd568ffd 100644 --- a/src/replica/duplication/replica_follower.h +++ b/src/replica/duplication/replica_follower.h @@ -23,7 +23,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "dsn.layer2_types.h" #include "replica/replica_base.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/replica/duplication/test/CMakeLists.txt b/src/replica/duplication/test/CMakeLists.txt index 57915bbe0e..5156ee8b7f 100644 --- a/src/replica/duplication/test/CMakeLists.txt +++ b/src/replica/duplication/test/CMakeLists.txt @@ -22,14 +22,26 @@ set(MY_PROJ_LIBS dsn_meta_server dsn_ranger dsn_replica_server + dsn.block_service + dsn.block_service.hdfs + dsn.block_service.local + dsn_nfs + dsn_dist_cmd + dsn_aio + dsn_http + dsn_runtime + sasl2 + gssapi_krb5 + krb5 dsn.replication.zookeeper_provider + zookeeper + hashtable dsn_replication_common + dsn.rpc dsn.failure_detector dsn_utils - zookeeper - hashtable - gtest test_utils + gtest rocksdb lz4 zstd diff --git a/src/replica/duplication/test/dup_replica_http_service_test.cpp b/src/replica/duplication/test/dup_replica_http_service_test.cpp index 70b123e328..da895d080a 100644 --- a/src/replica/duplication/test/dup_replica_http_service_test.cpp +++ b/src/replica/duplication/test/dup_replica_http_service_test.cpp @@ -21,7 +21,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "duplication_test_base.h" #include "duplication_types.h" #include "gtest/gtest.h" diff --git a/src/replica/duplication/test/duplication_test_base.h b/src/replica/duplication/test/duplication_test_base.h index eb914f38e0..a0adfbadb3 100644 --- a/src/replica/duplication/test/duplication_test_base.h +++ b/src/replica/duplication/test/duplication_test_base.h @@ -34,9 +34,10 @@ class duplication_test_base : public replica_test_base public: duplication_test_base() { - mutation_duplicator::creator = [](replica_base *r, absl::string_view, absl::string_view) { - return std::make_unique(r); - }; + // mutation_duplicator::creator = [](replica_base *r, absl::string_view, + // absl::string_view) { + // return std::make_unique(r); + // }; stub->_duplication_sync_timer = std::make_unique(stub.get()); } diff --git a/src/replica/duplication/test/load_from_private_log_test.cpp b/src/replica/duplication/test/load_from_private_log_test.cpp index 86237cc0fb..eb6a6d75e9 100644 --- a/src/replica/duplication/test/load_from_private_log_test.cpp +++ b/src/replica/duplication/test/load_from_private_log_test.cpp @@ -23,7 +23,7 @@ #include "aio/aio_task.h" #include "aio/file_io.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "common/replication_other_types.h" #include "consensus_types.h" diff --git a/src/replica/duplication/test/replica_duplicator_manager_test.cpp b/src/replica/duplication/test/replica_duplicator_manager_test.cpp index 31dbacc67c..861c3bf568 100644 --- a/src/replica/duplication/test/replica_duplicator_manager_test.cpp +++ b/src/replica/duplication/test/replica_duplicator_manager_test.cpp @@ -23,7 +23,7 @@ #include #include "common/duplication_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_other_types.h" #include "duplication_test_base.h" #include "duplication_types.h" diff --git a/src/replica/duplication/test/replica_duplicator_test.cpp b/src/replica/duplication/test/replica_duplicator_test.cpp index 3c3847a62d..98d5323b33 100644 --- a/src/replica/duplication/test/replica_duplicator_test.cpp +++ b/src/replica/duplication/test/replica_duplicator_test.cpp @@ -21,7 +21,7 @@ #include #include "common/duplication_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_other_types.h" #include "duplication_test_base.h" #include "duplication_types.h" diff --git a/src/replica/duplication/test/replica_follower_test.cpp b/src/replica/duplication/test/replica_follower_test.cpp index eb4b1e4aa4..516effe529 100644 --- a/src/replica/duplication/test/replica_follower_test.cpp +++ b/src/replica/duplication/test/replica_follower_test.cpp @@ -22,7 +22,7 @@ #include #include "common/duplication_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "consensus_types.h" #include "dsn.layer2_types.h" #include "duplication_test_base.h" diff --git a/src/replica/log_file.h b/src/replica/log_file.h index fcaff2187a..14402dae56 100644 --- a/src/replica/log_file.h +++ b/src/replica/log_file.h @@ -34,7 +34,7 @@ #include #include "aio/aio_task.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_other_types.h" #include "runtime/api_task.h" #include "runtime/task/task_code.h" diff --git a/src/replica/mutation.cpp b/src/replica/mutation.cpp index 7814bf299a..5d13e4d4b3 100644 --- a/src/replica/mutation.cpp +++ b/src/replica/mutation.cpp @@ -32,7 +32,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "replica.h" #include "runtime/api_task.h" diff --git a/src/replica/mutation_log.h b/src/replica/mutation_log.h index c4ce671ecb..6a172fd09a 100644 --- a/src/replica/mutation_log.h +++ b/src/replica/mutation_log.h @@ -37,7 +37,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_other_types.h" #include "log_file.h" #include "mutation.h" diff --git a/src/replica/replica.cpp b/src/replica/replica.cpp index 62cd71ae94..499e8803c1 100644 --- a/src/replica/replica.cpp +++ b/src/replica/replica.cpp @@ -36,7 +36,7 @@ #include "bulk_load/replica_bulk_loader.h" #include "common/backup_common.h" #include "common/fs_manager.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replica_envs.h" #include "common/replication_enums.h" #include "consensus_types.h" diff --git a/src/replica/replica_2pc.cpp b/src/replica/replica_2pc.cpp index 084bba023e..d4e48f8662 100644 --- a/src/replica/replica_2pc.cpp +++ b/src/replica/replica_2pc.cpp @@ -39,7 +39,7 @@ #include "bulk_load/replica_bulk_loader.h" #include "bulk_load_types.h" #include "common/fs_manager.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "common/replication_common.h" #include "common/replication_enums.h" diff --git a/src/replica/replica_backup.cpp b/src/replica/replica_backup.cpp index f51c20ade3..d65b76850a 100644 --- a/src/replica/replica_backup.cpp +++ b/src/replica/replica_backup.cpp @@ -36,7 +36,7 @@ #include "backup/replica_backup_manager.h" #include "backup_types.h" #include "block_service/block_service_manager.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "common/replication_enums.h" #include "common/replication_other_types.h" diff --git a/src/replica/replica_base.h b/src/replica/replica_base.h index 8909197a64..0f8c57bdec 100644 --- a/src/replica/replica_base.h +++ b/src/replica/replica_base.h @@ -28,7 +28,7 @@ #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "absl/strings/string_view.h" #include "utils/fmt_logging.h" #include "utils/metrics.h" diff --git a/src/replica/replica_check.cpp b/src/replica/replica_check.cpp index f5a4f5f58d..5d78ad9d9a 100644 --- a/src/replica/replica_check.cpp +++ b/src/replica/replica_check.cpp @@ -31,7 +31,7 @@ #include #include "common/fs_manager.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "common/replication_common.h" #include "common/replication_enums.h" diff --git a/src/replica/replica_chkpt.cpp b/src/replica/replica_chkpt.cpp index d255573dd9..a9ad6881ac 100644 --- a/src/replica/replica_chkpt.cpp +++ b/src/replica/replica_chkpt.cpp @@ -33,7 +33,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "common/replication_enums.h" #include "common/replication_other_types.h" diff --git a/src/replica/replica_config.cpp b/src/replica/replica_config.cpp index de14a2d123..8fa4b4c04e 100644 --- a/src/replica/replica_config.cpp +++ b/src/replica/replica_config.cpp @@ -40,7 +40,7 @@ #include #include "bulk_load/replica_bulk_loader.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replica_envs.h" #include "common/replication.codes.h" #include "common/replication_common.h" diff --git a/src/replica/replica_context.h b/src/replica/replica_context.h index 32da41d38b..5e570d4f62 100644 --- a/src/replica/replica_context.h +++ b/src/replica/replica_context.h @@ -33,7 +33,7 @@ #include #include "bulk_load_types.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_common.h" #include "common/replication_other_types.h" #include "consensus_types.h" diff --git a/src/replica/replica_disk_migrator.cpp b/src/replica/replica_disk_migrator.cpp index 355421503a..13caddeefa 100644 --- a/src/replica/replica_disk_migrator.cpp +++ b/src/replica/replica_disk_migrator.cpp @@ -22,7 +22,7 @@ #include "absl/strings/string_view.h" #include "common/fs_manager.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "common/replication_enums.h" #include "metadata_types.h" diff --git a/src/replica/replica_http_service.cpp b/src/replica/replica_http_service.cpp index 79bf9c6d67..c14a63cfa9 100644 --- a/src/replica/replica_http_service.cpp +++ b/src/replica/replica_http_service.cpp @@ -27,7 +27,7 @@ #include #include "common/duplication_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "duplication/duplication_sync_timer.h" #include "http/http_server.h" #include "replica/replica_stub.h" diff --git a/src/replica/replica_init.cpp b/src/replica/replica_init.cpp index 0948a3685c..45a798220d 100644 --- a/src/replica/replica_init.cpp +++ b/src/replica/replica_init.cpp @@ -31,7 +31,7 @@ #include #include "backup/replica_backup_manager.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "common/replication_other_types.h" #include "consensus_types.h" diff --git a/src/replica/replica_learn.cpp b/src/replica/replica_learn.cpp index c69076ac99..2722b79875 100644 --- a/src/replica/replica_learn.cpp +++ b/src/replica/replica_learn.cpp @@ -40,7 +40,7 @@ #include // IWYU pragma: keep #include "common/fs_manager.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "common/replication_enums.h" #include "common/replication_other_types.h" diff --git a/src/replica/replica_restore.cpp b/src/replica/replica_restore.cpp index 9c255df0b4..dda0b2588e 100644 --- a/src/replica/replica_restore.cpp +++ b/src/replica/replica_restore.cpp @@ -33,7 +33,7 @@ #include "block_service/block_service.h" #include "block_service/block_service_manager.h" #include "common/backup_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/json_helper.h" #include "common/replication.codes.h" #include "dsn.layer2_types.h" diff --git a/src/replica/replica_stub.h b/src/replica/replica_stub.h index de158f992b..7bf5a812cc 100644 --- a/src/replica/replica_stub.h +++ b/src/replica/replica_stub.h @@ -42,7 +42,7 @@ #include "bulk_load_types.h" #include "common/bulk_load_common.h" #include "common/fs_manager.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_common.h" #include "common/replication_other_types.h" #include "consensus_types.h" diff --git a/src/replica/replica_throttle.cpp b/src/replica/replica_throttle.cpp index ed6bd1ccee..26ebf567ef 100644 --- a/src/replica/replica_throttle.cpp +++ b/src/replica/replica_throttle.cpp @@ -21,7 +21,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replica_envs.h" #include "common/replication.codes.h" #include "dsn.layer2_types.h" diff --git a/src/replica/replication_service_app.cpp b/src/replica/replication_service_app.cpp index 7200a6404c..8ca967f591 100644 --- a/src/replica/replication_service_app.cpp +++ b/src/replica/replication_service_app.cpp @@ -26,7 +26,7 @@ #include "replica/replication_service_app.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_common.h" #include "http/http_server.h" #include "http/service_version.h" diff --git a/src/replica/split/replica_split_manager.h b/src/replica/split/replica_split_manager.h index 7435e1705d..a4db4df24a 100644 --- a/src/replica/split/replica_split_manager.h +++ b/src/replica/split/replica_split_manager.h @@ -24,7 +24,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_other_types.h" #include "metadata_types.h" #include "replica/mutation.h" diff --git a/src/replica/split/test/CMakeLists.txt b/src/replica/split/test/CMakeLists.txt index 6bacdf05c5..966f83ece1 100644 --- a/src/replica/split/test/CMakeLists.txt +++ b/src/replica/split/test/CMakeLists.txt @@ -24,8 +24,28 @@ set(MY_PROJ_LIBS dsn_replica_server dsn_replication_common dsn_runtime + sasl2 + gssapi_krb5 + krb5 + dsn.security + dsn_nfs + dsn_aio + dsn_dist_cmd + dsn.block_service + dsn.block_service.hdfs + dsn.block_service.local + dsn.failure_detector + dsn.replication.zookeeper_provider + zookeeper hashtable - gtest) + dsn_utils + gtest + test_utils + rocksdb + lz4 + zstd + snappy) + set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES config-test.ini diff --git a/src/replica/split/test/replica_split_test.cpp b/src/replica/split/test/replica_split_test.cpp index 53315405b3..a9eb123452 100644 --- a/src/replica/split/test/replica_split_test.cpp +++ b/src/replica/split/test/replica_split_test.cpp @@ -23,7 +23,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "common/replication_common.h" #include "common/replication_other_types.h" diff --git a/src/replica/storage/simple_kv/CMakeLists.txt b/src/replica/storage/simple_kv/CMakeLists.txt index f8595297e2..c04ca43e39 100644 --- a/src/replica/storage/simple_kv/CMakeLists.txt +++ b/src/replica/storage/simple_kv/CMakeLists.txt @@ -35,8 +35,27 @@ set(MY_PROJ_LIBS dsn_meta_server dsn_ranger dsn_client + dsn_nfs + dsn_dist_cmd dsn_runtime + sasl2 + gssapi_krb5 + krb5 + dsn.block_service + dsn.block_service.hdfs + dsn.block_service.local + dsn_replication_common + dsn.failure_detector + dsn.replication.zookeeper_provider + zookeeper hashtable + dsn_http + dsn_runtime + dsn_aio + dsn_utils + sasl2 + gssapi_krb5 + krb5 rocksdb lz4 zstd diff --git a/src/replica/storage/simple_kv/test/CMakeLists.txt b/src/replica/storage/simple_kv/test/CMakeLists.txt index 1aa7dbaa15..2c8a5db183 100644 --- a/src/replica/storage/simple_kv/test/CMakeLists.txt +++ b/src/replica/storage/simple_kv/test/CMakeLists.txt @@ -25,18 +25,32 @@ set(MY_PROJ_NAME dsn.rep_tests.simple_kv) set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS + dsn_replica_server + dsn_nfs + dsn_dist_cmd + dsn_runtime + sasl2 + gssapi_krb5 + krb5 + dsn.block_service + dsn.block_service.hdfs + dsn.block_service.local dsn_meta_server dsn_ranger - dsn_replica_server dsn_replication_common dsn_client dsn.failure_detector dsn.replication.zookeeper_provider - dsn_runtime zookeeper hashtable - gtest + dsn_http + dsn_runtime + dsn_aio dsn_utils + sasl2 + gssapi_krb5 + krb5 + gtest rocksdb lz4 zstd diff --git a/src/replica/storage/simple_kv/test/client.cpp b/src/replica/storage/simple_kv/test/client.cpp index f93dffe1b0..88667f6afd 100644 --- a/src/replica/storage/simple_kv/test/client.cpp +++ b/src/replica/storage/simple_kv/test/client.cpp @@ -32,7 +32,7 @@ #include #include "case.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "common/replication_other_types.h" #include "replica/storage/simple_kv/simple_kv.client.h" diff --git a/src/replica/storage/simple_kv/test/common.h b/src/replica/storage/simple_kv/test/common.h index f042d2b213..b7afa2acff 100644 --- a/src/replica/storage/simple_kv/test/common.h +++ b/src/replica/storage/simple_kv/test/common.h @@ -34,7 +34,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_other_types.h" #include "metadata_types.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/replica/test/CMakeLists.txt b/src/replica/test/CMakeLists.txt index ef30c7d031..ddb891c3a6 100644 --- a/src/replica/test/CMakeLists.txt +++ b/src/replica/test/CMakeLists.txt @@ -29,16 +29,24 @@ set(MY_PROJ_LIBS dsn_meta_server dsn_ranger dsn_replica_server - dsn.replication.zookeeper_provider + dsn_http + dsn_runtime + sasl2 + gssapi_krb5 + krb5 + dsn.security + dsn_nfs + dsn_aio + dsn_dist_cmd dsn_replication_common dsn.block_service - dsn.block_service.local dsn.block_service.hdfs + dsn.block_service.local dsn.failure_detector - dsn_http - dsn_runtime + dsn.replication.zookeeper_provider zookeeper hashtable + dsn_utils gtest test_utils rocksdb diff --git a/src/replica/test/backup_block_service_mock.h b/src/replica/test/backup_block_service_mock.h index 4ac8bc95fe..632301ab8f 100644 --- a/src/replica/test/backup_block_service_mock.h +++ b/src/replica/test/backup_block_service_mock.h @@ -22,7 +22,7 @@ #include "utils/error_code.h" #include "utils/threadpool_code.h" #include "runtime/task/task_code.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "runtime/task/task_tracker.h" #include "block_service/block_service.h" #include "replica/replica_context.h" diff --git a/src/replica/test/cold_backup_context_test.cpp b/src/replica/test/cold_backup_context_test.cpp index 529ac0a09c..91da0b10d4 100644 --- a/src/replica/test/cold_backup_context_test.cpp +++ b/src/replica/test/cold_backup_context_test.cpp @@ -30,7 +30,7 @@ #include "block_service/block_service.h" #include "block_service/test/block_service_mock.h" #include "common/backup_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/json_helper.h" #include "gtest/gtest.h" #include "metadata_types.h" diff --git a/src/replica/test/mock_utils.h b/src/replica/test/mock_utils.h index bf2e894002..00a48a0be0 100644 --- a/src/replica/test/mock_utils.h +++ b/src/replica/test/mock_utils.h @@ -433,8 +433,9 @@ class mock_mutation_log_private : public mutation_log_private }; typedef dsn::ref_ptr mock_mutation_log_private_ptr; -struct mock_mutation_duplicator : public mutation_duplicator +class mock_mutation_duplicator : public mutation_duplicator { +public: explicit mock_mutation_duplicator(replica_base *r) : mutation_duplicator(r) {} void duplicate(mutation_tuple_set mut, callback cb) override { _func(mut, cb); } diff --git a/src/replica/test/mutation_log_learn_test.cpp b/src/replica/test/mutation_log_learn_test.cpp index f5946b53e9..11950b9b4d 100644 --- a/src/replica/test/mutation_log_learn_test.cpp +++ b/src/replica/test/mutation_log_learn_test.cpp @@ -32,7 +32,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "common/replication_other_types.h" #include "consensus_types.h" diff --git a/src/replica/test/open_replica_test.cpp b/src/replica/test/open_replica_test.cpp index 790e4e1dfa..8dd48164c6 100644 --- a/src/replica/test/open_replica_test.cpp +++ b/src/replica/test/open_replica_test.cpp @@ -20,7 +20,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_other_types.h" #include "dsn.layer2_types.h" #include "gtest/gtest.h" diff --git a/src/replica/test/replica_disk_migrate_test.cpp b/src/replica/test/replica_disk_migrate_test.cpp index f730b2fd1e..5043f527f1 100644 --- a/src/replica/test/replica_disk_migrate_test.cpp +++ b/src/replica/test/replica_disk_migrate_test.cpp @@ -26,7 +26,7 @@ #include #include "common/fs_manager.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "common/replication_other_types.h" #include "dsn.layer2_types.h" diff --git a/src/replica/test/replica_disk_test.cpp b/src/replica/test/replica_disk_test.cpp index 5866da6ab7..09715be52a 100644 --- a/src/replica/test/replica_disk_test.cpp +++ b/src/replica/test/replica_disk_test.cpp @@ -29,7 +29,7 @@ #include #include "common/fs_manager.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "dsn.layer2_types.h" #include "gtest/gtest.h" diff --git a/src/replica/test/replica_learn_test.cpp b/src/replica/test/replica_learn_test.cpp index b926fa4a82..a699402cc8 100644 --- a/src/replica/test/replica_learn_test.cpp +++ b/src/replica/test/replica_learn_test.cpp @@ -20,7 +20,7 @@ #include #include "common/fs_manager.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_other_types.h" #include "consensus_types.h" #include "dsn.layer2_types.h" diff --git a/src/replica/test/replica_test.cpp b/src/replica/test/replica_test.cpp index 46747a3206..9480e429a7 100644 --- a/src/replica/test/replica_test.cpp +++ b/src/replica/test/replica_test.cpp @@ -30,7 +30,7 @@ #include "backup_types.h" #include "common/backup_common.h" #include "common/fs_manager.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replica_envs.h" #include "common/replication.codes.h" #include "common/replication_enums.h" diff --git a/src/runtime/CMakeLists.txt b/src/runtime/CMakeLists.txt index ac98bfc5d7..1afd47aaa3 100644 --- a/src/runtime/CMakeLists.txt +++ b/src/runtime/CMakeLists.txt @@ -22,13 +22,11 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -add_subdirectory(test) -add_subdirectory(rpc) -add_subdirectory(task) -add_subdirectory(security) +set(MY_PROJ_NAME dsn_runtime) # TODO(zlw) remove perf_counter from dsn_runtime after the refactor by WuTao -add_library(dsn_runtime STATIC +set(MY_PROJ_SRC + $ $ $ $ @@ -50,6 +48,18 @@ add_library(dsn_runtime STATIC tool_api.cpp tracer.cpp zlocks.cpp) -target_link_libraries(dsn_runtime PRIVATE dsn_utils sasl2 gssapi_krb5 krb5) -define_file_basename_for_sources(dsn_runtime) -install(TARGETS dsn_runtime DESTINATION "lib") + +set(MY_PROJ_LIBS + dsn_meta_server + dsn_utils + sasl2 + gssapi_krb5 + krb5) + +dsn_add_static_library() + +add_subdirectory(rpc) +add_subdirectory(task) +add_subdirectory(security) +add_subdirectory(ranger) +add_subdirectory(test) diff --git a/src/runtime/api_layer1.h b/src/runtime/api_layer1.h index dc5e317032..64a281ce23 100644 --- a/src/runtime/api_layer1.h +++ b/src/runtime/api_layer1.h @@ -31,7 +31,7 @@ #pragma once #include "runtime/api_task.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "runtime/rpc/rpc_address.h" #include "runtime/task/task_tracker.h" diff --git a/src/runtime/rpc/CMakeLists.txt b/src/runtime/rpc/CMakeLists.txt index 08de0852f6..a740e995d7 100644 --- a/src/runtime/rpc/CMakeLists.txt +++ b/src/runtime/rpc/CMakeLists.txt @@ -24,6 +24,7 @@ set(MY_PROJ_NAME dsn.rpc) +set(MY_PROJ_SRC "") # Search mode for source files under CURRENT project directory? # "GLOB_RECURSE" for recursive search # "GLOB" for non-recursive search diff --git a/src/runtime/rpc/raw_message_parser.cpp b/src/runtime/rpc/raw_message_parser.cpp index 53cde8de6c..1ed6885393 100644 --- a/src/runtime/rpc/raw_message_parser.cpp +++ b/src/runtime/rpc/raw_message_parser.cpp @@ -30,7 +30,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "network.h" #include "runtime/rpc/rpc_address.h" #include "runtime/rpc/rpc_message.h" diff --git a/src/runtime/rpc/rpc_engine.cpp b/src/runtime/rpc/rpc_engine.cpp index 97394d7f32..13fd20a42a 100644 --- a/src/runtime/rpc/rpc_engine.cpp +++ b/src/runtime/rpc/rpc_engine.cpp @@ -32,7 +32,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "runtime/api_layer1.h" #include "runtime/global_config.h" #include "runtime/rpc/group_address.h" diff --git a/src/runtime/rpc/rpc_message.h b/src/runtime/rpc/rpc_message.h index d07cb0c5b6..809f419633 100644 --- a/src/runtime/rpc/rpc_message.h +++ b/src/runtime/rpc/rpc_message.h @@ -31,7 +31,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "rpc_address.h" #include "runtime/task/task_code.h" #include "runtime/task/task_spec.h" diff --git a/src/runtime/rpc/rpc_stream.h b/src/runtime/rpc/rpc_stream.h index 62dfc82284..cc108b258a 100644 --- a/src/runtime/rpc/rpc_stream.h +++ b/src/runtime/rpc/rpc_stream.h @@ -26,7 +26,7 @@ #pragma once -#include "common/gpid.h" +#include "utils/gpid.h" #include "runtime/api_layer1.h" #include "runtime/api_task.h" #include "runtime/app_model.h" diff --git a/src/runtime/rpc/thrift_message_parser.cpp b/src/runtime/rpc/thrift_message_parser.cpp index 08bbfcb872..5f73786c24 100644 --- a/src/runtime/rpc/thrift_message_parser.cpp +++ b/src/runtime/rpc/thrift_message_parser.cpp @@ -32,7 +32,7 @@ #include #include "boost/smart_ptr/shared_ptr.hpp" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/serialization_helper/thrift_helper.h" #include "runtime/rpc/rpc_message.h" #include "runtime/rpc/rpc_stream.h" diff --git a/src/runtime/service_app.h b/src/runtime/service_app.h index 0e6e2cfc86..dadbed4c87 100644 --- a/src/runtime/service_app.h +++ b/src/runtime/service_app.h @@ -26,19 +26,19 @@ #pragma once -#include "runtime/api_task.h" +#include +#include + #include "runtime/api_layer1.h" +#include "runtime/api_task.h" #include "runtime/app_model.h" +#include "runtime/rpc/rpc_address.h" +#include "runtime/task/task_code.h" #include "utils/api_utilities.h" #include "utils/error_code.h" -#include "utils/threadpool_code.h" -#include "runtime/task/task_code.h" -#include "common/gpid.h" -#include "runtime/rpc/rpc_address.h" -#include "common/gpid.h" #include "utils/factory_store.h" -#include -#include +#include "utils/gpid.h" +#include "utils/threadpool_code.h" namespace dsn { /*! diff --git a/src/runtime/service_engine.cpp b/src/runtime/service_engine.cpp index ee0c742d81..94cc1fed2e 100644 --- a/src/runtime/service_engine.cpp +++ b/src/runtime/service_engine.cpp @@ -32,7 +32,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "runtime/node_scoper.h" #include "runtime/rpc/rpc_engine.h" #include "runtime/rpc/rpc_message.h" diff --git a/src/runtime/task/CMakeLists.txt b/src/runtime/task/CMakeLists.txt index ad09763cf6..edc6ad0415 100644 --- a/src/runtime/task/CMakeLists.txt +++ b/src/runtime/task/CMakeLists.txt @@ -24,6 +24,7 @@ set(MY_PROJ_NAME dsn.task) +set(MY_PROJ_SRC "") # Search mode for source files under CURRENT project directory? # "GLOB_RECURSE" for recursive search # "GLOB" for non-recursive search diff --git a/src/runtime/test/CMakeLists.txt b/src/runtime/test/CMakeLists.txt index 83e355c449..a075ed3223 100644 --- a/src/runtime/test/CMakeLists.txt +++ b/src/runtime/test/CMakeLists.txt @@ -23,12 +23,27 @@ # THE SOFTWARE. set(MY_PROJ_NAME dsn_runtime_tests) +set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_meta_server dsn_ranger dsn_runtime + sasl2 + gssapi_krb5 + krb5 dsn_aio + dsn_dist_cmd + dsn_replication_common + dsn.replication.zookeeper_provider + zookeeper + hashtable + dsn.block_service + dsn.block_service.hdfs + dsn.block_service.local + dsn.failure_detector + dsn_utils + gtest rocksdb lz4 zstd diff --git a/src/runtime/test/rpc_holder_test.cpp b/src/runtime/test/rpc_holder_test.cpp index 8d1b838d85..9efe392dde 100644 --- a/src/runtime/test/rpc_holder_test.cpp +++ b/src/runtime/test/rpc_holder_test.cpp @@ -29,7 +29,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/serialization_helper/dsn.layer2_types.h" #include "gtest/gtest.h" #include "runtime/message_utils.h" diff --git a/src/runtime/test/rpc_message.cpp b/src/runtime/test/rpc_message.cpp index a596b2cd29..7a165db17c 100644 --- a/src/runtime/test/rpc_message.cpp +++ b/src/runtime/test/rpc_message.cpp @@ -30,7 +30,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "dsn.layer2_types.h" #include "gtest/gtest.h" #include "runtime/message_utils.cpp" diff --git a/src/runtime/test/thrift_message_parser_test.cpp b/src/runtime/test/thrift_message_parser_test.cpp index 722b2860b6..41ba099c69 100644 --- a/src/runtime/test/thrift_message_parser_test.cpp +++ b/src/runtime/test/thrift_message_parser_test.cpp @@ -24,7 +24,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/serialization_helper/thrift_helper.h" #include "gtest/gtest.h" #include "request_meta_types.h" diff --git a/src/runtime/test_utils.h b/src/runtime/test_utils.h index 29520eee97..be3be1a0f2 100644 --- a/src/runtime/test_utils.h +++ b/src/runtime/test_utils.h @@ -26,24 +26,25 @@ #pragma once -#include "runtime/api_task.h" +#include +#include + #include "runtime/api_layer1.h" +#include "runtime/api_task.h" #include "runtime/app_model.h" -#include "utils/api_utilities.h" -#include "utils/error_code.h" -#include "utils/threadpool_code.h" -#include "runtime/task/task_code.h" -#include "common/gpid.h" -#include "runtime/rpc/serialization.h" #include "runtime/rpc/rpc_stream.h" +#include "runtime/rpc/serialization.h" #include "runtime/serverlet.h" #include "runtime/service_app.h" #include "runtime/rpc/rpc_address.h" #include "runtime/rpc/rpc_host_port.h" #include "runtime/task/task.h" +#include "runtime/task/task_code.h" #include "runtime/task/task_worker.h" -#include -#include +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/gpid.h" +#include "utils/threadpool_code.h" using namespace ::dsn; diff --git a/src/sample/CMakeLists.txt b/src/sample/CMakeLists.txt index b0618dfca8..43e68a1f77 100644 --- a/src/sample/CMakeLists.txt +++ b/src/sample/CMakeLists.txt @@ -15,13 +15,24 @@ # specific language governing permissions and limitations # under the License. -set(MY_PROJ_NAME "sample") +set(MY_PROJ_NAME sample) set(MY_SRC_SEARCH_MODE "GLOB") +# TODO(yingchun): should link pegasus_client shared lib only! set(MY_PROJ_LIBS - pegasus_client_static - ) + pegasus_client_static + dsn_client + dsn_replication_common + dsn_runtime + sasl2 + gssapi_krb5 + krb5 + dsn_utils + rocksdb + lz4 + zstd + snappy) set(MY_BOOST_LIBS Boost::filesystem Boost::system) diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index 11673f6930..1218e5ff20 100644 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -16,18 +16,27 @@ # under the License. set(MY_PROJ_NAME pegasus_server) + set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS + dsn_runtime dsn_replica_server + dsn_nfs + dsn_aio dsn_meta_server dsn_ranger dsn_replication_common dsn_client - dsn.block_service.local + dsn_dist_cmd dsn.block_service + dsn.block_service.hdfs + dsn.block_service.local dsn.failure_detector dsn.replication.zookeeper_provider + zookeeper + hashtable + dsn_http dsn_utils rocksdb lz4 @@ -35,8 +44,8 @@ set(MY_PROJ_LIBS snappy pegasus_base pegasus_client_static - event - hashtable) + event) + set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES config.ini) diff --git a/src/server/hotspot_partition_calculator.cpp b/src/server/hotspot_partition_calculator.cpp index 3792540332..57726d95ee 100644 --- a/src/server/hotspot_partition_calculator.cpp +++ b/src/server/hotspot_partition_calculator.cpp @@ -23,7 +23,7 @@ #include #include "client/replication_ddl_client.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/serialization_helper/dsn.layer2_types.h" #include "perf_counter/perf_counter.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/server/pegasus_mutation_duplicator.cpp b/src/server/pegasus_mutation_duplicator.cpp index 3553bcfc79..6a04326f3f 100644 --- a/src/server/pegasus_mutation_duplicator.cpp +++ b/src/server/pegasus_mutation_duplicator.cpp @@ -59,21 +59,6 @@ METRIC_DEFINE_counter(replica, dsn::metric_unit::kRequests, "The number of failed DUPLICATE requests sent from client"); -namespace dsn { -namespace replication { -struct replica_base; - -/// static definition of mutation_duplicator::creator. -/*static*/ std::function( - replica_base *, absl::string_view, absl::string_view)> - mutation_duplicator::creator = - [](replica_base *r, absl::string_view remote, absl::string_view app) { - return std::make_unique(r, remote, app); - }; - -} // namespace replication -} // namespace dsn - namespace pegasus { namespace server { @@ -105,6 +90,12 @@ using namespace dsn::literals::chrono_literals; __builtin_unreachable(); } +std::unique_ptr pegasus_mutation_duplicator::create( + replica_base *r, absl::string_view remote, absl::string_view app) +{ + return std::make_unique(r, remote, app); +} + pegasus_mutation_duplicator::pegasus_mutation_duplicator(dsn::replication::replica_base *r, absl::string_view remote_cluster, absl::string_view app) diff --git a/src/server/pegasus_mutation_duplicator.h b/src/server/pegasus_mutation_duplicator.h index 2d81a6a37c..a2c837464a 100644 --- a/src/server/pegasus_mutation_duplicator.h +++ b/src/server/pegasus_mutation_duplicator.h @@ -60,6 +60,9 @@ class pegasus_mutation_duplicator : public dsn::replication::mutation_duplicator using duplicate_rpc = dsn::apps::duplicate_rpc; public: + static std::unique_ptr + create(replica_base *, absl::string_view /*remote cluster*/, absl::string_view /*app name*/); + pegasus_mutation_duplicator(dsn::replication::replica_base *r, absl::string_view remote_cluster, absl::string_view app); diff --git a/src/server/pegasus_server_impl.h b/src/server/pegasus_server_impl.h index 4a2b8b522b..145486c7aa 100644 --- a/src/server/pegasus_server_impl.h +++ b/src/server/pegasus_server_impl.h @@ -37,7 +37,7 @@ #include #include "bulk_load_types.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "metadata_types.h" #include "pegasus_manual_compact_service.h" #include "pegasus_read_service.h" diff --git a/src/server/pegasus_server_impl_init.cpp b/src/server/pegasus_server_impl_init.cpp index 9c6cd2d5b6..9f5f19e4c8 100644 --- a/src/server/pegasus_server_impl_init.cpp +++ b/src/server/pegasus_server_impl_init.cpp @@ -37,7 +37,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "hashkey_transform.h" #include "hotkey_collector.h" #include "pegasus_event_listener.h" diff --git a/src/server/pegasus_server_write.cpp b/src/server/pegasus_server_write.cpp index 6c98971cb0..004918fe7b 100644 --- a/src/server/pegasus_server_write.cpp +++ b/src/server/pegasus_server_write.cpp @@ -25,7 +25,7 @@ #include #include "base/pegasus_key_schema.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "logging_utils.h" #include "pegasus_rpc_types.h" diff --git a/src/server/test/CMakeLists.txt b/src/server/test/CMakeLists.txt index 5907476d30..e78170de76 100644 --- a/src/server/test/CMakeLists.txt +++ b/src/server/test/CMakeLists.txt @@ -33,26 +33,37 @@ set(MY_PROJ_SRC "../compaction_operation.cpp") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS - dsn_replica_server + dsn_runtime + sasl2 + gssapi_krb5 + krb5 dsn_meta_server dsn_ranger + dsn_replica_server + dsn.security + dsn_nfs + dsn_aio + dsn_dist_cmd dsn_replication_common dsn_client - dsn.block_service.local dsn.block_service + dsn.block_service.hdfs + dsn.block_service.local dsn.failure_detector dsn.replication.zookeeper_provider + zookeeper + hashtable dsn_utils - rocksdb - lz4 - zstd - snappy pegasus_client_static event pegasus_base gtest gmock - hashtable) + rocksdb + lz4 + zstd + snappy) + add_definitions(-DPEGASUS_UNIT_TEST) add_definitions(-DENABLE_FAIL) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/server/test/hotkey_collector_test.cpp b/src/server/test/hotkey_collector_test.cpp index a888288352..cb2637c280 100644 --- a/src/server/test/hotkey_collector_test.cpp +++ b/src/server/test/hotkey_collector_test.cpp @@ -23,7 +23,7 @@ #include #include "base/pegasus_key_schema.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "gtest/gtest.h" #include "pegasus_server_test_base.h" diff --git a/src/server/test/pegasus_mutation_duplicator_test.cpp b/src/server/test/pegasus_mutation_duplicator_test.cpp index 8ddbd38b4b..fd91cbc4e3 100644 --- a/src/server/test/pegasus_mutation_duplicator_test.cpp +++ b/src/server/test/pegasus_mutation_duplicator_test.cpp @@ -32,7 +32,7 @@ #include "backup_types.h" #include "base/pegasus_rpc_types.h" #include "common/duplication_common.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "duplication_internal_types.h" #include "gtest/gtest.h" @@ -68,7 +68,7 @@ class pegasus_mutation_duplicator_test : public pegasus_server_test_base void test_duplicate() { replica_base replica(dsn::gpid(1, 1), "fake_replica", "temp"); - auto duplicator = new_mutation_duplicator(&replica, "onebox2", "temp"); + auto duplicator = pegasus_mutation_duplicator::create(&replica, "onebox2", "temp"); duplicator->set_task_environment(&_env); std::string sort_key; @@ -137,7 +137,7 @@ class pegasus_mutation_duplicator_test : public pegasus_server_test_base void test_duplicate_failed() { replica_base replica(dsn::gpid(1, 1), "fake_replica", "temp"); - auto duplicator = new_mutation_duplicator(&replica, "onebox2", "temp"); + auto duplicator = pegasus_mutation_duplicator::create(&replica, "onebox2", "temp"); duplicator->set_task_environment(&_env); std::string sort_key; @@ -213,7 +213,7 @@ class pegasus_mutation_duplicator_test : public pegasus_server_test_base void test_duplicate_isolated_hashkeys() { replica_base replica(dsn::gpid(1, 1), "fake_replica", "temp"); - auto duplicator = new_mutation_duplicator(&replica, "onebox2", "temp"); + auto duplicator = pegasus_mutation_duplicator::create(&replica, "onebox2", "temp"); duplicator->set_task_environment(&_env); size_t total_size = 4000; @@ -272,7 +272,7 @@ class pegasus_mutation_duplicator_test : public pegasus_server_test_base void test_create_duplicator() { replica_base replica(dsn::gpid(1, 1), "fake_replica", "temp"); - auto duplicator = new_mutation_duplicator(&replica, "onebox2", "temp"); + auto duplicator = pegasus_mutation_duplicator::create(&replica, "onebox2", "temp"); duplicator->set_task_environment(&_env); auto duplicator_impl = dynamic_cast(duplicator.get()); ASSERT_EQ(duplicator_impl->_remote_cluster_id, 2); @@ -375,7 +375,7 @@ TEST_P(pegasus_mutation_duplicator_test, create_duplicator) { test_create_duplic TEST_P(pegasus_mutation_duplicator_test, duplicate_duplicate) { replica_base replica(dsn::gpid(1, 1), "fake_replica", "temp"); - auto duplicator = new_mutation_duplicator(&replica, "onebox2", "temp"); + auto duplicator = pegasus_mutation_duplicator::create(&replica, "onebox2", "temp"); duplicator->set_task_environment(&_env); dsn::apps::update_request request; diff --git a/src/server/test/pegasus_server_write_test.cpp b/src/server/test/pegasus_server_write_test.cpp index 482f044a82..055a308a2b 100644 --- a/src/server/test/pegasus_server_write_test.cpp +++ b/src/server/test/pegasus_server_write_test.cpp @@ -25,7 +25,7 @@ #include #include "base/pegasus_key_schema.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "gtest/gtest.h" #include "message_utils.h" #include "pegasus_rpc_types.h" diff --git a/src/server/test/pegasus_write_service_test.cpp b/src/server/test/pegasus_write_service_test.cpp index 8f861f3403..12ebe2cd00 100644 --- a/src/server/test/pegasus_write_service_test.cpp +++ b/src/server/test/pegasus_write_service_test.cpp @@ -27,7 +27,7 @@ #include #include "base/pegasus_key_schema.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "duplication_internal_types.h" #include "gtest/gtest.h" #include "message_utils.h" diff --git a/src/shell/CMakeLists.txt b/src/shell/CMakeLists.txt index 121f1b04cb..d924c60021 100644 --- a/src/shell/CMakeLists.txt +++ b/src/shell/CMakeLists.txt @@ -22,30 +22,45 @@ set(MY_PROJ_SRC sds/sds.c) set(MY_SRC_SEARCH_MODE "GLOB_RECURSE") set(MY_PROJ_LIBS - pegasus_base dsn.replication.tool - dsn_replica_server dsn_meta_server dsn_ranger + dsn_runtime + dsn_replica_server + dsn_nfs + dsn_aio dsn_replication_common dsn_client - dsn_utils - dsn.block_service.local - dsn.block_service.hdfs + dsn_dist_cmd dsn.block_service + dsn.block_service.hdfs + hdfs + dsn.block_service.local dsn.failure_detector - pegasus_client_static - pegasus_geo_lib + dsn.replication.zookeeper_provider + zookeeper + hashtable + dsn_http + dsn_utils rocksdb lz4 zstd snappy + pegasus_base + pegasus_client_static + event + pegasus_geo_lib + s2 absl::flat_hash_set absl::strings - s2 - hdfs) + sasl2 + gssapi_krb5 + krb5) + + set(MY_BINPLACES ${CMAKE_CURRENT_SOURCE_DIR}/config.ini) + set(MY_BOOST_LIBS Boost::system Boost::filesystem) SET(CMAKE_INSTALL_RPATH ".") SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) diff --git a/src/shell/commands/debugger.cpp b/src/shell/commands/debugger.cpp index 1080c15060..6c27cdd6ed 100644 --- a/src/shell/commands/debugger.cpp +++ b/src/shell/commands/debugger.cpp @@ -47,7 +47,7 @@ #include #include "base/idl_utils.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "pegasus_key_schema.h" #include "pegasus_utils.h" diff --git a/src/shell/commands/detect_hotkey.cpp b/src/shell/commands/detect_hotkey.cpp index 6d300d31d3..9aa4dbb3ab 100644 --- a/src/shell/commands/detect_hotkey.cpp +++ b/src/shell/commands/detect_hotkey.cpp @@ -22,7 +22,7 @@ #include #include "client/replication_ddl_client.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "replica_admin_types.h" #include "runtime/rpc/rpc_address.h" #include "shell/argh.h" diff --git a/src/shell/commands/rebalance.cpp b/src/shell/commands/rebalance.cpp index 43a591cfc4..39a896ffa6 100644 --- a/src/shell/commands/rebalance.cpp +++ b/src/shell/commands/rebalance.cpp @@ -29,7 +29,7 @@ #include #include "client/replication_ddl_client.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "meta_admin_types.h" #include "runtime/rpc/rpc_address.h" #include "shell/command_executor.h" diff --git a/src/shell/commands/recovery.cpp b/src/shell/commands/recovery.cpp index 8df98616c6..c7a9f60023 100644 --- a/src/shell/commands/recovery.cpp +++ b/src/shell/commands/recovery.cpp @@ -29,7 +29,7 @@ #include #include "client/replication_ddl_client.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "dsn.layer2_types.h" #include "meta_admin_types.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/shell/commands/table_management.cpp b/src/shell/commands/table_management.cpp index 806a7a13dc..59e37860ef 100644 --- a/src/shell/commands/table_management.cpp +++ b/src/shell/commands/table_management.cpp @@ -34,7 +34,7 @@ #include #include "client/replication_ddl_client.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/json_helper.h" #include "dsn.layer2_types.h" #include "meta_admin_types.h" diff --git a/src/test/bench_test/CMakeLists.txt b/src/test/bench_test/CMakeLists.txt index 5a52808d8d..32e4d354a1 100644 --- a/src/test/bench_test/CMakeLists.txt +++ b/src/test/bench_test/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -set(MY_PROJ_NAME "pegasus_bench") +set(MY_PROJ_NAME pegasus_bench) project(${MY_PROJ_NAME} C CXX) # Source files under CURRENT project directory will be automatically included. @@ -29,14 +29,17 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS pegasus_client_static + dsn_client + dsn_replication_common + dsn_runtime + sasl2 + gssapi_krb5 + krb5 dsn_utils rocksdb lz4 zstd - snappy - sasl2 - gssapi_krb5 - krb5) + snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/test/function_test/backup_restore/CMakeLists.txt b/src/test/function_test/backup_restore/CMakeLists.txt index 41a6c6ed2b..a41b6e7939 100644 --- a/src/test/function_test/backup_restore/CMakeLists.txt +++ b/src/test/function_test/backup_restore/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -set(MY_PROJ_NAME "backup_restore_test") +set(MY_PROJ_NAME backup_restore_test) project(${MY_PROJ_NAME} C CXX) set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") @@ -23,14 +23,15 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_client dsn_replication_common - dsn_utils - gtest + dsn_runtime sasl2 gssapi_krb5 krb5 function_test_utils pegasus_client_static - test_utils) + dsn_utils + test_utils + gtest) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/test/function_test/base_api/CMakeLists.txt b/src/test/function_test/base_api/CMakeLists.txt index 3e688f3a17..ca08fab04b 100644 --- a/src/test/function_test/base_api/CMakeLists.txt +++ b/src/test/function_test/base_api/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -set(MY_PROJ_NAME "base_api_test") +set(MY_PROJ_NAME base_api_test) project(${MY_PROJ_NAME} C CXX) # Source files under CURRENT project directory will be automatically included. @@ -28,17 +28,17 @@ set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS - dsn_client - dsn_replication_common - dsn_utils - pegasus_client_static - gtest - sasl2 - gssapi_krb5 - krb5 - function_test_utils - test_utils - ) + dsn_client + dsn_replication_common + dsn_runtime + sasl2 + gssapi_krb5 + krb5 + function_test_utils + pegasus_client_static + dsn_utils + test_utils + gtest) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/test/function_test/bulk_load/CMakeLists.txt b/src/test/function_test/bulk_load/CMakeLists.txt index ae1fd559b6..724c85c658 100644 --- a/src/test/function_test/bulk_load/CMakeLists.txt +++ b/src/test/function_test/bulk_load/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -set(MY_PROJ_NAME "bulk_load_test") +set(MY_PROJ_NAME bulk_load_test) project(${MY_PROJ_NAME} C CXX) # Source files under CURRENT project directory will be automatically included. @@ -30,19 +30,18 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_client dsn_replication_common - dsn_utils - dsn.block_service.local - pegasus_client_static - gtest + dsn_runtime sasl2 gssapi_krb5 krb5 + dsn.block_service + dsn.block_service.hdfs + dsn.block_service.local + pegasus_client_static + dsn_utils function_test_utils test_utils - rocksdb - lz4 - zstd - snappy) + gtest) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/test/function_test/detect_hotspot/CMakeLists.txt b/src/test/function_test/detect_hotspot/CMakeLists.txt index 8a8070d854..ae73dc3b9c 100644 --- a/src/test/function_test/detect_hotspot/CMakeLists.txt +++ b/src/test/function_test/detect_hotspot/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -set(MY_PROJ_NAME "detect_hotspot_test") +set(MY_PROJ_NAME detect_hotspot_test) project(${MY_PROJ_NAME} C CXX) # Source files under CURRENT project directory will be automatically included. @@ -30,14 +30,15 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_client dsn_replication_common - dsn_utils - pegasus_client_static - gtest + dsn_runtime sasl2 gssapi_krb5 krb5 function_test_utils - test_utils) + pegasus_client_static + dsn_utils + test_utils + gtest) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/test/function_test/detect_hotspot/test_detect_hotspot.cpp b/src/test/function_test/detect_hotspot/test_detect_hotspot.cpp index 659d379053..596ebda5f1 100644 --- a/src/test/function_test/detect_hotspot/test_detect_hotspot.cpp +++ b/src/test/function_test/detect_hotspot/test_detect_hotspot.cpp @@ -25,7 +25,7 @@ #include #include "client/replication_ddl_client.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "gtest/gtest.h" #include "include/pegasus/client.h" #include "include/pegasus/error.h" diff --git a/src/test/function_test/partition_split/CMakeLists.txt b/src/test/function_test/partition_split/CMakeLists.txt index b2cff9f606..3206b0c92c 100644 --- a/src/test/function_test/partition_split/CMakeLists.txt +++ b/src/test/function_test/partition_split/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -set(MY_PROJ_NAME "partition_split_test") +set(MY_PROJ_NAME partition_split_test) project(${MY_PROJ_NAME} C CXX) # Source files under CURRENT project directory will be automatically included. @@ -28,17 +28,17 @@ set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS - dsn_client - dsn_replication_common - dsn_utils - pegasus_client_static - gtest - sasl2 - gssapi_krb5 - krb5 - function_test_utils - test_utils - ) + dsn_client + dsn_replication_common + dsn_runtime + sasl2 + gssapi_krb5 + krb5 + function_test_utils + pegasus_client_static + dsn_utils + test_utils + gtest) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/test/function_test/partition_split/test_split.cpp b/src/test/function_test/partition_split/test_split.cpp index 42942121b7..2b011746de 100644 --- a/src/test/function_test/partition_split/test_split.cpp +++ b/src/test/function_test/partition_split/test_split.cpp @@ -30,7 +30,7 @@ #include "client/partition_resolver.h" #include "client/replication_ddl_client.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "gtest/gtest.h" #include "include/pegasus/client.h" #include "metadata_types.h" diff --git a/src/test/function_test/recovery/CMakeLists.txt b/src/test/function_test/recovery/CMakeLists.txt index a13d12734b..cb73081870 100644 --- a/src/test/function_test/recovery/CMakeLists.txt +++ b/src/test/function_test/recovery/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -set(MY_PROJ_NAME "recovery_test") +set(MY_PROJ_NAME recovery_test) project(${MY_PROJ_NAME} C CXX) # Source files under CURRENT project directory will be automatically included. @@ -30,14 +30,15 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_client dsn_replication_common - dsn_utils - pegasus_client_static - gtest + dsn_runtime sasl2 gssapi_krb5 krb5 function_test_utils - test_utils) + pegasus_client_static + dsn_utils + test_utils + gtest) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/test/function_test/restore/CMakeLists.txt b/src/test/function_test/restore/CMakeLists.txt index 18b0ad4446..0d3d2564f0 100644 --- a/src/test/function_test/restore/CMakeLists.txt +++ b/src/test/function_test/restore/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -set(MY_PROJ_NAME "restore_test") +set(MY_PROJ_NAME restore_test) project(${MY_PROJ_NAME} C CXX) # Source files under CURRENT project directory will be automatically included. @@ -30,14 +30,15 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_client dsn_replication_common - dsn_utils - gtest + dsn_runtime sasl2 gssapi_krb5 krb5 function_test_utils pegasus_client_static - test_utils) + dsn_utils + test_utils + gtest) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/test/function_test/restore/test_restore.cpp b/src/test/function_test/restore/test_restore.cpp index e99ef62ea8..c94553b6cb 100644 --- a/src/test/function_test/restore/test_restore.cpp +++ b/src/test/function_test/restore/test_restore.cpp @@ -34,7 +34,7 @@ #include "base/pegasus_const.h" #include "client/partition_resolver.h" #include "client/replication_ddl_client.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "gtest/gtest.h" #include "test/function_test/utils/global_env.h" #include "test/function_test/utils/test_util.h" diff --git a/src/test/function_test/throttle/CMakeLists.txt b/src/test/function_test/throttle/CMakeLists.txt index 70460d0c5d..5134b7901c 100644 --- a/src/test/function_test/throttle/CMakeLists.txt +++ b/src/test/function_test/throttle/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -set(MY_PROJ_NAME "throttle_test") +set(MY_PROJ_NAME throttle_test) project(${MY_PROJ_NAME} C CXX) # Source files under CURRENT project directory will be automatically included. @@ -28,17 +28,17 @@ set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS - dsn_client - dsn_replication_common - dsn_utils - pegasus_client_static - gtest - sasl2 - gssapi_krb5 - krb5 - function_test_utils - test_utils - ) + dsn_client + dsn_replication_common + dsn_runtime + sasl2 + gssapi_krb5 + krb5 + function_test_utils + pegasus_client_static + dsn_utils + test_utils + gtest) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/test/function_test/throttle/test_throttle.cpp b/src/test/function_test/throttle/test_throttle.cpp index d7e5f61b51..d77a549cc6 100644 --- a/src/test/function_test/throttle/test_throttle.cpp +++ b/src/test/function_test/throttle/test_throttle.cpp @@ -28,7 +28,7 @@ #include "client/partition_resolver.h" #include "client/replication_ddl_client.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "gtest/gtest.h" #include "include/pegasus/client.h" #include "pegasus/error.h" diff --git a/src/test/kill_test/CMakeLists.txt b/src/test/kill_test/CMakeLists.txt index df97448737..ba57957615 100644 --- a/src/test/kill_test/CMakeLists.txt +++ b/src/test/kill_test/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -set(MY_PROJ_NAME "pegasus_kill_test") +set(MY_PROJ_NAME pegasus_kill_test) project(${MY_PROJ_NAME} C CXX) # Source files under CURRENT project directory will be automatically included. @@ -28,17 +28,17 @@ set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS - pegasus_base - pegasus_client_static - dsn_client - dsn_replication_common - dsn_dist_cmd - dsn_runtime - dsn_utils - sasl2 - gssapi_krb5 - krb5 - ) + dsn_client + dsn_replication_common + dsn_dist_cmd + dsn_runtime + sasl2 + gssapi_krb5 + krb5 + function_test_utils + pegasus_client_static + dsn_utils) + set(MY_BINPLACES "${CMAKE_CURRENT_SOURCE_DIR}/config.ini") set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/test/kill_test/kill_testor.cpp b/src/test/kill_test/kill_testor.cpp index 6c1019aef1..4442b358f7 100644 --- a/src/test/kill_test/kill_testor.cpp +++ b/src/test/kill_test/kill_testor.cpp @@ -29,7 +29,7 @@ #include "base/pegasus_const.h" #include "client/replication_ddl_client.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication_other_types.h" #include "kill_testor.h" #include "runtime/rpc/rpc_address.h" diff --git a/src/test/kill_test/partition_kill_testor.cpp b/src/test/kill_test/partition_kill_testor.cpp index 271cc64c5b..656930ad04 100644 --- a/src/test/kill_test/partition_kill_testor.cpp +++ b/src/test/kill_test/partition_kill_testor.cpp @@ -25,7 +25,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "dsn.layer2_types.h" #include "partition_kill_testor.h" #include "remote_cmd/remote_command.h" diff --git a/src/test/pressure_test/CMakeLists.txt b/src/test/pressure_test/CMakeLists.txt index 42e29b7366..594b8fc2a3 100644 --- a/src/test/pressure_test/CMakeLists.txt +++ b/src/test/pressure_test/CMakeLists.txt @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -set(MY_PROJ_NAME "pegasus_pressureclient") +set(MY_PROJ_NAME pegasus_pressureclient) project(${MY_PROJ_NAME} C CXX) # Source files under CURRENT project directory will be automatically included. @@ -28,12 +28,15 @@ set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS - pegasus_client_static - dsn_utils - sasl2 - gssapi_krb5 - krb5 - ) + dsn_client + dsn_replication_common + dsn_runtime + sasl2 + gssapi_krb5 + krb5 + function_test_utils + pegasus_client_static + dsn_utils) set(MY_BINPLACES "${CMAKE_CURRENT_SOURCE_DIR}/config-pressure.ini") diff --git a/src/tools/mutation_log_tool.cpp b/src/tools/mutation_log_tool.cpp index b68a4979b5..bbedbfc473 100644 --- a/src/tools/mutation_log_tool.cpp +++ b/src/tools/mutation_log_tool.cpp @@ -31,7 +31,7 @@ #include #include "common/fs_manager.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "consensus_types.h" #include "dsn.layer2_types.h" #include "fmt/core.h" diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index 38390f0ed6..ce7adebd62 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -33,6 +33,7 @@ set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_PROJ_LIBS dsn_http + dsn_replication_common rocksdb lz4 zstd @@ -41,12 +42,7 @@ set(MY_PROJ_LIBS # Extra files that will be installed set(MY_BINPLACES "") -if (APPLE) - dsn_add_static_library() - target_link_libraries(${MY_PROJ_NAME} PRIVATE dsn_http) -else() - dsn_add_shared_library() -endif() +dsn_add_static_library() add_subdirectory(long_adder_bench) add_subdirectory(test) diff --git a/src/utils/distributed_lock_service.h b/src/utils/distributed_lock_service.h index 0a8749021c..0d50c71d07 100644 --- a/src/utils/distributed_lock_service.h +++ b/src/utils/distributed_lock_service.h @@ -33,7 +33,7 @@ #include "utils/error_code.h" #include "utils/threadpool_code.h" #include "runtime/task/task_code.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "runtime/rpc/serialization.h" #include "runtime/rpc/rpc_stream.h" #include "runtime/serverlet.h" diff --git a/src/utils/filesystem.h b/src/utils/filesystem.h index 29524c9c3c..f6e0ad054e 100644 --- a/src/utils/filesystem.h +++ b/src/utils/filesystem.h @@ -79,6 +79,8 @@ std::string get_file_name(const std::string &path); std::string path_combine(const std::string &path1, const std::string &path2); std::string concat_path_unix_style(const std::string &prefix, const std::string &postfix); +std::string concat_path_unix_style(const std::string &prefix, const std::string &postfix); + typedef std::function ftw_handler; bool file_tree_walk(const std::string &dirpath, ftw_handler handler, bool recursive = true); diff --git a/src/utils/gpid.cpp b/src/utils/gpid.cpp index 1d3bb3e27c..f583574deb 100644 --- a/src/utils/gpid.cpp +++ b/src/utils/gpid.cpp @@ -26,8 +26,7 @@ #include -#include "common/gpid.h" -#include "utils/fixed_size_buffer_pool.h" +#include "utils/gpid.h" namespace dsn { @@ -36,11 +35,4 @@ bool gpid::parse_from(const char *str) return sscanf(str, "%d.%d", &_value.u.app_id, &_value.u.partition_index) == 2; } -static __thread fixed_size_buffer_pool<8, 64> bf; -const char *gpid::to_string() const -{ - char *b = bf.next(); - snprintf(b, bf.get_chunk_size(), "%d.%d", _value.u.app_id, _value.u.partition_index); - return b; -} -} +} // namespace dsn diff --git a/src/common/gpid.h b/src/utils/gpid.h similarity index 91% rename from src/common/gpid.h rename to src/utils/gpid.h index 183aae40dc..3f52cd33af 100644 --- a/src/common/gpid.h +++ b/src/utils/gpid.h @@ -30,6 +30,7 @@ #include #include +#include "utils/fixed_size_buffer_pool.h" #include "utils/fmt_utils.h" namespace dsn { @@ -67,7 +68,13 @@ class gpid bool parse_from(const char *str); - const char *to_string() const; + const char *to_string() const + { + static __thread fixed_size_buffer_pool<8, 64> bf; + char *b = bf.next(); + snprintf(b, bf.get_chunk_size(), "%d.%d", _value.u.app_id, _value.u.partition_index); + return b; + } // for serialization in thrift format uint32_t read(::apache::thrift::protocol::TProtocol *iprot); diff --git a/src/utils/long_adder_bench/CMakeLists.txt b/src/utils/long_adder_bench/CMakeLists.txt index 71568c61ae..86568dda1e 100644 --- a/src/utils/long_adder_bench/CMakeLists.txt +++ b/src/utils/long_adder_bench/CMakeLists.txt @@ -29,6 +29,9 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_runtime + sasl2 + gssapi_krb5 + krb5 dsn_utils rocksdb lz4 diff --git a/src/utils/metrics.cpp b/src/utils/metrics.cpp index 0a17bc1e73..fab089588f 100644 --- a/src/utils/metrics.cpp +++ b/src/utils/metrics.cpp @@ -240,12 +240,13 @@ metric_entity_prototype::~metric_entity_prototype() {} metrics_http_service::metrics_http_service(metric_registry *registry) : _registry(registry) { - register_handler("metrics", - std::bind(&metrics_http_service::get_metrics_handler, - this, - std::placeholders::_1, - std::placeholders::_2), - "ip:port/metrics"); + // undefined reference to `dsn::http_service::register_handler + // register_handler("metrics", + // std::bind(&metrics_http_service::get_metrics_handler, + // this, + // std::placeholders::_1, + // std::placeholders::_2), + // "ip:port/metrics"); } namespace { diff --git a/src/utils/test/CMakeLists.txt b/src/utils/test/CMakeLists.txt index 8502cabb76..dbdcce28be 100644 --- a/src/utils/test/CMakeLists.txt +++ b/src/utils/test/CMakeLists.txt @@ -32,6 +32,9 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_http dsn_runtime + sasl2 + gssapi_krb5 + krb5 dsn_utils gtest test_utils diff --git a/src/utils/test/fmt_logging_test.cpp b/src/utils/test/fmt_logging_test.cpp index 95e7d0dfd9..e135d7cdf2 100644 --- a/src/utils/test/fmt_logging_test.cpp +++ b/src/utils/test/fmt_logging_test.cpp @@ -27,7 +27,7 @@ #include #include -#include "common/gpid.h" +#include "utils/gpid.h" #include "common/replication.codes.h" #include "gtest/gtest.h" #include "runtime/task/task_code.h" diff --git a/src/utils/test/nth_element_bench/CMakeLists.txt b/src/utils/test/nth_element_bench/CMakeLists.txt index 3aae31e4a6..c4e82082b4 100644 --- a/src/utils/test/nth_element_bench/CMakeLists.txt +++ b/src/utils/test/nth_element_bench/CMakeLists.txt @@ -29,6 +29,9 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_runtime + sasl2 + gssapi_krb5 + krb5 dsn_utils rocksdb lz4 diff --git a/src/zookeeper/CMakeLists.txt b/src/zookeeper/CMakeLists.txt index c6d99a55d9..5ebfcd0e28 100644 --- a/src/zookeeper/CMakeLists.txt +++ b/src/zookeeper/CMakeLists.txt @@ -34,7 +34,9 @@ set(MY_PROJ_SRC "") # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_PROJ_LIBS zookeeper hashtable) +set(MY_PROJ_LIBS + zookeeper + hashtable) # Extra files that will be installed set(MY_BINPLACES "") diff --git a/src/zookeeper/lock_types.h b/src/zookeeper/lock_types.h index d368fc514d..4917bff3b1 100644 --- a/src/zookeeper/lock_types.h +++ b/src/zookeeper/lock_types.h @@ -30,7 +30,7 @@ #include "utils/error_code.h" #include "utils/threadpool_code.h" #include "runtime/task/task_code.h" -#include "common/gpid.h" +#include "utils/gpid.h" #include "utils/distributed_lock_service.h" namespace dsn { diff --git a/src/zookeeper/test/CMakeLists.txt b/src/zookeeper/test/CMakeLists.txt index 7dabd1faf5..453c1f7939 100644 --- a/src/zookeeper/test/CMakeLists.txt +++ b/src/zookeeper/test/CMakeLists.txt @@ -36,13 +36,18 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn.replication.zookeeper_provider dsn_runtime + sasl2 + gssapi_krb5 + krb5 + dsn_utils + dsn_http zookeeper hashtable gtest rocksdb lz4 - zstd - snappy) + snappy + zstd) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index fb628986a1..7a2c10379b 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -448,6 +448,7 @@ set(ROCKSDB_OPTIONS -DWITH_TESTS=OFF -DWITH_GFLAGS=OFF -DUSE_RTTI=ON + -DROCKSDB_BUILD_SHARED=OFF -DCMAKE_BUILD_TYPE=Release -DWITH_JEMALLOC=${USE_JEMALLOC} -DJEMALLOC_ROOT_DIR=${TP_OUTPUT}