From e184f4b4ebc9c104e288df3692f5f3ed7cf2dde9 Mon Sep 17 00:00:00 2001 From: Yingchun Lai Date: Tue, 2 Jan 2024 00:31:03 +0800 Subject: [PATCH] refactor(rpc): move rpc out of runtime --- .github/workflows/lint_and_test_cpp.yaml | 10 +- .licenserc.yaml | 72 ++++----- build_tools/compile_thrift.py | 2 +- build_tools/recompile_thrift.sh | 2 +- src/CMakeLists.txt | 1 + src/base/pegasus_rpc_types.h | 2 +- src/block_service/block_service.h | 6 +- src/client/partition_resolver.cpp | 2 +- src/client/partition_resolver.h | 6 +- src/client/partition_resolver_manager.cpp | 4 +- src/client/partition_resolver_simple.cpp | 6 +- src/client/partition_resolver_simple.h | 2 +- src/client/replication_ddl_client.cpp | 4 +- src/client/replication_ddl_client.h | 12 +- src/client/test/ddl_client_test.cpp | 2 +- src/client_lib/pegasus_client_impl.cpp | 8 +- src/client_lib/pegasus_client_impl.h | 2 +- src/client_lib/pegasus_scanner_impl.cpp | 2 +- src/common/backup_common.cpp | 2 +- src/common/backup_common.h | 2 +- src/common/bulk_load_common.h | 2 +- src/common/duplication_common.h | 2 +- src/common/manual_compact.h | 2 +- src/common/partition_split_common.h | 2 +- src/common/replication_common.cpp | 4 +- src/common/replication_common.h | 7 +- src/common/replication_other_types.h | 4 +- src/common/serialization_helper/dsn_types.h | 2 +- .../serialization_helper/thrift_helper.h | 4 +- src/common/storage_serverlet.h | 6 +- src/failure_detector/failure_detector.cpp | 4 +- src/failure_detector/failure_detector.h | 3 +- .../failure_detector_multimaster.cpp | 4 +- .../failure_detector_multimaster.h | 5 +- src/failure_detector/fd.code.definition.h | 6 +- .../test/failure_detector.cpp | 10 +- src/geo/test/geo_test.cpp | 2 +- src/http/http_message_parser.cpp | 2 +- src/http/http_message_parser.h | 4 +- src/http/http_server.cpp | 4 +- src/http/http_server_impl.h | 2 +- src/http/test/http_server_test.cpp | 4 +- src/include/rrdb/rrdb.client.h | 2 +- src/meta/backup_engine.cpp | 6 +- src/meta/cluster_balance_policy.cpp | 6 +- src/meta/cluster_balance_policy.h | 3 +- src/meta/dump_file.h | 6 +- src/meta/duplication/duplication_info.h | 3 +- .../duplication/meta_duplication_service.cpp | 12 +- src/meta/greedy_load_balancer.cpp | 2 +- src/meta/load_balance_policy.cpp | 4 +- src/meta/load_balance_policy.h | 3 +- src/meta/meta_backup_service.cpp | 8 +- src/meta/meta_bulk_load_ingestion_context.h | 2 +- src/meta/meta_bulk_load_service.cpp | 12 +- src/meta/meta_bulk_load_service.h | 3 +- src/meta/meta_data.cpp | 6 +- src/meta/meta_data.h | 2 +- src/meta/meta_http_service.cpp | 2 +- src/meta/meta_rpc_types.h | 2 +- src/meta/meta_server_failure_detector.cpp | 2 +- src/meta/meta_server_failure_detector.h | 6 +- src/meta/meta_service.cpp | 6 +- src/meta/meta_service.h | 17 ++- src/meta/meta_split_service.cpp | 6 +- src/meta/meta_state_service_simple.h | 2 +- src/meta/partition_guardian.cpp | 2 +- src/meta/partition_guardian.h | 2 +- src/meta/server_load_balancer.cpp | 4 +- src/meta/server_load_balancer.h | 3 +- src/meta/server_state.cpp | 11 +- src/meta/server_state_restore.cpp | 6 +- src/meta/test/backup_test.cpp | 10 +- .../balancer_simulator/balancer_simulator.cpp | 6 +- src/meta/test/balancer_validator.cpp | 4 +- src/meta/test/cluster_balance_policy_test.cpp | 4 +- src/meta/test/copy_replica_operation_test.cpp | 2 +- src/meta/test/ford_fulkerson_test.cpp | 6 +- src/meta/test/json_compacity.cpp | 4 +- src/meta/test/meta_app_operation_test.cpp | 4 +- src/meta/test/meta_backup_test.cpp | 2 +- .../test/meta_bulk_load_ingestion_test.cpp | 6 +- src/meta/test/meta_bulk_load_service_test.cpp | 6 +- src/meta/test/meta_data.cpp | 6 +- .../test/meta_duplication_service_test.cpp | 4 +- src/meta/test/meta_http_service_test.cpp | 4 +- .../test/meta_partition_guardian_test.cpp | 10 +- src/meta/test/meta_service_test.cpp | 12 +- src/meta/test/meta_service_test_app.h | 6 +- src/meta/test/meta_split_service_test.cpp | 4 +- src/meta/test/meta_test_base.cpp | 4 +- src/meta/test/misc/misc.cpp | 6 +- src/meta/test/misc/misc.h | 2 +- src/meta/test/server_state_restore_test.cpp | 4 +- src/meta/test/server_state_test.cpp | 4 +- src/meta/test/state_sync_test.cpp | 6 +- src/meta/test/update_configuration_test.cpp | 10 +- src/nfs/nfs_client_impl.cpp | 4 +- src/nfs/nfs_client_impl.h | 2 +- src/nfs/nfs_node.h | 4 +- src/nfs/test/main.cpp | 2 +- src/redis_protocol/proxy_lib/proxy_layer.cpp | 6 +- src/redis_protocol/proxy_lib/proxy_layer.h | 4 +- src/redis_protocol/proxy_lib/redis_parser.cpp | 6 +- src/redis_protocol/proxy_lib/redis_parser.h | 4 +- .../proxy_ut/redis_proxy_test.cpp | 6 +- src/remote_cmd/remote_command.cpp | 4 +- src/replica/backup/replica_backup_server.cpp | 2 +- src/replica/bulk_load/replica_bulk_loader.cpp | 10 +- .../test/replica_bulk_loader_test.cpp | 4 +- .../duplication/duplication_sync_timer.cpp | 4 +- src/replica/duplication/replica_follower.cpp | 12 +- src/replica/duplication/replica_follower.h | 3 +- .../test/duplication_sync_timer_test.cpp | 6 +- .../test/load_from_private_log_test.cpp | 2 +- .../test/replica_follower_test.cpp | 4 +- src/replica/mutation.h | 2 +- src/replica/replica.cpp | 2 +- src/replica/replica.h | 5 +- src/replica/replica_2pc.cpp | 10 +- src/replica/replica_check.cpp | 8 +- src/replica/replica_chkpt.cpp | 6 +- src/replica/replica_config.cpp | 14 +- src/replica/replica_context.cpp | 2 +- src/replica/replica_context.h | 2 +- src/replica/replica_failover.cpp | 4 +- src/replica/replica_learn.cpp | 10 +- src/replica/replica_restore.cpp | 6 +- src/replica/replica_stub.cpp | 6 +- src/replica/replica_stub.h | 16 +- src/replica/replica_throttle.cpp | 2 +- src/replica/replication_app_base.cpp | 4 +- src/replica/split/replica_split_manager.cpp | 10 +- src/replica/split/test/replica_split_test.cpp | 4 +- .../storage/simple_kv/simple_kv.client.h | 2 +- src/replica/storage/simple_kv/test/case.cpp | 2 +- src/replica/storage/simple_kv/test/case.h | 3 +- .../storage/simple_kv/test/checker.cpp | 4 +- src/replica/storage/simple_kv/test/checker.h | 4 +- src/replica/storage/simple_kv/test/client.cpp | 10 +- src/replica/storage/simple_kv/test/client.h | 2 +- src/replica/storage/simple_kv/test/common.h | 2 +- src/replica/test/mock_utils.h | 2 +- src/replica/test/open_replica_test.cpp | 4 +- .../test/replica_disk_migrate_test.cpp | 2 +- src/replica/test/replica_disk_test.cpp | 2 +- src/replica/test/replica_test.cpp | 6 +- src/rpc/CMakeLists.txt | 31 ++++ src/{runtime => }/rpc/asio_net_provider.cpp | 3 +- src/{runtime => }/rpc/asio_net_provider.h | 10 +- src/{runtime => }/rpc/asio_rpc_session.cpp | 4 +- src/{runtime => }/rpc/asio_rpc_session.h | 4 +- src/{runtime => }/rpc/dns_resolver.cpp | 8 +- src/{runtime => }/rpc/dns_resolver.h | 4 +- src/{runtime => }/rpc/dsn_message_parser.cpp | 2 +- src/{runtime => }/rpc/dsn_message_parser.h | 2 +- src/{runtime => }/rpc/group_address.h | 2 +- src/{runtime => }/rpc/group_host_port.h | 7 +- src/{runtime => }/rpc/message_parser.cpp | 2 +- src/{runtime => }/rpc/message_parser.h | 2 +- .../rpc/message_parser_manager.h | 2 +- src/{runtime => }/rpc/network.cpp | 4 +- src/{runtime => }/rpc/network.h | 7 +- src/{runtime => }/rpc/network.sim.cpp | 0 src/{runtime => }/rpc/network.sim.h | 10 +- src/{runtime => }/rpc/raw_message_parser.cpp | 4 +- src/{runtime => }/rpc/raw_message_parser.h | 2 +- src/{runtime => }/rpc/request_meta.thrift | 0 src/{runtime => }/rpc/rpc_address.cpp | 6 +- src/{runtime => }/rpc/rpc_address.h | 0 src/{runtime => }/rpc/rpc_engine.cpp | 8 +- src/{runtime => }/rpc/rpc_engine.h | 10 +- src/{runtime => }/rpc/rpc_holder.h | 4 +- src/{runtime => }/rpc/rpc_host_port.cpp | 4 +- src/{runtime => }/rpc/rpc_host_port.h | 2 +- src/{runtime => }/rpc/rpc_message.cpp | 6 +- src/{runtime => }/rpc/rpc_message.h | 0 src/{runtime => }/rpc/rpc_stream.h | 2 +- src/{runtime => }/rpc/rpc_task.cpp | 2 +- src/{runtime => }/rpc/serialization.h | 6 +- src/rpc/test/CMakeLists.txt | 30 ++++ src/{runtime => rpc}/test/address_test.cpp | 4 +- src/rpc/test/config.ini | 125 ++++++++++++++++ .../test/corrupt_message_test.cpp} | 29 ++-- src/{runtime => rpc}/test/host_port_test.cpp | 14 +- src/rpc/test/main.cpp | 43 ++++++ .../test/message_reader_test.cpp | 2 +- .../test/message_utils_test.cpp | 10 +- .../test/net_provider_test.cpp} | 22 +-- src/{runtime => rpc}/test/rpc_holder_test.cpp | 14 +- .../test/rpc_message_test.cpp} | 14 +- .../test/rpc.cpp => rpc/test/rpc_test.cpp} | 20 +-- src/rpc/test/run.sh | 25 ++++ .../test/thrift_message_parser_test.cpp | 8 +- .../rpc/thrift_message_parser.cpp | 4 +- src/{runtime => }/rpc/thrift_message_parser.h | 2 +- src/runtime/CMakeLists.txt | 4 +- src/runtime/api_layer1.h | 4 +- src/runtime/fault_injector.cpp | 2 +- src/runtime/message_utils.cpp | 2 +- src/runtime/message_utils.h | 2 +- src/runtime/profiler.cpp | 2 +- src/runtime/providers.common.cpp | 10 +- src/runtime/rpc/CMakeLists.txt | 45 ------ src/runtime/serverlet.h | 4 +- src/runtime/service_api_c.cpp | 8 +- src/runtime/service_app.h | 3 +- src/runtime/service_engine.cpp | 4 +- src/runtime/task/async_calls.h | 2 +- src/runtime/task/task.h | 2 +- src/runtime/task/task_queue.cpp | 6 +- src/runtime/task/task_spec.cpp | 2 +- src/runtime/test/CMakeLists.txt | 1 - src/runtime/test/async_call.cpp | 4 +- .../test/config-test-corrupt-message.ini | 141 ------------------ src/runtime/test/dns_resolver_test.cpp | 10 +- src/runtime/test_utils.h | 14 +- src/runtime/tool_api.cpp | 2 +- src/runtime/tool_api.h | 4 +- src/runtime/tracer.cpp | 2 +- src/security/client_negotiation.cpp | 4 +- src/security/client_negotiation.h | 2 +- src/security/meta_access_controller.cpp | 4 +- src/security/negotiation.h | 6 +- src/security/negotiation_manager.cpp | 4 +- src/security/replica_access_controller.cpp | 4 +- src/security/server_negotiation.cpp | 4 +- src/security/server_negotiation.h | 2 +- src/security/test/client_negotiation_test.cpp | 8 +- .../test/meta_access_controller_test.cpp | 8 +- .../test/negotiation_manager_test.cpp | 10 +- .../test/replica_access_controller_test.cpp | 8 +- src/security/test/server_negotiation_test.cpp | 6 +- src/server/available_detector.h | 2 +- src/server/capacity_unit_calculator.cpp | 2 +- src/server/hotspot_partition_calculator.cpp | 4 +- src/server/hotspot_partition_calculator.h | 2 +- src/server/info_collector.cpp | 2 +- src/server/info_collector.h | 3 +- src/server/pegasus_mutation_duplicator.cpp | 4 +- src/server/pegasus_server_impl.cpp | 4 +- src/server/pegasus_server_impl_init.cpp | 2 +- src/server/pegasus_server_write.cpp | 6 +- .../test/capacity_unit_calculator_test.cpp | 2 +- src/server/test/hotkey_collector_test.cpp | 2 +- .../test/pegasus_mutation_duplicator_test.cpp | 4 +- src/server/test/pegasus_server_write_test.cpp | 2 +- .../test/pegasus_write_service_test.cpp | 2 +- src/shell/command_utils.cpp | 2 +- src/shell/commands/bulk_load.cpp | 2 +- src/shell/commands/data_operations.cpp | 2 +- src/shell/commands/debugger.cpp | 4 +- src/shell/commands/detect_hotkey.cpp | 2 +- src/shell/commands/node_management.cpp | 2 +- src/shell/commands/rebalance.cpp | 2 +- src/shell/commands/recovery.cpp | 2 +- src/shell/commands/table_management.cpp | 2 +- .../function_test/recovery/test_recovery.cpp | 2 +- src/test/function_test/utils/global_env.cpp | 2 +- src/test/function_test/utils/test_util.h | 2 +- src/test/kill_test/kill_testor.h | 2 +- src/tools/mutation_log_tool.cpp | 2 +- src/utils/distributed_lock_service.h | 6 +- src/utils/metrics.cpp | 6 +- src/utils/test/json_helper_test.cpp | 2 +- src/utils/test/metrics_test.cpp | 4 +- src/zookeeper/zookeeper_session.cpp | 2 +- 267 files changed, 914 insertions(+), 823 deletions(-) create mode 100644 src/rpc/CMakeLists.txt rename src/{runtime => }/rpc/asio_net_provider.cpp (99%) rename src/{runtime => }/rpc/asio_net_provider.h (96%) rename src/{runtime => }/rpc/asio_rpc_session.cpp (99%) rename src/{runtime => }/rpc/asio_rpc_session.h (97%) rename src/{runtime => }/rpc/dns_resolver.cpp (97%) rename src/{runtime => }/rpc/dns_resolver.h (97%) rename src/{runtime => }/rpc/dsn_message_parser.cpp (99%) rename src/{runtime => }/rpc/dsn_message_parser.h (98%) rename src/{runtime => }/rpc/group_address.h (99%) rename src/{runtime => }/rpc/group_host_port.h (98%) rename src/{runtime => }/rpc/message_parser.cpp (99%) rename src/{runtime => }/rpc/message_parser.h (99%) rename src/{runtime => }/rpc/message_parser_manager.h (98%) rename src/{runtime => }/rpc/network.cpp (99%) rename src/{runtime => }/rpc/network.h (99%) rename src/{runtime => }/rpc/network.sim.cpp (100%) rename src/{runtime => }/rpc/network.sim.h (94%) rename src/{runtime => }/rpc/raw_message_parser.cpp (98%) rename src/{runtime => }/rpc/raw_message_parser.h (98%) rename src/{runtime => }/rpc/request_meta.thrift (100%) rename src/{runtime => }/rpc/rpc_address.cpp (99%) rename src/{runtime => }/rpc/rpc_address.h (100%) rename src/{runtime => }/rpc/rpc_engine.cpp (99%) rename src/{runtime => }/rpc/rpc_engine.h (98%) rename src/{runtime => }/rpc/rpc_holder.h (99%) rename src/{runtime => }/rpc/rpc_host_port.cpp (98%) rename src/{runtime => }/rpc/rpc_host_port.h (99%) rename src/{runtime => }/rpc/rpc_message.cpp (99%) rename src/{runtime => }/rpc/rpc_message.h (100%) rename src/{runtime => }/rpc/rpc_stream.h (99%) rename src/{runtime => }/rpc/rpc_task.cpp (99%) rename src/{runtime => }/rpc/serialization.h (97%) create mode 100644 src/rpc/test/CMakeLists.txt rename src/{runtime => rpc}/test/address_test.cpp (99%) create mode 100644 src/rpc/test/config.ini rename src/{runtime/test/corrupt_message.cpp => rpc/test/corrupt_message_test.cpp} (70%) rename src/{runtime => rpc}/test/host_port_test.cpp (98%) create mode 100644 src/rpc/test/main.cpp rename src/{runtime => rpc}/test/message_reader_test.cpp (98%) rename src/{runtime => rpc}/test/message_utils_test.cpp (92%) rename src/{runtime/test/netprovider.cpp => rpc/test/net_provider_test.cpp} (95%) rename src/{runtime => rpc}/test/rpc_holder_test.cpp (95%) rename src/{runtime/test/rpc_message.cpp => rpc/test/rpc_message_test.cpp} (96%) rename src/{runtime/test/rpc.cpp => rpc/test/rpc_test.cpp} (96%) create mode 100755 src/rpc/test/run.sh rename src/{runtime => rpc}/test/thrift_message_parser_test.cpp (99%) rename src/{runtime => }/rpc/thrift_message_parser.cpp (99%) rename src/{runtime => }/rpc/thrift_message_parser.h (99%) delete mode 100644 src/runtime/rpc/CMakeLists.txt delete mode 100644 src/runtime/test/config-test-corrupt-message.ini diff --git a/.github/workflows/lint_and_test_cpp.yaml b/.github/workflows/lint_and_test_cpp.yaml index 1ae74b268f..2c025c1f46 100644 --- a/.github/workflows/lint_and_test_cpp.yaml +++ b/.github/workflows/lint_and_test_cpp.yaml @@ -83,7 +83,6 @@ jobs: name: IWYU needs: - cpp_clang_format_linter - - cpp_clang_tidy_linter runs-on: ubuntu-latest env: USE_JEMALLOC: OFF @@ -113,7 +112,6 @@ jobs: name: Build Release needs: - cpp_clang_format_linter - - cpp_clang_tidy_linter runs-on: ubuntu-latest env: USE_JEMALLOC: OFF @@ -162,6 +160,7 @@ jobs: - dsn_replica_bulk_load_test - dsn_replica_dup_test - dsn_replica_split_test + - dsn_rpc_tests - dsn.replica.test - dsn_replication_common_test - dsn.replication.simple_kv @@ -198,7 +197,6 @@ jobs: name: Build ASAN needs: - cpp_clang_format_linter - - cpp_clang_tidy_linter runs-on: ubuntu-latest env: USE_JEMALLOC: OFF @@ -246,6 +244,7 @@ jobs: - dsn_replica_bulk_load_test - dsn_replica_dup_test - dsn_replica_split_test + - dsn_rpc_tests - dsn.replica.test - dsn_replication_common_test - dsn.replication.simple_kv @@ -287,7 +286,6 @@ jobs: # name: Build UBSAN # needs: # - cpp_clang_format_linter -# - cpp_clang_tidy_linter # runs-on: ubuntu-latest # env: # USE_JEMALLOC: OFF @@ -335,6 +333,7 @@ jobs: # - dsn_replica_bulk_load_test # - dsn_replica_dup_test # - dsn_replica_split_test +# - dsn_rpc_tests # - dsn.replica.test # - dsn_replication_common_test # - dsn.replication.simple_kv @@ -369,7 +368,6 @@ jobs: name: Build with jemalloc needs: - cpp_clang_format_linter - - cpp_clang_tidy_linter runs-on: ubuntu-latest env: USE_JEMALLOC: ON @@ -412,7 +410,6 @@ jobs: name: Build Release on macOS needs: - cpp_clang_format_linter - - cpp_clang_tidy_linter runs-on: macos-12 steps: - name: Install Softwares @@ -448,7 +445,6 @@ jobs: name: Build Debug on CentOS 7 needs: - cpp_clang_format_linter - - cpp_clang_tidy_linter runs-on: ubuntu-latest env: USE_JEMALLOC: OFF diff --git a/.licenserc.yaml b/.licenserc.yaml index d1ee6798d5..2682d26d98 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -126,8 +126,6 @@ header: - 'src/utils/api_utilities.h' - 'src/runtime/app_model.h' - 'src/common/json_helper.h' - - 'src/runtime/rpc/rpc_stream.h' - - 'src/runtime/rpc/serialization.h' - 'src/common/serialization_helper/dsn_types.h' - 'src/common/serialization_helper/thrift_helper.h' - 'src/runtime/serverlet.h' @@ -163,13 +161,7 @@ header: - 'src/runtime/task/future_types.h' - 'src/runtime/global_config.h' - 'src/common/gpid.h' - - 'src/runtime/rpc/group_address.h' - 'src/utils/logging_provider.h' - - 'src/runtime/rpc/message_parser.h' - - 'src/runtime/rpc/network.h' - - 'src/runtime/rpc/rpc_address.cpp' - - 'src/runtime/rpc/rpc_address.h' - - 'src/runtime/rpc/rpc_message.h' - 'src/runtime/task/task.h' - 'src/runtime/task/task_code.h' - 'src/runtime/task/task_queue.h' @@ -533,26 +525,6 @@ header: - 'src/runtime/profiler.cpp' - 'src/runtime/profiler_header.h' - 'src/runtime/providers.common.cpp' - - 'src/runtime/rpc/CMakeLists.txt' - - 'src/runtime/rpc/asio_net_provider.cpp' - - 'src/runtime/rpc/asio_net_provider.h' - - 'src/runtime/rpc/asio_rpc_session.cpp' - - 'src/runtime/rpc/asio_rpc_session.h' - - 'src/runtime/rpc/dsn_message_parser.cpp' - - 'src/runtime/rpc/dsn_message_parser.h' - - 'src/runtime/rpc/message_parser.cpp' - - 'src/runtime/rpc/message_parser_manager.h' - - 'src/runtime/rpc/network.cpp' - - 'src/runtime/rpc/network.sim.cpp' - - 'src/runtime/rpc/network.sim.h' - - 'src/runtime/rpc/raw_message_parser.cpp' - - 'src/runtime/rpc/raw_message_parser.h' - - 'src/runtime/rpc/rpc_engine.cpp' - - 'src/runtime/rpc/rpc_engine.h' - - 'src/runtime/rpc/rpc_message.cpp' - - 'src/runtime/rpc/rpc_task.cpp' - - 'src/runtime/rpc/thrift_message_parser.cpp' - - 'src/runtime/rpc/thrift_message_parser.h' - 'src/runtime/scheduler.cpp' - 'src/runtime/scheduler.h' - 'src/runtime/service_api_c.cpp' @@ -575,21 +547,49 @@ header: - 'src/runtime/task/task_tracker.cpp' - 'src/runtime/task/task_worker.cpp' - 'src/runtime/test/CMakeLists.txt' - - 'src/runtime/test/address_test.cpp' - 'src/runtime/test/async_call.cpp' - 'src/runtime/test/clear.sh' - - 'src/runtime/test/config-test-corrupt-message.ini' - 'src/runtime/test/config-test-sim.ini' - 'src/runtime/test/config-test.ini' - - 'src/runtime/test/corrupt_message.cpp' - 'src/runtime/test/lpc.cpp' - 'src/runtime/test/main.cpp' - - 'src/runtime/test/message_utils_test.cpp' - - 'src/runtime/test/netprovider.cpp' - 'src/runtime/test/pipeline_test.cpp' - - 'src/runtime/test/rpc.cpp' - - 'src/runtime/test/rpc_holder_test.cpp' - - 'src/runtime/test/rpc_message.cpp' + - 'src/rpc/CMakeLists.txt' + - 'src/rpc/asio_net_provider.cpp' + - 'src/rpc/asio_net_provider.h' + - 'src/rpc/asio_rpc_session.cpp' + - 'src/rpc/asio_rpc_session.h' + - 'src/rpc/dsn_message_parser.cpp' + - 'src/rpc/dsn_message_parser.h' + - 'src/rpc/group_address.h' + - 'src/rpc/message_parser.cpp' + - 'src/rpc/message_parser.h' + - 'src/rpc/message_parser_manager.h' + - 'src/rpc/network.cpp' + - 'src/rpc/network.h' + - 'src/rpc/network.sim.cpp' + - 'src/rpc/network.sim.h' + - 'src/rpc/raw_message_parser.cpp' + - 'src/rpc/raw_message_parser.h' + - 'src/rpc/rpc_address.cpp' + - 'src/rpc/rpc_address.h' + - 'src/rpc/rpc_engine.cpp' + - 'src/rpc/rpc_engine.h' + - 'src/rpc/rpc_message.cpp' + - 'src/rpc/rpc_message.h' + - 'src/rpc/rpc_stream.h' + - 'src/rpc/rpc_task.cpp' + - 'src/rpc/serialization.h' + - 'src/rpc/thrift_message_parser.cpp' + - 'src/rpc/thrift_message_parser.h' + - 'src/rpc/test/address_test.cpp' + - 'src/rpc/test/corrupt_message_test.cpp' + - 'src/rpc/test/host_port_test.cpp' + - 'src/rpc/test/message_utils_test.cpp' + - 'src/rpc/test/net_provider_test.cpp' + - 'src/rpc/test/rpc_holder_test.cpp' + - 'src/rpc/test/rpc_message_test.cpp' + - 'src/rpc/test/rpc_test.cpp' - 'src/runtime/test/run.sh' - 'src/runtime/test/service_api_c.cpp' - 'src/runtime/test/sim_lock.cpp' diff --git a/build_tools/compile_thrift.py b/build_tools/compile_thrift.py index 9fb949a3a6..db7a1c7618 100755 --- a/build_tools/compile_thrift.py +++ b/build_tools/compile_thrift.py @@ -39,7 +39,7 @@ "path": "idl", "include_fix": { "_types.h": { - "add": ["\"runtime/rpc/serialization.h\""], + "add": ["\"rpc/serialization.h\""], "remove": ["dsn_types.h"] }, "_types.cpp": { diff --git a/build_tools/recompile_thrift.sh b/build_tools/recompile_thrift.sh index 72135f8aa9..c8680adb3f 100755 --- a/build_tools/recompile_thrift.sh +++ b/build_tools/recompile_thrift.sh @@ -29,7 +29,7 @@ rm -rf $TMP_DIR mkdir -p $TMP_DIR $THIRDPARTY_ROOT/output/bin/thrift --gen cpp:moveable_types -out $TMP_DIR ../idl/rrdb.thrift -sed 's/#include "dsn_types.h"/#include "runtime\/rpc\/rpc_address.h"\n#include "runtime\/rpc\/rpc_host_port.h"\n#include "runtime\/task\/task_code.h"\n#include "utils\/blob.h"/' $TMP_DIR/rrdb_types.h > ../src/include/rrdb/rrdb_types.h +sed 's/#include "dsn_types.h"/#include "rpc\/rpc_address.h"\n#include "rpc\/rpc_host_port.h"\n#include "runtime\/task\/task_code.h"\n#include "utils\/blob.h"/' $TMP_DIR/rrdb_types.h > ../src/include/rrdb/rrdb_types.h sed 's/#include "rrdb_types.h"/#include /' $TMP_DIR/rrdb_types.cpp > ../src/base/rrdb_types.cpp rm -rf $TMP_DIR diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0bd9f65395..af3f68e495 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -50,6 +50,7 @@ add_subdirectory(ranger) add_subdirectory(redis_protocol) add_subdirectory(remote_cmd) add_subdirectory(replica) +add_subdirectory(rpc) add_subdirectory(runtime) add_subdirectory(sample) add_subdirectory(security) diff --git a/src/base/pegasus_rpc_types.h b/src/base/pegasus_rpc_types.h index 8a680d5b6f..5a34524447 100644 --- a/src/base/pegasus_rpc_types.h +++ b/src/base/pegasus_rpc_types.h @@ -17,7 +17,7 @@ * under the License. */ -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_holder.h" #include "meta_admin_types.h" #include "partition_split_types.h" #include "duplication_types.h" diff --git a/src/block_service/block_service.h b/src/block_service/block_service.h index 6c235ae50e..47ad763ff0 100644 --- a/src/block_service/block_service.h +++ b/src/block_service/block_service.h @@ -29,11 +29,11 @@ #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 "rpc/serialization.h" +#include "rpc/rpc_stream.h" #include "runtime/serverlet.h" #include "runtime/service_app.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" #include "common/replication_other_types.h" #include "common/replication.codes.h" #include diff --git a/src/client/partition_resolver.cpp b/src/client/partition_resolver.cpp index 7cc5b00e9c..2c6e8e9f1e 100644 --- a/src/client/partition_resolver.cpp +++ b/src/client/partition_resolver.cpp @@ -31,7 +31,7 @@ #include "partition_resolver_manager.h" #include "runtime/api_layer1.h" #include "runtime/api_task.h" -#include "runtime/rpc/dns_resolver.h" +#include "rpc/dns_resolver.h" #include "runtime/task/task_spec.h" #include "utils/fmt_logging.h" #include "utils/threadpool_code.h" diff --git a/src/client/partition_resolver.h b/src/client/partition_resolver.h index d4105a26bc..36f23bf36f 100644 --- a/src/client/partition_resolver.h +++ b/src/client/partition_resolver.h @@ -34,9 +34,9 @@ #include #include "common/gpid.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" diff --git a/src/client/partition_resolver_manager.cpp b/src/client/partition_resolver_manager.cpp index 0ec0a7aa32..9fccb30456 100644 --- a/src/client/partition_resolver_manager.cpp +++ b/src/client/partition_resolver_manager.cpp @@ -29,8 +29,8 @@ #include "client/partition_resolver.h" #include "partition_resolver_manager.h" #include "partition_resolver_simple.h" -#include "runtime/rpc/group_host_port.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/group_host_port.h" +#include "rpc/rpc_host_port.h" #include "utils/autoref_ptr.h" #include "utils/fmt_logging.h" #include "utils/utils.h" diff --git a/src/client/partition_resolver_simple.cpp b/src/client/partition_resolver_simple.cpp index 08d98790fb..5fed493ea6 100644 --- a/src/client/partition_resolver_simple.cpp +++ b/src/client/partition_resolver_simple.cpp @@ -34,10 +34,10 @@ #include "common/gpid.h" #include "dsn.layer2_types.h" #include "partition_resolver_simple.h" +#include "rpc/dns_resolver.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task_code.h" #include "runtime/task/task_spec.h" diff --git a/src/client/partition_resolver_simple.h b/src/client/partition_resolver_simple.h index 5dc203ae34..cd68bc35ab 100644 --- a/src/client/partition_resolver_simple.h +++ b/src/client/partition_resolver_simple.h @@ -34,7 +34,7 @@ #include "client/partition_resolver.h" #include "common/serialization_helper/dsn.layer2_types.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "runtime/task/task.h" #include "runtime/task/task_tracker.h" #include "utils/autoref_ptr.h" diff --git a/src/client/replication_ddl_client.cpp b/src/client/replication_ddl_client.cpp index 27bfb2df0a..3a0fc3a9c5 100644 --- a/src/client/replication_ddl_client.cpp +++ b/src/client/replication_ddl_client.cpp @@ -49,9 +49,9 @@ #include "fmt/core.h" #include "fmt/format.h" #include "meta/meta_rpc_types.h" +#include "rpc/group_host_port.h" +#include "rpc/rpc_address.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/group_host_port.h" -#include "runtime/rpc/rpc_address.h" #include "utils/error_code.h" #include "utils/fmt_logging.h" #include "utils/output_utils.h" diff --git a/src/client/replication_ddl_client.h b/src/client/replication_ddl_client.h index 274605bb34..258066495a 100644 --- a/src/client/replication_ddl_client.h +++ b/src/client/replication_ddl_client.h @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -43,11 +44,11 @@ #include "meta_admin_types.h" #include "partition_split_types.h" #include "replica_admin_types.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/dns_resolver.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" @@ -59,7 +60,6 @@ #include "utils/flags.h" #include "utils/fmt_logging.h" #include "utils/ports.h" -#include DSN_DECLARE_uint32(ddl_client_max_attempt_count); DSN_DECLARE_uint32(ddl_client_retry_interval_ms); diff --git a/src/client/test/ddl_client_test.cpp b/src/client/test/ddl_client_test.cpp index f44a0382b0..3710f3953d 100644 --- a/src/client/test/ddl_client_test.cpp +++ b/src/client/test/ddl_client_test.cpp @@ -26,8 +26,8 @@ #include "common/replication.codes.h" #include "gtest/gtest.h" #include "meta_admin_types.h" +#include "rpc/rpc_host_port.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_host_port.h" #include "runtime/task/task.h" #include "utils/autoref_ptr.h" #include "utils/error_code.h" diff --git a/src/client_lib/pegasus_client_impl.cpp b/src/client_lib/pegasus_client_impl.cpp index 4ab09425bb..6929b99a4e 100644 --- a/src/client_lib/pegasus_client_impl.cpp +++ b/src/client_lib/pegasus_client_impl.cpp @@ -23,10 +23,10 @@ #include #include #include +#include #include #include -#include #include "common/common.h" #include "common/replication_other_types.h" #include "common/serialization_helper/dsn.layer2_types.h" @@ -34,10 +34,10 @@ #include "pegasus_client_impl.h" #include "pegasus_key_schema.h" #include "pegasus_utils.h" +#include "rpc/dns_resolver.h" +#include "rpc/group_host_port.h" +#include "rpc/serialization.h" #include "rrdb/rrdb.client.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/group_host_port.h" -#include "runtime/rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task_code.h" #include "utils/error_code.h" diff --git a/src/client_lib/pegasus_client_impl.h b/src/client_lib/pegasus_client_impl.h index 689fe74925..798e3464d9 100644 --- a/src/client_lib/pegasus_client_impl.h +++ b/src/client_lib/pegasus_client_impl.h @@ -31,8 +31,8 @@ #include #include +#include "rpc/rpc_host_port.h" #include "rrdb/rrdb_types.h" -#include "runtime/rpc/rpc_host_port.h" #include "utils/blob.h" #include "utils/zlocks.h" diff --git a/src/client_lib/pegasus_scanner_impl.cpp b/src/client_lib/pegasus_scanner_impl.cpp index a6eb731ccc..e9715c27bc 100644 --- a/src/client_lib/pegasus_scanner_impl.cpp +++ b/src/client_lib/pegasus_scanner_impl.cpp @@ -34,7 +34,7 @@ #include "pegasus_key_schema.h" #include "rrdb/rrdb.client.h" #include "rrdb/rrdb_types.h" -#include "runtime/rpc/serialization.h" +#include "rpc/serialization.h" #include "utils/blob.h" #include "utils/error_code.h" #include "utils/fmt_logging.h" diff --git a/src/common/backup_common.cpp b/src/common/backup_common.cpp index 23575787cf..ecc2278e62 100644 --- a/src/common/backup_common.cpp +++ b/src/common/backup_common.cpp @@ -19,8 +19,8 @@ #include "common/gpid.h" #include "fmt/core.h" +#include "rpc/rpc_host_port.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_host_port.h" namespace dsn { namespace replication { diff --git a/src/common/backup_common.h b/src/common/backup_common.h index 96e11717e8..60318bee47 100644 --- a/src/common/backup_common.h +++ b/src/common/backup_common.h @@ -20,7 +20,7 @@ #include #include -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_holder.h" namespace dsn { class gpid; diff --git a/src/common/bulk_load_common.h b/src/common/bulk_load_common.h index 4a45869722..5e5ed9bf50 100644 --- a/src/common/bulk_load_common.h +++ b/src/common/bulk_load_common.h @@ -20,7 +20,7 @@ #include #include -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_holder.h" namespace dsn { namespace replication { diff --git a/src/common/duplication_common.h b/src/common/duplication_common.h index fe0ec067b4..8613357338 100644 --- a/src/common/duplication_common.h +++ b/src/common/duplication_common.h @@ -24,7 +24,7 @@ #include #include "duplication_types.h" -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_holder.h" #include "utils/errors.h" #include "utils/flags.h" #include "utils/fmt_utils.h" diff --git a/src/common/manual_compact.h b/src/common/manual_compact.h index c6e7ae3b67..38aa57f9de 100644 --- a/src/common/manual_compact.h +++ b/src/common/manual_compact.h @@ -18,7 +18,7 @@ #pragma once #include "meta_admin_types.h" -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_holder.h" namespace dsn { namespace replication { diff --git a/src/common/partition_split_common.h b/src/common/partition_split_common.h index e9cc376c9b..749f031839 100644 --- a/src/common/partition_split_common.h +++ b/src/common/partition_split_common.h @@ -18,7 +18,7 @@ #pragma once #include "partition_split_types.h" -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_holder.h" namespace dsn { namespace replication { diff --git a/src/common/replication_common.cpp b/src/common/replication_common.cpp index e34bcb5838..7e18163cd5 100644 --- a/src/common/replication_common.cpp +++ b/src/common/replication_common.cpp @@ -34,8 +34,8 @@ #include "common/replication_other_types.h" #include "dsn.layer2_types.h" #include "fmt/core.h" -#include "runtime/rpc/dns_resolver.h" // IWYU pragma: keep -#include "runtime/rpc/rpc_address.h" +#include "rpc/dns_resolver.h" // IWYU pragma: keep +#include "rpc/rpc_address.h" #include "runtime/service_app.h" #include "utils/config_api.h" #include "utils/filesystem.h" diff --git a/src/common/replication_common.h b/src/common/replication_common.h index 9d88b9d96a..23e22cf1fb 100644 --- a/src/common/replication_common.h +++ b/src/common/replication_common.h @@ -32,20 +32,21 @@ #include #include "metadata_types.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_host_port.h" #include "runtime/task/task.h" namespace dsn { namespace replication { class configuration_update_app_env_request; class configuration_update_app_env_response; + class query_app_info_request; class query_app_info_response; class query_replica_info_request; class query_replica_info_response; - typedef std::unordered_map<::dsn::host_port, partition_status::type> node_statuses; + typedef std::unordered_map<::dsn::host_port, dsn::task_ptr> node_tasks; typedef rpc_holder diff --git a/src/common/replication_other_types.h b/src/common/replication_other_types.h index ea194a82af..e23164a187 100644 --- a/src/common/replication_other_types.h +++ b/src/common/replication_other_types.h @@ -36,8 +36,8 @@ #include "consensus_types.h" #include "replica_admin_types.h" #include "common/replication_enums.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" namespace dsn { namespace replication { diff --git a/src/common/serialization_helper/dsn_types.h b/src/common/serialization_helper/dsn_types.h index 2224bd1507..0e37c4ee5a 100644 --- a/src/common/serialization_helper/dsn_types.h +++ b/src/common/serialization_helper/dsn_types.h @@ -26,4 +26,4 @@ #pragma once -#include "runtime/rpc/serialization.h" +#include "rpc/serialization.h" diff --git a/src/common/serialization_helper/thrift_helper.h b/src/common/serialization_helper/thrift_helper.h index 54737a30b6..8f6c324e0a 100644 --- a/src/common/serialization_helper/thrift_helper.h +++ b/src/common/serialization_helper/thrift_helper.h @@ -26,8 +26,8 @@ #pragma once -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_stream.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_stream.h" #include #include diff --git a/src/common/storage_serverlet.h b/src/common/storage_serverlet.h index ee1ef3bee2..41c58e194a 100644 --- a/src/common/storage_serverlet.h +++ b/src/common/storage_serverlet.h @@ -40,11 +40,11 @@ #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 "rpc/serialization.h" +#include "rpc/rpc_stream.h" #include "runtime/serverlet.h" #include "runtime/service_app.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" namespace dsn { namespace replication { diff --git a/src/failure_detector/failure_detector.cpp b/src/failure_detector/failure_detector.cpp index b3d1378ebd..4deba63e4b 100644 --- a/src/failure_detector/failure_detector.cpp +++ b/src/failure_detector/failure_detector.cpp @@ -41,8 +41,8 @@ #include "fmt/format.h" #include "nlohmann/json_fwd.hpp" #include "runtime/api_layer1.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/dns_resolver.h" +#include "rpc/rpc_address.h" #include "runtime/serverlet.h" #include "runtime/task/async_calls.h" #include "runtime/task/task_spec.h" diff --git a/src/failure_detector/failure_detector.h b/src/failure_detector/failure_detector.h index 51fa5bf544..3924bd7f55 100644 --- a/src/failure_detector/failure_detector.h +++ b/src/failure_detector/failure_detector.h @@ -35,7 +35,7 @@ #include "failure_detector/fd.client.h" #include "failure_detector/fd.server.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" #include "runtime/task/task_tracker.h" @@ -46,6 +46,7 @@ namespace dsn { class command_deregister; + template class rpc_replier; diff --git a/src/failure_detector/failure_detector_multimaster.cpp b/src/failure_detector/failure_detector_multimaster.cpp index 03af27402f..a95b026191 100644 --- a/src/failure_detector/failure_detector_multimaster.cpp +++ b/src/failure_detector/failure_detector_multimaster.cpp @@ -29,8 +29,8 @@ #include "failure_detector/failure_detector_multimaster.h" #include "fd_types.h" -#include "runtime/rpc/dns_resolver.h" // IWYU pragma: keep -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/dns_resolver.h" // IWYU pragma: keep +#include "rpc/rpc_host_port.h" #include "utils/error_code.h" #include "utils/rand.h" diff --git a/src/failure_detector/failure_detector_multimaster.h b/src/failure_detector/failure_detector_multimaster.h index 3f352c2b03..3b8664151c 100644 --- a/src/failure_detector/failure_detector_multimaster.h +++ b/src/failure_detector/failure_detector_multimaster.h @@ -31,8 +31,8 @@ #include #include "failure_detector/failure_detector.h" -#include "runtime/rpc/group_host_port.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/group_host_port.h" +#include "rpc/rpc_host_port.h" #include "utils/fmt_logging.h" #include "utils/zlocks.h" @@ -40,6 +40,7 @@ namespace dsn { class error_code; namespace fd { + class beacon_ack; } // namespace fd diff --git a/src/failure_detector/fd.code.definition.h b/src/failure_detector/fd.code.definition.h index 1f8934aaee..4568c10866 100644 --- a/src/failure_detector/fd.code.definition.h +++ b/src/failure_detector/fd.code.definition.h @@ -35,11 +35,11 @@ #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 "rpc/serialization.h" +#include "rpc/rpc_stream.h" #include "runtime/serverlet.h" #include "runtime/service_app.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" #include "fd_types.h" namespace dsn { diff --git a/src/failure_detector/test/failure_detector.cpp b/src/failure_detector/test/failure_detector.cpp index 81e1fdf3cd..f882903fb8 100644 --- a/src/failure_detector/test/failure_detector.cpp +++ b/src/failure_detector/test/failure_detector.cpp @@ -47,12 +47,12 @@ #include "meta/meta_options.h" #include "meta/meta_server_failure_detector.h" #include "replica/replica_stub.h" +#include "rpc/group_host_port.h" +#include "rpc/network.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/group_host_port.h" -#include "runtime/rpc/network.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" #include "runtime/serverlet.h" #include "runtime/service_app.h" #include "runtime/task/async_calls.h" diff --git a/src/geo/test/geo_test.cpp b/src/geo/test/geo_test.cpp index e66a251d0d..c99628aae1 100644 --- a/src/geo/test/geo_test.cpp +++ b/src/geo/test/geo_test.cpp @@ -40,7 +40,7 @@ #include "geo/lib/geo_client.h" #include "gtest/gtest.h" #include "pegasus/client.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "utils/blob.h" #include "utils/error_code.h" #include "utils/flags.h" diff --git a/src/http/http_message_parser.cpp b/src/http/http_message_parser.cpp index df873eea2e..6a5fa83cf8 100644 --- a/src/http/http_message_parser.cpp +++ b/src/http/http_message_parser.cpp @@ -34,7 +34,7 @@ #include "http/http_method.h" #include "nodejs/http_parser.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "utils/blob.h" #include "utils/crc.h" #include "utils/fmt_logging.h" diff --git a/src/http/http_message_parser.h b/src/http/http_message_parser.h index 5f19576798..db54102b15 100644 --- a/src/http/http_message_parser.h +++ b/src/http/http_message_parser.h @@ -32,8 +32,8 @@ #include #include -#include "runtime/rpc/message_parser.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/message_parser.h" +#include "rpc/rpc_message.h" #include "runtime/task/task_spec.h" #include "utils/customizable_id.h" diff --git a/src/http/http_server.cpp b/src/http/http_server.cpp index d5575f580e..2a40da4ceb 100644 --- a/src/http/http_server.cpp +++ b/src/http/http_server.cpp @@ -33,8 +33,8 @@ #include "http/uri_decoder.h" #include "nodejs/http_parser.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/rpc_stream.h" +#include "rpc/rpc_message.h" +#include "rpc/rpc_stream.h" #include "runtime/serverlet.h" #include "runtime/tool_api.h" #include "utils/error_code.h" diff --git a/src/http/http_server_impl.h b/src/http/http_server_impl.h index f78226a1cd..27166b941c 100644 --- a/src/http/http_server_impl.h +++ b/src/http/http_server_impl.h @@ -17,7 +17,7 @@ #pragma once -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "runtime/serverlet.h" #include "http_server.h" diff --git a/src/http/test/http_server_test.cpp b/src/http/test/http_server_test.cpp index dc7f0bce79..54efa14a26 100644 --- a/src/http/test/http_server_test.cpp +++ b/src/http/test/http_server_test.cpp @@ -30,8 +30,8 @@ #include "http/http_method.h" #include "http/http_server.h" #include "http/http_status_code.h" -#include "runtime/rpc/message_parser.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/message_parser.h" +#include "rpc/rpc_message.h" #include "utils/autoref_ptr.h" #include "utils/blob.h" #include "utils/error_code.h" diff --git a/src/include/rrdb/rrdb.client.h b/src/include/rrdb/rrdb.client.h index 4645e781f4..28d18adc7e 100644 --- a/src/include/rrdb/rrdb.client.h +++ b/src/include/rrdb/rrdb.client.h @@ -25,7 +25,7 @@ #include "duplication_internal_types.h" #include "rrdb.code.definition.h" #include "rrdb_types.h" -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_holder.h" #include "runtime/task/task_tracker.h" #include "utils/optional.h" diff --git a/src/meta/backup_engine.cpp b/src/meta/backup_engine.cpp index 5183415369..068cbd2e0a 100644 --- a/src/meta/backup_engine.cpp +++ b/src/meta/backup_engine.cpp @@ -35,10 +35,10 @@ #include "meta/meta_backup_service.h" #include "meta/meta_data.h" #include "meta/meta_service.h" +#include "rpc/dns_resolver.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_host_port.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_host_port.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" diff --git a/src/meta/cluster_balance_policy.cpp b/src/meta/cluster_balance_policy.cpp index 8415803af9..73cc448a6b 100644 --- a/src/meta/cluster_balance_policy.cpp +++ b/src/meta/cluster_balance_policy.cpp @@ -27,9 +27,9 @@ #include "dsn.layer2_types.h" #include "gutil/map_util.h" #include "meta/load_balance_policy.h" -#include "runtime/rpc/dns_resolver.h" // IWYU pragma: keep -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/dns_resolver.h" // IWYU pragma: keep +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "utils/flags.h" #include "utils/fmt_logging.h" #include "utils/utils.h" diff --git a/src/meta/cluster_balance_policy.h b/src/meta/cluster_balance_policy.h index c7189fd359..94fb013ecd 100644 --- a/src/meta/cluster_balance_policy.h +++ b/src/meta/cluster_balance_policy.h @@ -32,7 +32,7 @@ #include "load_balance_policy.h" #include "meta/meta_data.h" #include "metadata_types.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" namespace dsn { namespace replication { @@ -54,6 +54,7 @@ class cluster_balance_policy : public load_balance_policy private: struct app_disk_info; + struct app_migration_info; struct cluster_migration_info; struct move_info; diff --git a/src/meta/dump_file.h b/src/meta/dump_file.h index 062ffd1fcc..650956644e 100644 --- a/src/meta/dump_file.h +++ b/src/meta/dump_file.h @@ -39,12 +39,12 @@ #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 "rpc/serialization.h" +#include "rpc/rpc_stream.h" #include "runtime/serverlet.h" #include "runtime/service_app.h" #include "utils/fmt_logging.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" #include "utils/crc.h" #include #include diff --git a/src/meta/duplication/duplication_info.h b/src/meta/duplication/duplication_info.h index 848c602eb1..e1ddcacf38 100644 --- a/src/meta/duplication/duplication_info.h +++ b/src/meta/duplication/duplication_info.h @@ -31,7 +31,7 @@ #include "common/json_helper.h" #include "common/replication_other_types.h" #include "duplication_types.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "utils/blob.h" #include "utils/error_code.h" #include "utils/fmt_logging.h" @@ -42,6 +42,7 @@ namespace dsn { namespace replication { class app_state; + class duplication_info; using duplication_info_s_ptr = std::shared_ptr; diff --git a/src/meta/duplication/meta_duplication_service.cpp b/src/meta/duplication/meta_duplication_service.cpp index 76472a04d8..795c81897d 100644 --- a/src/meta/duplication/meta_duplication_service.cpp +++ b/src/meta/duplication/meta_duplication_service.cpp @@ -39,13 +39,13 @@ #include "meta_admin_types.h" #include "meta_duplication_service.h" #include "metadata_types.h" +#include "rpc/dns_resolver.h" +#include "rpc/group_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/group_host_port.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" #include "runtime/task/async_calls.h" #include "utils/api_utilities.h" #include "utils/blob.h" diff --git a/src/meta/greedy_load_balancer.cpp b/src/meta/greedy_load_balancer.cpp index 81d7482bd9..0b3017eda3 100644 --- a/src/meta/greedy_load_balancer.cpp +++ b/src/meta/greedy_load_balancer.cpp @@ -46,7 +46,7 @@ #include "meta/table_metrics.h" #include "meta_admin_types.h" #include "meta_data.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "utils/command_manager.h" #include "utils/flags.h" #include "utils/fmt_logging.h" diff --git a/src/meta/load_balance_policy.cpp b/src/meta/load_balance_policy.cpp index 1278b35f98..f35fd5132d 100644 --- a/src/meta/load_balance_policy.cpp +++ b/src/meta/load_balance_policy.cpp @@ -33,8 +33,8 @@ #include "dsn.layer2_types.h" #include "meta/meta_data.h" #include "meta_admin_types.h" -#include "runtime/rpc/dns_resolver.h" // IWYU pragma: keep -#include "runtime/rpc/rpc_address.h" +#include "rpc/dns_resolver.h" // IWYU pragma: keep +#include "rpc/rpc_address.h" #include "utils/command_manager.h" #include "utils/fail_point.h" #include "utils/flags.h" diff --git a/src/meta/load_balance_policy.h b/src/meta/load_balance_policy.h index 486b0d2e69..30c0f41cdb 100644 --- a/src/meta/load_balance_policy.h +++ b/src/meta/load_balance_policy.h @@ -34,12 +34,13 @@ #include "common/replication_other_types.h" #include "meta_admin_types.h" #include "meta_data.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "utils/enum_helper.h" #include "utils/zlocks.h" namespace dsn { class command_deregister; + class partition_configuration; namespace replication { diff --git a/src/meta/meta_backup_service.cpp b/src/meta/meta_backup_service.cpp index 2bfa64ede7..8b630d1bef 100644 --- a/src/meta/meta_backup_service.cpp +++ b/src/meta/meta_backup_service.cpp @@ -38,11 +38,11 @@ #include "meta/meta_state_service.h" #include "meta_backup_service.h" #include "meta_service.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task_code.h" #include "security/access_controller.h" diff --git a/src/meta/meta_bulk_load_ingestion_context.h b/src/meta/meta_bulk_load_ingestion_context.h index d791b2a351..0e02d33317 100644 --- a/src/meta/meta_bulk_load_ingestion_context.h +++ b/src/meta/meta_bulk_load_ingestion_context.h @@ -22,7 +22,7 @@ #include #include "common/gpid.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "utils/flags.h" DSN_DECLARE_uint32(bulk_load_node_max_ingesting_count); diff --git a/src/meta/meta_bulk_load_service.cpp b/src/meta/meta_bulk_load_service.cpp index 198fb003e7..fcaa68860a 100644 --- a/src/meta/meta_bulk_load_service.cpp +++ b/src/meta/meta_bulk_load_service.cpp @@ -24,9 +24,9 @@ #include #include #include +#include #include -#include #include "block_service/block_service.h" #include "block_service/block_service_manager.h" #include "common/replica_envs.h" @@ -39,11 +39,11 @@ #include "meta/meta_state_service.h" #include "meta/server_state.h" #include "meta_admin_types.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/dns_resolver.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" diff --git a/src/meta/meta_bulk_load_service.h b/src/meta/meta_bulk_load_service.h index 50245d9d60..dfe1c94725 100644 --- a/src/meta/meta_bulk_load_service.h +++ b/src/meta/meta_bulk_load_service.h @@ -35,7 +35,7 @@ #include "common/replication_other_types.h" #include "meta/meta_state_service_utils.h" #include "meta_bulk_load_ingestion_context.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "runtime/task/task_tracker.h" #include "server_state.h" #include "utils/error_code.h" @@ -50,6 +50,7 @@ class partition_configuration; namespace replication { class app_state; + class config_context; class meta_service; diff --git a/src/meta/meta_data.cpp b/src/meta/meta_data.cpp index 44da02f058..8354ef8956 100644 --- a/src/meta/meta_data.cpp +++ b/src/meta/meta_data.cpp @@ -30,10 +30,10 @@ #include "common/gpid.h" #include "common/replication_enums.h" #include "meta_data.h" +#include "rpc/dns_resolver.h" // IWYU pragma: keep +#include "rpc/rpc_address.h" +#include "rpc/rpc_message.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/dns_resolver.h" // IWYU pragma: keep -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_message.h" #include "utils/flags.h" #include "utils/fmt_logging.h" diff --git a/src/meta/meta_data.h b/src/meta/meta_data.h index dd2533ecfc..fdb679c4ed 100644 --- a/src/meta/meta_data.h +++ b/src/meta/meta_data.h @@ -46,8 +46,8 @@ #include "meta/duplication/duplication_info.h" #include "meta_admin_types.h" #include "metadata_types.h" +#include "rpc/rpc_host_port.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_host_port.h" #include "runtime/task/task.h" #include "utils/autoref_ptr.h" #include "utils/blob.h" diff --git a/src/meta/meta_http_service.cpp b/src/meta/meta_http_service.cpp index b1e7af2d94..efc605d58d 100644 --- a/src/meta/meta_http_service.cpp +++ b/src/meta/meta_http_service.cpp @@ -47,8 +47,8 @@ #include "meta_admin_types.h" #include "meta_http_service.h" #include "meta_server_failure_detector.h" +#include "rpc/rpc_host_port.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_host_port.h" #include "server_load_balancer.h" #include "server_state.h" #include "utils/error_code.h" diff --git a/src/meta/meta_rpc_types.h b/src/meta/meta_rpc_types.h index 42539e89b4..200b409e17 100644 --- a/src/meta/meta_rpc_types.h +++ b/src/meta/meta_rpc_types.h @@ -24,7 +24,7 @@ #include "backup_types.h" #include "consensus_types.h" #include "replica_admin_types.h" -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_holder.h" namespace dsn { namespace replication { diff --git a/src/meta/meta_server_failure_detector.cpp b/src/meta/meta_server_failure_detector.cpp index 9e198582cc..ee85c4513c 100644 --- a/src/meta/meta_server_failure_detector.cpp +++ b/src/meta/meta_server_failure_detector.cpp @@ -35,7 +35,7 @@ #include "meta/meta_options.h" #include "meta/meta_service.h" #include "runtime/app_model.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" #include "runtime/serverlet.h" #include "runtime/task/task_code.h" #include "utils/autoref_ptr.h" diff --git a/src/meta/meta_server_failure_detector.h b/src/meta/meta_server_failure_detector.h index f656479a1a..4b0df536aa 100644 --- a/src/meta/meta_server_failure_detector.h +++ b/src/meta/meta_server_failure_detector.h @@ -33,8 +33,8 @@ #include #include "failure_detector/failure_detector.h" +#include "rpc/rpc_host_port.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_host_port.h" #include "runtime/task/task.h" #include "utils/fmt_logging.h" #include "utils/zlocks.h" @@ -43,21 +43,25 @@ namespace dsn { namespace dist { class distributed_lock_service; } // namespace dist + namespace fd { class beacon_ack; class beacon_msg; } // namespace fd + template class rpc_replier; namespace replication { class fd_suboptions; + class meta_service; namespace test { class test_checker; } + class meta_server_failure_detector : public fd::failure_detector { public: diff --git a/src/meta/meta_service.cpp b/src/meta/meta_service.cpp index 98f0339cee..faacdbf208 100644 --- a/src/meta/meta_service.cpp +++ b/src/meta/meta_service.cpp @@ -24,7 +24,6 @@ * THE SOFTWARE. */ -#include // IWYU pragma: no_include // IWYU pragma: no_include #include @@ -32,6 +31,7 @@ #include #include #include +#include #include #include @@ -57,8 +57,8 @@ #include "partition_split_types.h" #include "ranger/ranger_resource_policy_manager.h" #include "remote_cmd/remote_command.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_holder.h" #include "runtime/task/async_calls.h" #include "server_load_balancer.h" #include "server_state.h" diff --git a/src/meta/meta_service.h b/src/meta/meta_service.h index ad7afc2355..f76e87cf25 100644 --- a/src/meta/meta_service.h +++ b/src/meta/meta_service.h @@ -46,17 +46,17 @@ #include "meta_options.h" #include "meta_rpc_types.h" #include "meta_server_failure_detector.h" +#include "rpc/dns_resolver.h" +#include "rpc/network.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/network.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" -#include "security/access_controller.h" #include "runtime/serverlet.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" #include "runtime/task/task_tracker.h" +#include "security/access_controller.h" #include "utils/autoref_ptr.h" #include "utils/enum_helper.h" #include "utils/error_code.h" @@ -72,18 +72,20 @@ namespace ranger { class ranger_resource_policy_manager; } // namespace ranger namespace dist { + class meta_state_service; } // namespace dist namespace replication { class backup_service; class bulk_load_service; + class meta_duplication_service; class meta_split_service; class partition_guardian; + class server_load_balancer; class server_state; - namespace mss { struct meta_storage; } // namespace mss @@ -95,6 +97,7 @@ class test_checker; DEFINE_TASK_CODE(LPC_DEFAULT_CALLBACK, TASK_PRIORITY_COMMON, dsn::THREAD_POOL_DEFAULT) enum class meta_op_status + { FREE = 0, RECALL, diff --git a/src/meta/meta_split_service.cpp b/src/meta/meta_split_service.cpp index df0c642a2d..ed108c8581 100644 --- a/src/meta/meta_split_service.cpp +++ b/src/meta/meta_split_service.cpp @@ -40,9 +40,9 @@ #include "meta_split_service.h" #include "meta_state_service_utils.h" #include "metadata_types.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_host_port.h" #include "runtime/task/async_calls.h" #include "utils/blob.h" #include "utils/error_code.h" diff --git a/src/meta/meta_state_service_simple.h b/src/meta/meta_state_service_simple.h index f563f6c1bf..ddfe65376c 100644 --- a/src/meta/meta_state_service_simple.h +++ b/src/meta/meta_state_service_simple.h @@ -36,7 +36,7 @@ #include #include "meta/meta_state_service.h" -#include "runtime/rpc/serialization.h" +#include "rpc/serialization.h" #include "runtime/task/future_types.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" diff --git a/src/meta/partition_guardian.cpp b/src/meta/partition_guardian.cpp index 2cbf49122e..440ff96d96 100644 --- a/src/meta/partition_guardian.cpp +++ b/src/meta/partition_guardian.cpp @@ -37,7 +37,7 @@ #include "meta/server_load_balancer.h" #include "meta/server_state.h" #include "meta/table_metrics.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" #include "utils/flags.h" #include "utils/fmt_logging.h" #include "utils/metrics.h" diff --git a/src/meta/partition_guardian.h b/src/meta/partition_guardian.h index 4fd3f966de..67667707ef 100644 --- a/src/meta/partition_guardian.h +++ b/src/meta/partition_guardian.h @@ -29,7 +29,7 @@ #include "dsn.layer2_types.h" #include "meta_admin_types.h" #include "meta_data.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "utils/command_manager.h" #include "utils/zlocks.h" diff --git a/src/meta/server_load_balancer.cpp b/src/meta/server_load_balancer.cpp index 1a57858e38..0f8de9010d 100644 --- a/src/meta/server_load_balancer.cpp +++ b/src/meta/server_load_balancer.cpp @@ -32,8 +32,8 @@ #include "dsn.layer2_types.h" #include "meta/meta_data.h" #include "meta_admin_types.h" -#include "runtime/rpc/dns_resolver.h" // IWYU pragma: keep -#include "runtime/rpc/rpc_address.h" +#include "rpc/dns_resolver.h" // IWYU pragma: keep +#include "rpc/rpc_address.h" #include "utils/error_code.h" #include "utils/fmt_logging.h" diff --git a/src/meta/server_load_balancer.h b/src/meta/server_load_balancer.h index 7d03be5b9f..fbce601713 100644 --- a/src/meta/server_load_balancer.h +++ b/src/meta/server_load_balancer.h @@ -35,12 +35,13 @@ #include #include "meta_data.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "utils/extensible_object.h" namespace dsn { namespace replication { class configuration_balancer_request; + class configuration_balancer_response; class meta_service; diff --git a/src/meta/server_state.cpp b/src/meta/server_state.cpp index 2c5019cb9a..8868d574ba 100644 --- a/src/meta/server_state.cpp +++ b/src/meta/server_state.cpp @@ -38,7 +38,6 @@ #include // IWYU pragma: keep #include #include -// IWYU pragma: no_include #include #include "common/duplication_common.h" @@ -59,12 +58,12 @@ #include "meta_bulk_load_service.h" #include "metadata_types.h" #include "replica_admin_types.h" +#include "rpc/dns_resolver.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "runtime/task/task_spec.h" diff --git a/src/meta/server_state_restore.cpp b/src/meta/server_state_restore.cpp index 59dfe2dff5..1d89aa1084 100644 --- a/src/meta/server_state_restore.cpp +++ b/src/meta/server_state_restore.cpp @@ -40,9 +40,9 @@ #include "meta/table_metrics.h" #include "meta_admin_types.h" #include "meta_service.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" #include "server_state.h" diff --git a/src/meta/test/backup_test.cpp b/src/meta/test/backup_test.cpp index f3ec80d140..81e18bd5bc 100644 --- a/src/meta/test/backup_test.cpp +++ b/src/meta/test/backup_test.cpp @@ -42,12 +42,12 @@ #include "meta/test/misc/misc.h" #include "meta_service_test_app.h" #include "meta_test_base.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" diff --git a/src/meta/test/balancer_simulator/balancer_simulator.cpp b/src/meta/test/balancer_simulator/balancer_simulator.cpp index 4648577a03..c22d2040fb 100644 --- a/src/meta/test/balancer_simulator/balancer_simulator.cpp +++ b/src/meta/test/balancer_simulator/balancer_simulator.cpp @@ -41,10 +41,10 @@ #include "meta/server_load_balancer.h" #include "meta/test/misc/misc.h" #include "meta_admin_types.h" +#include "rpc/dns_resolver.h" // IWYU pragma: keep +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "runtime/app_model.h" -#include "runtime/rpc/dns_resolver.h" // IWYU pragma: keep -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" #include "utils/fmt_logging.h" using namespace dsn::replication; diff --git a/src/meta/test/balancer_validator.cpp b/src/meta/test/balancer_validator.cpp index 3671a90bd3..2543b28935 100644 --- a/src/meta/test/balancer_validator.cpp +++ b/src/meta/test/balancer_validator.cpp @@ -47,8 +47,8 @@ #include "meta_admin_types.h" #include "meta_service_test_app.h" #include "metadata_types.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "utils/fmt_logging.h" namespace dsn { diff --git a/src/meta/test/cluster_balance_policy_test.cpp b/src/meta/test/cluster_balance_policy_test.cpp index 7d18fd3fdd..fd1185f8cc 100644 --- a/src/meta/test/cluster_balance_policy_test.cpp +++ b/src/meta/test/cluster_balance_policy_test.cpp @@ -37,8 +37,8 @@ #include "meta/meta_service.h" #include "meta_admin_types.h" #include "metadata_types.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "utils/defer.h" #include "utils/fail_point.h" diff --git a/src/meta/test/copy_replica_operation_test.cpp b/src/meta/test/copy_replica_operation_test.cpp index 2c0045cdf9..761a27a7a4 100644 --- a/src/meta/test/copy_replica_operation_test.cpp +++ b/src/meta/test/copy_replica_operation_test.cpp @@ -30,7 +30,7 @@ #include "meta/app_balance_policy.h" #include "meta/load_balance_policy.h" #include "meta/meta_data.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "utils/fail_point.h" namespace dsn { diff --git a/src/meta/test/ford_fulkerson_test.cpp b/src/meta/test/ford_fulkerson_test.cpp index f7d97628ff..68ae88f7df 100644 --- a/src/meta/test/ford_fulkerson_test.cpp +++ b/src/meta/test/ford_fulkerson_test.cpp @@ -27,9 +27,9 @@ #include "gtest/gtest.h" #include "meta/load_balance_policy.h" #include "meta/meta_data.h" -#include "runtime/rpc/dns_resolver.h" // IWYU pragma: keep -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/dns_resolver.h" // IWYU pragma: keep +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" namespace dsn { namespace replication { diff --git a/src/meta/test/json_compacity.cpp b/src/meta/test/json_compacity.cpp index de01ec52a5..30d5da4d47 100644 --- a/src/meta/test/json_compacity.cpp +++ b/src/meta/test/json_compacity.cpp @@ -38,8 +38,8 @@ #include "gtest/gtest.h" #include "meta/meta_backup_service.h" #include "meta_service_test_app.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "utils/blob.h" namespace dsn { diff --git a/src/meta/test/meta_app_operation_test.cpp b/src/meta/test/meta_app_operation_test.cpp index 11d458e059..66de2f1660 100644 --- a/src/meta/test/meta_app_operation_test.cpp +++ b/src/meta/test/meta_app_operation_test.cpp @@ -41,8 +41,8 @@ #include "meta_service_test_app.h" #include "meta_test_base.h" #include "misc/misc.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" #include "runtime/task/task_tracker.h" #include "utils/defer.h" #include "utils/error_code.h" diff --git a/src/meta/test/meta_backup_test.cpp b/src/meta/test/meta_backup_test.cpp index 4d1f214936..1be550f4be 100644 --- a/src/meta/test/meta_backup_test.cpp +++ b/src/meta/test/meta_backup_test.cpp @@ -35,8 +35,8 @@ #include "meta/meta_service.h" #include "meta/server_state.h" #include "meta_test_base.h" +#include "rpc/rpc_host_port.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_host_port.h" #include "utils/env.h" #include "utils/error_code.h" #include "utils/fail_point.h" diff --git a/src/meta/test/meta_bulk_load_ingestion_test.cpp b/src/meta/test/meta_bulk_load_ingestion_test.cpp index b482be5124..f52a324979 100644 --- a/src/meta/test/meta_bulk_load_ingestion_test.cpp +++ b/src/meta/test/meta_bulk_load_ingestion_test.cpp @@ -24,13 +24,13 @@ #include "common/gpid.h" #include "dsn.layer2_types.h" #include "gtest/gtest.h" +#include "gutil/map_util.h" #include "meta/meta_bulk_load_ingestion_context.h" #include "meta/meta_data.h" #include "meta_test_base.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "utils/fail_point.h" -#include "gutil/map_util.h" namespace dsn { namespace replication { diff --git a/src/meta/test/meta_bulk_load_service_test.cpp b/src/meta/test/meta_bulk_load_service_test.cpp index 53f67a5bf6..b685bcaed8 100644 --- a/src/meta/test/meta_bulk_load_service_test.cpp +++ b/src/meta/test/meta_bulk_load_service_test.cpp @@ -51,9 +51,9 @@ #include "meta_service_test_app.h" #include "meta_test_base.h" #include "metadata_types.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/dns_resolver.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "utils/blob.h" #include "utils/error_code.h" #include "utils/fail_point.h" diff --git a/src/meta/test/meta_data.cpp b/src/meta/test/meta_data.cpp index 07b568cd5b..5573989205 100644 --- a/src/meta/test/meta_data.cpp +++ b/src/meta/test/meta_data.cpp @@ -35,9 +35,9 @@ #include "meta/meta_data.h" #include "metadata_types.h" #include "misc/misc.h" -#include "runtime/rpc/dns_resolver.h" // IWYU pragma: keep -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/dns_resolver.h" // IWYU pragma: keep +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" using namespace dsn::replication; diff --git a/src/meta/test/meta_duplication_service_test.cpp b/src/meta/test/meta_duplication_service_test.cpp index 8fbcddf09f..af312fa9e7 100644 --- a/src/meta/test/meta_duplication_service_test.cpp +++ b/src/meta/test/meta_duplication_service_test.cpp @@ -57,9 +57,9 @@ #include "meta/server_state.h" #include "meta/test/misc/misc.h" #include "meta_test_base.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" #include "utils/blob.h" #include "utils/error_code.h" #include "utils/fail_point.h" diff --git a/src/meta/test/meta_http_service_test.cpp b/src/meta/test/meta_http_service_test.cpp index cadcdffc63..b53854daaf 100644 --- a/src/meta/test/meta_http_service_test.cpp +++ b/src/meta/test/meta_http_service_test.cpp @@ -39,8 +39,8 @@ #include "meta/meta_state_service.h" #include "meta_service_test_app.h" #include "meta_test_base.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_message.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" #include "utils/autoref_ptr.h" diff --git a/src/meta/test/meta_partition_guardian_test.cpp b/src/meta/test/meta_partition_guardian_test.cpp index 927d26ea09..6dbccfe320 100644 --- a/src/meta/test/meta_partition_guardian_test.cpp +++ b/src/meta/test/meta_partition_guardian_test.cpp @@ -55,11 +55,11 @@ #include "meta_service_test_app.h" #include "meta_test_base.h" #include "metadata_types.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/dns_resolver.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "utils/autoref_ptr.h" diff --git a/src/meta/test/meta_service_test.cpp b/src/meta/test/meta_service_test.cpp index 802ca62bd9..dc727d8026 100644 --- a/src/meta/test/meta_service_test.cpp +++ b/src/meta/test/meta_service_test.cpp @@ -26,12 +26,12 @@ #include "meta/meta_service.h" #include "meta_admin_types.h" #include "meta_test_base.h" -#include "runtime/rpc/network.sim.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/network.sim.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "utils/autoref_ptr.h" #include "utils/error_code.h" #include "utils/fail_point.h" diff --git a/src/meta/test/meta_service_test_app.h b/src/meta/test/meta_service_test_app.h index b755755919..1f92a08f04 100644 --- a/src/meta/test/meta_service_test_app.h +++ b/src/meta/test/meta_service_test_app.h @@ -36,11 +36,11 @@ #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 "rpc/serialization.h" +#include "rpc/rpc_stream.h" #include "runtime/serverlet.h" #include "runtime/service_app.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" #include "runtime/task/async_calls.h" #include "meta_admin_types.h" #include "partition_split_types.h" diff --git a/src/meta/test/meta_split_service_test.cpp b/src/meta/test/meta_split_service_test.cpp index 5eb3940a7b..c63c7aa4e7 100644 --- a/src/meta/test/meta_split_service_test.cpp +++ b/src/meta/test/meta_split_service_test.cpp @@ -59,8 +59,8 @@ #include "meta_test_base.h" #include "metadata_types.h" #include "partition_split_types.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "utils/blob.h" #include "utils/error_code.h" #include "utils/fmt_logging.h" diff --git a/src/meta/test/meta_test_base.cpp b/src/meta/test/meta_test_base.cpp index 49cf729d12..db7f6b603e 100644 --- a/src/meta/test/meta_test_base.cpp +++ b/src/meta/test/meta_test_base.cpp @@ -38,8 +38,8 @@ #include "meta/server_state.h" #include "meta/test/misc/misc.h" #include "meta_service_test_app.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" #include "runtime/task/task_tracker.h" #include "utils/error_code.h" #include "utils/factory_store.h" diff --git a/src/meta/test/misc/misc.cpp b/src/meta/test/misc/misc.cpp index d4bfa25a0f..a3bd371445 100644 --- a/src/meta/test/misc/misc.cpp +++ b/src/meta/test/misc/misc.cpp @@ -48,9 +48,9 @@ #include "duplication_types.h" #include "meta_admin_types.h" #include "metadata_types.h" -#include "runtime/rpc/dns_resolver.h" // IWYU pragma: keep -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/dns_resolver.h" // IWYU pragma: keep +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "utils/filesystem.h" #include "utils/fmt_logging.h" #include "utils/rand.h" diff --git a/src/meta/test/misc/misc.h b/src/meta/test/misc/misc.h index 41a583df43..bb9a23a881 100644 --- a/src/meta/test/misc/misc.h +++ b/src/meta/test/misc/misc.h @@ -37,7 +37,7 @@ #include #include "meta/meta_data.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" namespace dsn { class gpid; diff --git a/src/meta/test/server_state_restore_test.cpp b/src/meta/test/server_state_restore_test.cpp index 6c997b69d0..395aa4444d 100644 --- a/src/meta/test/server_state_restore_test.cpp +++ b/src/meta/test/server_state_restore_test.cpp @@ -33,8 +33,8 @@ #include "meta/meta_service.h" #include "meta/server_state.h" #include "meta_test_base.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "utils/blob.h" #include "utils/error_code.h" #include "utils/zlocks.h" diff --git a/src/meta/test/server_state_test.cpp b/src/meta/test/server_state_test.cpp index 7fdee4588d..b77890d314 100644 --- a/src/meta/test/server_state_test.cpp +++ b/src/meta/test/server_state_test.cpp @@ -42,8 +42,8 @@ #include "meta/server_state.h" #include "meta_admin_types.h" #include "meta_service_test_app.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "utils/error_code.h" #include "utils/flags.h" diff --git a/src/meta/test/state_sync_test.cpp b/src/meta/test/state_sync_test.cpp index 1a7901560f..09efb0ed35 100644 --- a/src/meta/test/state_sync_test.cpp +++ b/src/meta/test/state_sync_test.cpp @@ -46,15 +46,15 @@ #include "meta/test/misc/misc.h" #include "meta_admin_types.h" #include "meta_service_test_app.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "runtime/task/task.h" #include "utils/autoref_ptr.h" #include "utils/error_code.h" #include "utils/flags.h" #include "utils/strings.h" -#include "utils/utils.h" #include "utils/test_macros.h" +#include "utils/utils.h" DSN_DECLARE_string(cluster_root); DSN_DECLARE_string(meta_state_service_type); diff --git a/src/meta/test/update_configuration_test.cpp b/src/meta/test/update_configuration_test.cpp index f4c8e9702e..27cdf4aa7a 100644 --- a/src/meta/test/update_configuration_test.cpp +++ b/src/meta/test/update_configuration_test.cpp @@ -54,11 +54,11 @@ #include "meta_admin_types.h" #include "meta_service_test_app.h" #include "metadata_types.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "utils/autoref_ptr.h" diff --git a/src/nfs/nfs_client_impl.cpp b/src/nfs/nfs_client_impl.cpp index 5b2bcd3657..9ef555e87c 100644 --- a/src/nfs/nfs_client_impl.cpp +++ b/src/nfs/nfs_client_impl.cpp @@ -35,8 +35,8 @@ #include "nfs/nfs_code_definition.h" #include "nfs/nfs_node.h" #include "nlohmann/json.hpp" -#include "runtime/rpc/dns_resolver.h" // IWYU pragma: keep -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/dns_resolver.h" // IWYU pragma: keep +#include "rpc/rpc_host_port.h" #include "utils/blob.h" #include "utils/command_manager.h" #include "utils/filesystem.h" diff --git a/src/nfs/nfs_client_impl.h b/src/nfs/nfs_client_impl.h index 183ac38a97..6f006f3c57 100644 --- a/src/nfs/nfs_client_impl.h +++ b/src/nfs/nfs_client_impl.h @@ -41,7 +41,7 @@ #include "aio/file_io.h" #include "nfs_code_definition.h" #include "nfs_types.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "runtime/task/task_tracker.h" diff --git a/src/nfs/nfs_node.h b/src/nfs/nfs_node.h index 9edada83cd..5b14ad3072 100644 --- a/src/nfs/nfs_node.h +++ b/src/nfs/nfs_node.h @@ -32,19 +32,21 @@ #include "aio/aio_task.h" #include "common/gpid.h" +#include "rpc/rpc_host_port.h" #include "runtime/api_task.h" -#include "runtime/rpc/rpc_host_port.h" #include "runtime/task/task_code.h" #include "utils/error_code.h" namespace dsn { class task_tracker; + namespace service { class copy_request; class copy_response; class get_file_size_request; class get_file_size_response; } // namespace service + template class rpc_replier; diff --git a/src/nfs/test/main.cpp b/src/nfs/test/main.cpp index acabe19a4a..c0880d519e 100644 --- a/src/nfs/test/main.cpp +++ b/src/nfs/test/main.cpp @@ -37,8 +37,8 @@ #include "common/gpid.h" #include "gtest/gtest.h" #include "nfs/nfs_node.h" +#include "rpc/rpc_host_port.h" #include "runtime/app_model.h" -#include "runtime/rpc/rpc_host_port.h" #include "runtime/task/task_code.h" #include "runtime/tool_api.h" #include "test_util/test_util.h" diff --git a/src/redis_protocol/proxy_lib/proxy_layer.cpp b/src/redis_protocol/proxy_lib/proxy_layer.cpp index b8eb1666d2..6588b9ea2f 100644 --- a/src/redis_protocol/proxy_lib/proxy_layer.cpp +++ b/src/redis_protocol/proxy_lib/proxy_layer.cpp @@ -21,9 +21,9 @@ #include #include "proxy_layer.h" -#include "runtime/rpc/network.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/network.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_message.h" #include "runtime/task/task_spec.h" #include "utils/autoref_ptr.h" #include "utils/fmt_logging.h" diff --git a/src/redis_protocol/proxy_lib/proxy_layer.h b/src/redis_protocol/proxy_lib/proxy_layer.h index 385c99d20d..1973dc10f5 100644 --- a/src/redis_protocol/proxy_lib/proxy_layer.h +++ b/src/redis_protocol/proxy_lib/proxy_layer.h @@ -25,8 +25,8 @@ #include #include -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "runtime/serverlet.h" #include "runtime/task/task_code.h" #include "utils/threadpool_code.h" diff --git a/src/redis_protocol/proxy_lib/redis_parser.cpp b/src/redis_protocol/proxy_lib/redis_parser.cpp index 99683d902c..7e25620202 100644 --- a/src/redis_protocol/proxy_lib/redis_parser.cpp +++ b/src/redis_protocol/proxy_lib/redis_parser.cpp @@ -31,15 +31,15 @@ #include #include #include - #include + #include "common/common.h" #include "common/replication_other_types.h" #include "pegasus/client.h" +#include "rpc/rpc_host_port.h" +#include "rpc/serialization.h" #include "rrdb/rrdb_types.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/serialization.h" #include "utils/api_utilities.h" #include "utils/binary_writer.h" #include "utils/error_code.h" diff --git a/src/redis_protocol/proxy_lib/redis_parser.h b/src/redis_protocol/proxy_lib/redis_parser.h index 1e7b40e8c3..fe0aff303c 100644 --- a/src/redis_protocol/proxy_lib/redis_parser.h +++ b/src/redis_protocol/proxy_lib/redis_parser.h @@ -33,8 +33,8 @@ #include "geo/lib/geo_client.h" #include "proxy_layer.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/rpc_stream.h" +#include "rpc/rpc_message.h" +#include "rpc/rpc_stream.h" #include "utils/blob.h" #include "utils/zlocks.h" diff --git a/src/redis_protocol/proxy_ut/redis_proxy_test.cpp b/src/redis_protocol/proxy_ut/redis_proxy_test.cpp index 5d88285c10..9f300391b1 100644 --- a/src/redis_protocol/proxy_ut/redis_proxy_test.cpp +++ b/src/redis_protocol/proxy_ut/redis_proxy_test.cpp @@ -46,9 +46,9 @@ #include "proxy_layer.h" #include "redis_parser.h" #include "runtime/app_model.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/rpc_stream.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_message.h" +#include "rpc/rpc_stream.h" #include "runtime/service_app.h" #include "runtime/task/task_spec.h" #include "utils/blob.h" diff --git a/src/remote_cmd/remote_command.cpp b/src/remote_cmd/remote_command.cpp index 8fc79bdfb4..070af7f8ee 100644 --- a/src/remote_cmd/remote_command.cpp +++ b/src/remote_cmd/remote_command.cpp @@ -25,8 +25,8 @@ #include "command_types.h" #include "runtime/api_layer1.h" #include "runtime/api_task.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_holder.h" #include "runtime/task/task_code.h" #include "utils/command_manager.h" #include "utils/error_code.h" diff --git a/src/replica/backup/replica_backup_server.cpp b/src/replica/backup/replica_backup_server.cpp index ef7ddc4fcf..4d639f2716 100644 --- a/src/replica/backup/replica_backup_server.cpp +++ b/src/replica/backup/replica_backup_server.cpp @@ -26,7 +26,7 @@ #include "replica/replica_stub.h" #include "replica_backup_manager.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/serialization.h" +#include "rpc/serialization.h" #include "utils/autoref_ptr.h" #include "utils/error_code.h" #include "utils/flags.h" diff --git a/src/replica/bulk_load/replica_bulk_loader.cpp b/src/replica/bulk_load/replica_bulk_loader.cpp index b58afccc70..989f0e2244 100644 --- a/src/replica/bulk_load/replica_bulk_loader.cpp +++ b/src/replica/bulk_load/replica_bulk_loader.cpp @@ -18,11 +18,11 @@ #include #include #include +#include #include #include #include -#include #include "block_service/block_service_manager.h" #include "common/bulk_load_common.h" #include "common/gpid.h" @@ -36,10 +36,10 @@ #include "replica/replica_stub.h" #include "replica/replication_app_base.h" #include "replica_bulk_loader.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/dns_resolver.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_host_port.h" #include "runtime/task/async_calls.h" #include "utils/autoref_ptr.h" #include "utils/chrono_literals.h" 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 9c8bf3046f..f5c5a3c3f2 100644 --- a/src/replica/bulk_load/test/replica_bulk_loader_test.cpp +++ b/src/replica/bulk_load/test/replica_bulk_loader_test.cpp @@ -27,8 +27,8 @@ #include "gtest/gtest.h" #include "replica/test/mock_utils.h" #include "replica/test/replica_test_base.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "runtime/task/task_tracker.h" #include "test_util/test_util.h" #include "utils/fail_point.h" diff --git a/src/replica/duplication/duplication_sync_timer.cpp b/src/replica/duplication/duplication_sync_timer.cpp index 7337d91890..0bab2dae51 100644 --- a/src/replica/duplication/duplication_sync_timer.cpp +++ b/src/replica/duplication/duplication_sync_timer.cpp @@ -28,8 +28,8 @@ #include "replica/replica.h" #include "replica/replica_stub.h" #include "replica_duplicator_manager.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "runtime/task/async_calls.h" #include "runtime/task/task_code.h" #include "utils/autoref_ptr.h" diff --git a/src/replica/duplication/replica_follower.cpp b/src/replica/duplication/replica_follower.cpp index 3373d9a86c..6507e7bb07 100644 --- a/src/replica/duplication/replica_follower.cpp +++ b/src/replica/duplication/replica_follower.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include "common/duplication_common.h" @@ -32,17 +33,16 @@ #include "nfs/nfs_node.h" #include "replica/replica.h" #include "replica/replica_stub.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/group_host_port.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/dns_resolver.h" +#include "rpc/group_host_port.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/task/async_calls.h" #include "utils/fail_point.h" #include "utils/filesystem.h" #include "utils/fmt_logging.h" #include "utils/ports.h" -#include #include "utils/strings.h" namespace dsn { diff --git a/src/replica/duplication/replica_follower.h b/src/replica/duplication/replica_follower.h index acf978c7ad..7b474ac33b 100644 --- a/src/replica/duplication/replica_follower.h +++ b/src/replica/duplication/replica_follower.h @@ -26,7 +26,7 @@ #include "common/gpid.h" #include "dsn.layer2_types.h" #include "replica/replica_base.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "runtime/task/task_tracker.h" #include "utils/error_code.h" #include "utils/zlocks.h" @@ -34,6 +34,7 @@ namespace dsn { namespace replication { class learn_response; + class replica; class replica_follower : replica_base diff --git a/src/replica/duplication/test/duplication_sync_timer_test.cpp b/src/replica/duplication/test/duplication_sync_timer_test.cpp index 2714af6bd5..efa2581d44 100644 --- a/src/replica/duplication/test/duplication_sync_timer_test.cpp +++ b/src/replica/duplication/test/duplication_sync_timer_test.cpp @@ -31,9 +31,9 @@ #include "replica/duplication/replica_duplicator.h" #include "replica/duplication/replica_duplicator_manager.h" #include "replica/test/mock_utils.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" #include "utils/error_code.h" namespace dsn { 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 f2eaf253bf..625294f773 100644 --- a/src/replica/duplication/test/load_from_private_log_test.cpp +++ b/src/replica/duplication/test/load_from_private_log_test.cpp @@ -36,7 +36,7 @@ #include "replica/mutation_log.h" #include "replica/test/mock_utils.h" #include "runtime/pipeline.h" -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_holder.h" #include "runtime/task/task_code.h" #include "runtime/task/task_tracker.h" #include "utils/autoref_ptr.h" diff --git a/src/replica/duplication/test/replica_follower_test.cpp b/src/replica/duplication/test/replica_follower_test.cpp index effcb7e3c1..65e8b7a861 100644 --- a/src/replica/duplication/test/replica_follower_test.cpp +++ b/src/replica/duplication/test/replica_follower_test.cpp @@ -32,8 +32,8 @@ #include "nfs/nfs_node.h" #include "replica/duplication/replica_follower.h" #include "replica/test/mock_utils.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "runtime/task/task_tracker.h" #include "utils/autoref_ptr.h" #include "utils/error_code.h" diff --git a/src/replica/mutation.h b/src/replica/mutation.h index cd99d957c4..0ff5ff7e82 100644 --- a/src/replica/mutation.h +++ b/src/replica/mutation.h @@ -36,7 +36,7 @@ #include "common/replication_other_types.h" #include "consensus_types.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" #include "utils/autoref_ptr.h" diff --git a/src/replica/replica.cpp b/src/replica/replica.cpp index f6d772169d..4175bb8168 100644 --- a/src/replica/replica.cpp +++ b/src/replica/replica.cpp @@ -51,7 +51,7 @@ #include "replica_admin_types.h" #include "replica_disk_migrator.h" #include "replica_stub.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "security/access_controller.h" #include "split/replica_split_manager.h" #include "utils/filesystem.h" diff --git a/src/replica/replica.h b/src/replica/replica.h index eb177f5454..5d417727cc 100644 --- a/src/replica/replica.h +++ b/src/replica/replica.h @@ -49,8 +49,8 @@ #include "replica/backup/cold_backup_context.h" #include "replica/replica_base.h" #include "replica_context.h" +#include "rpc/rpc_message.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_message.h" #include "runtime/serverlet.h" #include "runtime/task/task.h" #include "runtime/task/task_tracker.h" @@ -73,6 +73,7 @@ class gpid; class host_port; namespace dist { + namespace block_service { class block_filesystem; } // namespace block_service @@ -85,6 +86,7 @@ namespace replication { class backup_request; class backup_response; + class configuration_restore_request; class detect_hotkey_request; class detect_hotkey_response; @@ -105,7 +107,6 @@ class replica_stub; class replication_app_base; class replication_options; struct dir_node; - typedef dsn::ref_ptr cold_backup_context_ptr; namespace test { diff --git a/src/replica/replica_2pc.cpp b/src/replica/replica_2pc.cpp index 8f48438d1a..d3074b724f 100644 --- a/src/replica/replica_2pc.cpp +++ b/src/replica/replica_2pc.cpp @@ -55,12 +55,12 @@ #include "replica/replica_context.h" #include "replica/replication_app_base.h" #include "replica_stub.h" +#include "rpc/dns_resolver.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" +#include "rpc/rpc_stream.h" +#include "rpc/serialization.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/rpc_stream.h" -#include "runtime/rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" diff --git a/src/replica/replica_check.cpp b/src/replica/replica_check.cpp index 32cf5f70fa..0586d7f2cd 100644 --- a/src/replica/replica_check.cpp +++ b/src/replica/replica_check.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -46,10 +47,10 @@ #include "replica/replica_context.h" #include "replica/replication_app_base.h" #include "replica_stub.h" +#include "rpc/dns_resolver.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "split/replica_split_manager.h" @@ -58,7 +59,6 @@ #include "utils/fail_point.h" #include "utils/flags.h" #include "utils/fmt_logging.h" -#include #include "utils/metrics.h" #include "utils/thread_access_checker.h" diff --git a/src/replica/replica_chkpt.cpp b/src/replica/replica_chkpt.cpp index 368d1a4ab0..1a18d62ac9 100644 --- a/src/replica/replica_chkpt.cpp +++ b/src/replica/replica_chkpt.cpp @@ -47,10 +47,10 @@ #include "replica/replica_context.h" #include "replica/replication_app_base.h" #include "replica_stub.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_host_port.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_host_port.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "split/replica_split_manager.h" diff --git a/src/replica/replica_config.cpp b/src/replica/replica_config.cpp index 3bcd5faaff..5137ca2b4a 100644 --- a/src/replica/replica_config.cpp +++ b/src/replica/replica_config.cpp @@ -35,12 +35,12 @@ #include #include #include +#include #include #include #include #include -#include #include "bulk_load/replica_bulk_loader.h" #include "common/gpid.h" #include "common/replica_envs.h" @@ -51,6 +51,7 @@ #include "consensus_types.h" #include "dsn.layer2_types.h" #include "failure_detector/failure_detector_multimaster.h" +#include "gutil/map_util.h" #include "meta_admin_types.h" #include "metadata_types.h" #include "mutation.h" @@ -59,12 +60,12 @@ #include "replica/replica_context.h" #include "replica/replication_app_base.h" #include "replica_stub.h" +#include "rpc/dns_resolver.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "security/access_controller.h" @@ -74,7 +75,6 @@ #include "utils/fail_point.h" #include "utils/flags.h" #include "utils/fmt_logging.h" -#include "gutil/map_util.h" #include "utils/string_conv.h" #include "utils/strings.h" #include "utils/thread_access_checker.h" diff --git a/src/replica/replica_context.cpp b/src/replica/replica_context.cpp index 1d483d7015..c2b4a2fa6c 100644 --- a/src/replica/replica_context.cpp +++ b/src/replica/replica_context.cpp @@ -33,7 +33,7 @@ #include "replica.h" #include "replica_context.h" #include "replica_stub.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" #include "utils/error_code.h" #include "utils/utils.h" diff --git a/src/replica/replica_context.h b/src/replica/replica_context.h index 8fba146646..259e5e9a1d 100644 --- a/src/replica/replica_context.h +++ b/src/replica/replica_context.h @@ -40,8 +40,8 @@ #include "dsn.layer2_types.h" #include "metadata_types.h" #include "mutation.h" +#include "rpc/rpc_host_port.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_host_port.h" #include "runtime/task/task.h" #include "utils/autoref_ptr.h" #include "utils/fmt_logging.h" diff --git a/src/replica/replica_failover.cpp b/src/replica/replica_failover.cpp index e563336f46..dd7fa9d4bc 100644 --- a/src/replica/replica_failover.cpp +++ b/src/replica/replica_failover.cpp @@ -36,8 +36,8 @@ #include "replica.h" #include "replica/replica_context.h" #include "replica_stub.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "utils/error_code.h" #include "utils/fmt_logging.h" diff --git a/src/replica/replica_learn.cpp b/src/replica/replica_learn.cpp index b1c30692e5..19d225973b 100644 --- a/src/replica/replica_learn.cpp +++ b/src/replica/replica_learn.cpp @@ -55,12 +55,12 @@ #include "replica/replica_context.h" #include "replica/replication_app_base.h" #include "replica_stub.h" +#include "rpc/dns_resolver.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "utils/autoref_ptr.h" diff --git a/src/replica/replica_restore.cpp b/src/replica/replica_restore.cpp index a5c5d39ad4..13fbda2d91 100644 --- a/src/replica/replica_restore.cpp +++ b/src/replica/replica_restore.cpp @@ -39,9 +39,9 @@ #include "metadata_types.h" #include "replica.h" #include "replica_stub.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/dns_resolver.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" diff --git a/src/replica/replica_stub.cpp b/src/replica/replica_stub.cpp index ebab553809..b0f120a9da 100644 --- a/src/replica/replica_stub.cpp +++ b/src/replica/replica_stub.cpp @@ -40,10 +40,10 @@ #include #include #include +#include #include #include -#include #include "backup/replica_backup_server.h" #include "bulk_load/replica_bulk_loader.h" #include "common/backup_common.h" @@ -65,9 +65,9 @@ #include "replica/replica_stub.h" #include "replica/replication_app_base.h" #include "replica_disk_migrator.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" #include "runtime/task/async_calls.h" #include "security/access_controller.h" #include "split/replica_split_manager.h" diff --git a/src/replica/replica_stub.h b/src/replica/replica_stub.h index 116ab350fc..8ddd0d26df 100644 --- a/src/replica/replica_stub.h +++ b/src/replica/replica_stub.h @@ -54,10 +54,10 @@ #include "replica.h" #include "replica/mutation_log.h" #include "replica_admin_types.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/dns_resolver.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_host_port.h" #include "runtime/serverlet.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" @@ -76,6 +76,7 @@ namespace dsn { class command_deregister; class message_ex; class nfs_node; + namespace security { class kms_key_provider; } // namespace security @@ -92,8 +93,9 @@ class configuration_query_by_node_response; class configuration_update_request; class potential_secondary_context; -typedef rpc_holder learn_completion_notification_rpc; typedef rpc_holder group_check_rpc; +typedef rpc_holder learn_completion_notification_rpc; + typedef rpc_holder query_replica_decree_rpc; typedef rpc_holder query_last_checkpoint_info_rpc; @@ -113,12 +115,11 @@ class test_checker; } class cold_backup_context; class replica_split_manager; - -typedef std::unordered_map replicas; typedef std::function replica_state_subscriber; +typedef std::unordered_map replicas; class replica_stub; @@ -129,6 +130,7 @@ class replica_backup_server; // The replica_stub is the *singleton* entry to access all replica managed in the same process // replica_stub(singleton) --> replica --> replication_app_base + class replica_stub : public serverlet, public ref_counter { public: diff --git a/src/replica/replica_throttle.cpp b/src/replica/replica_throttle.cpp index 8092206f4b..c6af3fb259 100644 --- a/src/replica/replica_throttle.cpp +++ b/src/replica/replica_throttle.cpp @@ -26,7 +26,7 @@ #include "common/replication.codes.h" #include "dsn.layer2_types.h" #include "replica.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "runtime/task/async_calls.h" #include "utils/autoref_ptr.h" #include "utils/error_code.h" diff --git a/src/replica/replication_app_base.cpp b/src/replica/replication_app_base.cpp index e15df7829d..e8a3045039 100644 --- a/src/replica/replication_app_base.cpp +++ b/src/replica/replication_app_base.cpp @@ -43,8 +43,8 @@ #include "mutation.h" #include "replica.h" #include "replica/replication_app_base.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/task/task_code.h" #include "runtime/task/task_spec.h" #include "utils/autoref_ptr.h" diff --git a/src/replica/split/replica_split_manager.cpp b/src/replica/split/replica_split_manager.cpp index 371d92f092..cdb485d3d7 100644 --- a/src/replica/split/replica_split_manager.cpp +++ b/src/replica/split/replica_split_manager.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include "common/partition_split_common.h" @@ -34,11 +35,11 @@ #include "replica/replica_context.h" #include "replica/replica_stub.h" #include "replica/replication_app_base.h" +#include "rpc/dns_resolver.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_host_port.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_host_port.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "utils/autoref_ptr.h" @@ -48,7 +49,6 @@ #include "utils/filesystem.h" #include "utils/flags.h" #include "utils/fmt_logging.h" -#include #include "utils/thread_access_checker.h" METRIC_DEFINE_counter(replica, diff --git a/src/replica/split/test/replica_split_test.cpp b/src/replica/split/test/replica_split_test.cpp index d7d7cdec1c..f2de89839c 100644 --- a/src/replica/split/test/replica_split_test.cpp +++ b/src/replica/split/test/replica_split_test.cpp @@ -40,8 +40,8 @@ #include "replica/split/replica_split_manager.h" #include "replica/test/mock_utils.h" #include "replica/test/replica_test_base.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "runtime/task/task.h" #include "runtime/task/task_tracker.h" #include "utils/autoref_ptr.h" diff --git a/src/replica/storage/simple_kv/simple_kv.client.h b/src/replica/storage/simple_kv/simple_kv.client.h index f6bc2c2f8b..30bae84158 100644 --- a/src/replica/storage/simple_kv/simple_kv.client.h +++ b/src/replica/storage/simple_kv/simple_kv.client.h @@ -27,7 +27,7 @@ #pragma once #include #include "utils/optional.h" -#include "runtime/rpc/dns_resolver.h" +#include "rpc/dns_resolver.h" #include "runtime/task/async_calls.h" #include "client/partition_resolver.h" #include "simple_kv.code.definition.h" diff --git a/src/replica/storage/simple_kv/test/case.cpp b/src/replica/storage/simple_kv/test/case.cpp index d94eafaa56..5b8d87af5b 100644 --- a/src/replica/storage/simple_kv/test/case.cpp +++ b/src/replica/storage/simple_kv/test/case.cpp @@ -46,7 +46,7 @@ #include "checker.h" #include "replica/replica_stub.h" #include "replica/storage/simple_kv/test/common.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "runtime/service_engine.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" diff --git a/src/replica/storage/simple_kv/test/case.h b/src/replica/storage/simple_kv/test/case.h index 1cd5fe0547..1ecd57d9c3 100644 --- a/src/replica/storage/simple_kv/test/case.h +++ b/src/replica/storage/simple_kv/test/case.h @@ -35,7 +35,7 @@ #include "common.h" #include "meta_admin_types.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "utils/error_code.h" #include "utils/fmt_utils.h" #include "utils/singleton.h" @@ -43,6 +43,7 @@ namespace dsn { class aio_task; + class message_ex; class rpc_request_task; class rpc_response_task; diff --git a/src/replica/storage/simple_kv/test/checker.cpp b/src/replica/storage/simple_kv/test/checker.cpp index de6e52c552..1f97cabb1d 100644 --- a/src/replica/storage/simple_kv/test/checker.cpp +++ b/src/replica/storage/simple_kv/test/checker.cpp @@ -50,8 +50,8 @@ #include "replica/replica_stub.h" #include "replica/replication_service_app.h" #include "replica/storage/simple_kv/test/common.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_engine.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_engine.h" #include "runtime/service_app.h" #include "runtime/service_engine.h" #include "runtime/tool_api.h" diff --git a/src/replica/storage/simple_kv/test/checker.h b/src/replica/storage/simple_kv/test/checker.h index 87e6d8e1a2..951b459068 100644 --- a/src/replica/storage/simple_kv/test/checker.h +++ b/src/replica/storage/simple_kv/test/checker.h @@ -33,18 +33,20 @@ #include "common.h" #include "meta/meta_data.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "runtime/simulator.h" #include "utils/singleton.h" namespace dsn { class service_app; + namespace service { class meta_service_app; } // namespace service namespace replication { class replica_configuration; + class replication_service_app; namespace test { diff --git a/src/replica/storage/simple_kv/test/client.cpp b/src/replica/storage/simple_kv/test/client.cpp index ff1587bda5..dcdadb26f7 100644 --- a/src/replica/storage/simple_kv/test/client.cpp +++ b/src/replica/storage/simple_kv/test/client.cpp @@ -37,12 +37,12 @@ #include "common/replication_other_types.h" #include "replica/storage/simple_kv/simple_kv.client.h" #include "replica/storage/simple_kv/test/common.h" +#include "rpc/dns_resolver.h" +#include "rpc/group_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/group_host_port.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task_code.h" #include "simple_kv_types.h" diff --git a/src/replica/storage/simple_kv/test/client.h b/src/replica/storage/simple_kv/test/client.h index 138e751528..3bf5fe9607 100644 --- a/src/replica/storage/simple_kv/test/client.h +++ b/src/replica/storage/simple_kv/test/client.h @@ -31,7 +31,7 @@ #include #include "meta_admin_types.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "runtime/service_app.h" #include "runtime/task/task_tracker.h" #include "utils/error_code.h" diff --git a/src/replica/storage/simple_kv/test/common.h b/src/replica/storage/simple_kv/test/common.h index 633a8b7e33..c46731c3c6 100644 --- a/src/replica/storage/simple_kv/test/common.h +++ b/src/replica/storage/simple_kv/test/common.h @@ -37,8 +37,8 @@ #include "common/gpid.h" #include "common/replication_other_types.h" #include "metadata_types.h" +#include "rpc/rpc_host_port.h" #include "utils/fmt_utils.h" -#include "runtime/rpc/rpc_host_port.h" namespace dsn { class partition_configuration; diff --git a/src/replica/test/mock_utils.h b/src/replica/test/mock_utils.h index e89e6c7f98..0ae2dd96ae 100644 --- a/src/replica/test/mock_utils.h +++ b/src/replica/test/mock_utils.h @@ -34,7 +34,7 @@ #include "replica/replica.h" #include "replica/replica_stub.h" #include "replica/backup/cold_backup_context.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" DSN_DECLARE_int32(log_private_file_size_mb); diff --git a/src/replica/test/open_replica_test.cpp b/src/replica/test/open_replica_test.cpp index 75094de5e9..46f520d5aa 100644 --- a/src/replica/test/open_replica_test.cpp +++ b/src/replica/test/open_replica_test.cpp @@ -31,8 +31,8 @@ #include "mock_utils.h" #include "replica/replica_stub.h" #include "replica_test_base.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "runtime/task/task.h" #include "utils/filesystem.h" diff --git a/src/replica/test/replica_disk_migrate_test.cpp b/src/replica/test/replica_disk_migrate_test.cpp index ce2ed30d42..e73c85dfc6 100644 --- a/src/replica/test/replica_disk_migrate_test.cpp +++ b/src/replica/test/replica_disk_migrate_test.cpp @@ -39,7 +39,7 @@ #include "replica/test/mock_utils.h" #include "replica/test/replica_disk_test_base.h" #include "replica_admin_types.h" -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_holder.h" #include "runtime/task/task.h" #include "runtime/task/task_tracker.h" #include "utils/autoref_ptr.h" diff --git a/src/replica/test/replica_disk_test.cpp b/src/replica/test/replica_disk_test.cpp index c072556d31..a3f4ff0181 100644 --- a/src/replica/test/replica_disk_test.cpp +++ b/src/replica/test/replica_disk_test.cpp @@ -41,7 +41,7 @@ #include "replica_admin_types.h" #include "replica_disk_test_base.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_holder.h" #include "test_util/test_util.h" #include "utils/autoref_ptr.h" #include "utils/error_code.h" diff --git a/src/replica/test/replica_test.cpp b/src/replica/test/replica_test.cpp index a6812ff4ff..2e0a85e435 100644 --- a/src/replica/test/replica_test.cpp +++ b/src/replica/test/replica_test.cpp @@ -52,9 +52,9 @@ #include "replica/test/mock_utils.h" #include "replica_test_base.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/network.sim.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/network.sim.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_message.h" #include "runtime/task/task_code.h" #include "runtime/task/task_tracker.h" #include "test_util/test_util.h" diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt new file mode 100644 index 0000000000..403ab2f04b --- /dev/null +++ b/src/rpc/CMakeLists.txt @@ -0,0 +1,31 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +set(MY_PROJ_NAME dsn_rpc) +set(MY_SRC_SEARCH_MODE "GLOB") +thrift_generate_cpp( + REQUEST_META_THRIFT_SRCS + REQUEST_META_THRIFT_HDRS + ${PROJECT_ROOT}/src/rpc/request_meta.thrift) +set(MY_PROJ_SRC ${REQUEST_META_THRIFT_SRCS}) +set(MY_PROJ_LIBS + dsn_meta_server + dsn_replication_common + dsn_utils) +dsn_add_static_library() + +add_subdirectory(test) diff --git a/src/runtime/rpc/asio_net_provider.cpp b/src/rpc/asio_net_provider.cpp similarity index 99% rename from src/runtime/rpc/asio_net_provider.cpp rename to src/rpc/asio_net_provider.cpp index 8c9457cbb3..48a70e45c8 100644 --- a/src/runtime/rpc/asio_net_provider.cpp +++ b/src/rpc/asio_net_provider.cpp @@ -163,7 +163,8 @@ error_code asio_network_provider::start(rpc_channel channel, int port, bool clie _acceptor->set_option(boost::asio::socket_base::reuse_address(true)); _acceptor->bind(endpoint, ec); if (ec) { - LOG_ERROR("asio tcp acceptor bind failed, error = {}", ec.message()); + LOG_ERROR( + "asio tcp acceptor bind address '{}' failed, error = {}", _address, ec.message()); _acceptor.reset(); return ERR_NETWORK_INIT_FAILED; } diff --git a/src/runtime/rpc/asio_net_provider.h b/src/rpc/asio_net_provider.h similarity index 96% rename from src/runtime/rpc/asio_net_provider.h rename to src/rpc/asio_net_provider.h index c26ce1b191..203dc5249e 100644 --- a/src/runtime/rpc/asio_net_provider.h +++ b/src/rpc/asio_net_provider.h @@ -34,11 +34,11 @@ #include "boost/asio/io_service.hpp" #include "boost/asio/ip/tcp.hpp" #include "boost/asio/ip/udp.hpp" -#include "runtime/rpc/message_parser.h" -#include "runtime/rpc/network.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/message_parser.h" +#include "rpc/network.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" #include "runtime/task/task_spec.h" #include "utils/error_code.h" #include "utils/synchronize.h" diff --git a/src/runtime/rpc/asio_rpc_session.cpp b/src/rpc/asio_rpc_session.cpp similarity index 99% rename from src/runtime/rpc/asio_rpc_session.cpp rename to src/rpc/asio_rpc_session.cpp index 331d0253e2..6cf7c6f808 100644 --- a/src/runtime/rpc/asio_rpc_session.cpp +++ b/src/rpc/asio_rpc_session.cpp @@ -58,8 +58,8 @@ // IWYU pragma: no_include "boost/asio/ip/impl/address_v4.ipp" // IWYU pragma: no_include "boost/asio/socket_base.hpp" // IWYU pragma: no_include "boost/system/error_code.hpp" -#include "runtime/rpc/asio_net_provider.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/asio_net_provider.h" +#include "rpc/rpc_address.h" #include "utils/autoref_ptr.h" #include "utils/fmt_logging.h" diff --git a/src/runtime/rpc/asio_rpc_session.h b/src/rpc/asio_rpc_session.h similarity index 97% rename from src/runtime/rpc/asio_rpc_session.h rename to src/rpc/asio_rpc_session.h index 7a7cda8b35..bf715fc448 100644 --- a/src/runtime/rpc/asio_rpc_session.h +++ b/src/rpc/asio_rpc_session.h @@ -30,8 +30,8 @@ #include #include "boost/asio/ip/tcp.hpp" -#include "runtime/rpc/message_parser.h" -#include "runtime/rpc/network.h" +#include "rpc/message_parser.h" +#include "rpc/network.h" namespace dsn { class message_ex; diff --git a/src/runtime/rpc/dns_resolver.cpp b/src/rpc/dns_resolver.cpp similarity index 97% rename from src/runtime/rpc/dns_resolver.cpp rename to src/rpc/dns_resolver.cpp index bfd7f5206d..9ddc10a7fe 100644 --- a/src/runtime/rpc/dns_resolver.cpp +++ b/src/rpc/dns_resolver.cpp @@ -20,14 +20,14 @@ #include #include #include +#include #include -#include #include "fmt/core.h" #include "fmt/format.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/group_address.h" -#include "runtime/rpc/group_host_port.h" +#include "rpc/dns_resolver.h" +#include "rpc/group_address.h" +#include "rpc/group_host_port.h" #include "utils/autoref_ptr.h" #include "utils/fmt_logging.h" #include "utils/ports.h" diff --git a/src/runtime/rpc/dns_resolver.h b/src/rpc/dns_resolver.h similarity index 97% rename from src/runtime/rpc/dns_resolver.h rename to src/rpc/dns_resolver.h index f173db212d..e80640c138 100644 --- a/src/runtime/rpc/dns_resolver.h +++ b/src/rpc/dns_resolver.h @@ -23,8 +23,8 @@ #include #include -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "utils/errors.h" #include "utils/metrics.h" #include "utils/singleton.h" diff --git a/src/runtime/rpc/dsn_message_parser.cpp b/src/rpc/dsn_message_parser.cpp similarity index 99% rename from src/runtime/rpc/dsn_message_parser.cpp rename to src/rpc/dsn_message_parser.cpp index 00dc6901eb..602db8a661 100644 --- a/src/runtime/rpc/dsn_message_parser.cpp +++ b/src/rpc/dsn_message_parser.cpp @@ -31,7 +31,7 @@ #include #include -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "runtime/task/task_code.h" #include "runtime/task/task_spec.h" #include "utils/blob.h" diff --git a/src/runtime/rpc/dsn_message_parser.h b/src/rpc/dsn_message_parser.h similarity index 98% rename from src/runtime/rpc/dsn_message_parser.h rename to src/rpc/dsn_message_parser.h index f458f7a61f..7dbcdf3404 100644 --- a/src/runtime/rpc/dsn_message_parser.h +++ b/src/rpc/dsn_message_parser.h @@ -26,7 +26,7 @@ #pragma once -#include "runtime/rpc/message_parser.h" +#include "rpc/message_parser.h" namespace dsn { class message_ex; diff --git a/src/runtime/rpc/group_address.h b/src/rpc/group_address.h similarity index 99% rename from src/runtime/rpc/group_address.h rename to src/rpc/group_address.h index 73475de008..916515c1fc 100644 --- a/src/runtime/rpc/group_address.h +++ b/src/rpc/group_address.h @@ -29,7 +29,7 @@ #include #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" #include "utils/api_utilities.h" #include "utils/autoref_ptr.h" #include "utils/fmt_logging.h" diff --git a/src/runtime/rpc/group_host_port.h b/src/rpc/group_host_port.h similarity index 98% rename from src/runtime/rpc/group_host_port.h rename to src/rpc/group_host_port.h index ae1181358e..199edffacf 100644 --- a/src/runtime/rpc/group_host_port.h +++ b/src/rpc/group_host_port.h @@ -22,8 +22,11 @@ #include #include -#include "runtime/rpc/group_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/group_address.h" +#include "rpc/rpc_host_port.h" +#include "rpc/group_address.h" +#include "rpc/group_host_port.h" +#include "rpc/rpc_host_port.h" #include "utils/autoref_ptr.h" #include "utils/fmt_logging.h" #include "utils/rand.h" diff --git a/src/runtime/rpc/message_parser.cpp b/src/rpc/message_parser.cpp similarity index 99% rename from src/runtime/rpc/message_parser.cpp rename to src/rpc/message_parser.cpp index e523635e99..33d2be542d 100644 --- a/src/runtime/rpc/message_parser.cpp +++ b/src/rpc/message_parser.cpp @@ -35,7 +35,7 @@ #include #include "message_parser_manager.h" -#include "runtime/rpc/message_parser.h" +#include "rpc/message_parser.h" #include "runtime/task/task_spec.h" #include "utils/blob.h" #include "utils/fmt_logging.h" diff --git a/src/runtime/rpc/message_parser.h b/src/rpc/message_parser.h similarity index 99% rename from src/runtime/rpc/message_parser.h rename to src/rpc/message_parser.h index 614e50f22d..0cb9e044a1 100644 --- a/src/runtime/rpc/message_parser.h +++ b/src/rpc/message_parser.h @@ -30,7 +30,7 @@ #include #include -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "runtime/task/task_spec.h" #include "utils/autoref_ptr.h" #include "utils/blob.h" diff --git a/src/runtime/rpc/message_parser_manager.h b/src/rpc/message_parser_manager.h similarity index 98% rename from src/runtime/rpc/message_parser_manager.h rename to src/rpc/message_parser_manager.h index 670deb9826..31622c6efe 100644 --- a/src/runtime/rpc/message_parser_manager.h +++ b/src/rpc/message_parser_manager.h @@ -26,7 +26,7 @@ #pragma once -#include "runtime/rpc/message_parser.h" +#include "rpc/message_parser.h" namespace dsn { class message_parser_manager : public utils::singleton diff --git a/src/runtime/rpc/network.cpp b/src/rpc/network.cpp similarity index 99% rename from src/runtime/rpc/network.cpp rename to src/rpc/network.cpp index 28b6a731cf..172674e820 100644 --- a/src/runtime/rpc/network.cpp +++ b/src/rpc/network.cpp @@ -35,8 +35,8 @@ #include #include "message_parser_manager.h" #include "runtime/api_task.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_engine.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_engine.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" #include "utils/blob.h" diff --git a/src/runtime/rpc/network.h b/src/rpc/network.h similarity index 99% rename from src/runtime/rpc/network.h rename to src/rpc/network.h index aca926743d..7139a2997b 100644 --- a/src/runtime/rpc/network.h +++ b/src/rpc/network.h @@ -32,10 +32,10 @@ #include #include +#include "rpc/message_parser.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" #include "rpc_address.h" -#include "runtime/rpc/message_parser.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" #include "runtime/task/task_spec.h" #include "utils/autoref_ptr.h" #include "utils/error_code.h" @@ -204,6 +204,7 @@ class connection_oriented_network : public network class rpc_client_matcher; class rpc_session : public ref_counter + { public: /*! diff --git a/src/runtime/rpc/network.sim.cpp b/src/rpc/network.sim.cpp similarity index 100% rename from src/runtime/rpc/network.sim.cpp rename to src/rpc/network.sim.cpp diff --git a/src/runtime/rpc/network.sim.h b/src/rpc/network.sim.h similarity index 94% rename from src/runtime/rpc/network.sim.h rename to src/rpc/network.sim.h index 1e26333444..3d1c99905c 100644 --- a/src/runtime/rpc/network.sim.h +++ b/src/rpc/network.sim.h @@ -28,11 +28,11 @@ #include -#include "runtime/rpc/message_parser.h" -#include "runtime/rpc/network.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/message_parser.h" +#include "rpc/network.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" #include "runtime/task/task_spec.h" #include "utils/error_code.h" diff --git a/src/runtime/rpc/raw_message_parser.cpp b/src/rpc/raw_message_parser.cpp similarity index 98% rename from src/runtime/rpc/raw_message_parser.cpp rename to src/rpc/raw_message_parser.cpp index dbe9f327e8..882c045432 100644 --- a/src/runtime/rpc/raw_message_parser.cpp +++ b/src/rpc/raw_message_parser.cpp @@ -32,8 +32,8 @@ #include "common/gpid.h" #include "network.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_message.h" #include "runtime/task/task_code.h" #include "runtime/task/task_spec.h" #include "utils/blob.h" diff --git a/src/runtime/rpc/raw_message_parser.h b/src/rpc/raw_message_parser.h similarity index 98% rename from src/runtime/rpc/raw_message_parser.h rename to src/rpc/raw_message_parser.h index c21f316c68..62e4389e20 100644 --- a/src/runtime/rpc/raw_message_parser.h +++ b/src/rpc/raw_message_parser.h @@ -27,7 +27,7 @@ #ifndef RAW_MESSAGE_PARSER_H #define RAW_MESSAGE_PARSER_H -#include "runtime/rpc/message_parser.h" +#include "rpc/message_parser.h" #include "runtime/task/task_spec.h" #include "utils/customizable_id.h" diff --git a/src/runtime/rpc/request_meta.thrift b/src/rpc/request_meta.thrift similarity index 100% rename from src/runtime/rpc/request_meta.thrift rename to src/rpc/request_meta.thrift diff --git a/src/runtime/rpc/rpc_address.cpp b/src/rpc/rpc_address.cpp similarity index 99% rename from src/runtime/rpc/rpc_address.cpp rename to src/rpc/rpc_address.cpp index 064dd458d5..29b015749a 100644 --- a/src/runtime/rpc/rpc_address.cpp +++ b/src/rpc/rpc_address.cpp @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" #include #include @@ -34,9 +34,9 @@ #include #include #include - #include -#include "runtime/rpc/group_address.h" + +#include "rpc/group_address.h" #include "utils/error_code.h" #include "utils/fixed_size_buffer_pool.h" #include "utils/fmt_logging.h" diff --git a/src/runtime/rpc/rpc_address.h b/src/rpc/rpc_address.h similarity index 100% rename from src/runtime/rpc/rpc_address.h rename to src/rpc/rpc_address.h diff --git a/src/runtime/rpc/rpc_engine.cpp b/src/rpc/rpc_engine.cpp similarity index 99% rename from src/runtime/rpc/rpc_engine.cpp rename to src/rpc/rpc_engine.cpp index 24eb71be54..e44f7154e2 100644 --- a/src/runtime/rpc/rpc_engine.cpp +++ b/src/rpc/rpc_engine.cpp @@ -33,12 +33,12 @@ #include #include "common/gpid.h" +#include "rpc/group_address.h" +#include "rpc/group_host_port.h" +#include "rpc/network.h" +#include "rpc/serialization.h" #include "runtime/api_layer1.h" #include "runtime/global_config.h" -#include "runtime/rpc/group_address.h" -#include "runtime/rpc/group_host_port.h" -#include "runtime/rpc/network.h" -#include "runtime/rpc/serialization.h" #include "runtime/service_engine.h" #include "utils/customizable_id.h" #include "utils/factory_store.h" diff --git a/src/runtime/rpc/rpc_engine.h b/src/rpc/rpc_engine.h similarity index 98% rename from src/runtime/rpc/rpc_engine.h rename to src/rpc/rpc_engine.h index 47980afbde..0e151aff31 100644 --- a/src/runtime/rpc/rpc_engine.h +++ b/src/rpc/rpc_engine.h @@ -34,10 +34,10 @@ #include #include "network.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" #include "runtime/api_task.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" #include "runtime/task/task_spec.h" @@ -50,10 +50,10 @@ namespace dsn { class rpc_engine; class service_node; -struct network_server_config; -struct service_app_spec; #define MAX_CLIENT_PORT 1023 +struct network_server_config; +struct service_app_spec; // // client matcher for matching RPC request and RPC response, and handling timeout diff --git a/src/runtime/rpc/rpc_holder.h b/src/rpc/rpc_holder.h similarity index 99% rename from src/runtime/rpc/rpc_holder.h rename to src/rpc/rpc_holder.h index b1e4af7b84..b639b59810 100644 --- a/src/runtime/rpc/rpc_holder.h +++ b/src/rpc/rpc_holder.h @@ -29,8 +29,8 @@ #include "dsn.layer2_types.h" #include "rpc_address.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" diff --git a/src/runtime/rpc/rpc_host_port.cpp b/src/rpc/rpc_host_port.cpp similarity index 98% rename from src/runtime/rpc/rpc_host_port.cpp rename to src/rpc/rpc_host_port.cpp index 42ed764010..d7e4bd2b60 100644 --- a/src/runtime/rpc/rpc_host_port.cpp +++ b/src/rpc/rpc_host_port.cpp @@ -28,8 +28,8 @@ #include #include "fmt/core.h" -#include "runtime/rpc/group_host_port.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/group_host_port.h" +#include "rpc/rpc_host_port.h" #include "utils/api_utilities.h" #include "utils/error_code.h" #include "utils/ports.h" diff --git a/src/runtime/rpc/rpc_host_port.h b/src/rpc/rpc_host_port.h similarity index 99% rename from src/runtime/rpc/rpc_host_port.h rename to src/rpc/rpc_host_port.h index 2a643bb4e0..42685efe86 100644 --- a/src/runtime/rpc/rpc_host_port.h +++ b/src/rpc/rpc_host_port.h @@ -31,7 +31,7 @@ #include -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" #include "utils/errors.h" #include "utils/fmt_logging.h" #include "utils/fmt_utils.h" diff --git a/src/runtime/rpc/rpc_message.cpp b/src/rpc/rpc_message.cpp similarity index 99% rename from src/runtime/rpc/rpc_message.cpp rename to src/rpc/rpc_message.cpp index 00412db721..394abf3ed4 100644 --- a/src/runtime/rpc/rpc_message.cpp +++ b/src/rpc/rpc_message.cpp @@ -34,9 +34,9 @@ #include #include "network.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" #include "utils/crc.h" #include "utils/flags.h" #include "utils/fmt_logging.h" diff --git a/src/runtime/rpc/rpc_message.h b/src/rpc/rpc_message.h similarity index 100% rename from src/runtime/rpc/rpc_message.h rename to src/rpc/rpc_message.h diff --git a/src/runtime/rpc/rpc_stream.h b/src/rpc/rpc_stream.h similarity index 99% rename from src/runtime/rpc/rpc_stream.h rename to src/rpc/rpc_stream.h index 62dfc82284..01afcd11e2 100644 --- a/src/runtime/rpc/rpc_stream.h +++ b/src/rpc/rpc_stream.h @@ -30,7 +30,7 @@ #include "runtime/api_layer1.h" #include "runtime/api_task.h" #include "runtime/app_model.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "runtime/task/task_code.h" #include "utils/api_utilities.h" #include "utils/binary_reader.h" diff --git a/src/runtime/rpc/rpc_task.cpp b/src/rpc/rpc_task.cpp similarity index 99% rename from src/runtime/rpc/rpc_task.cpp rename to src/rpc/rpc_task.cpp index 50b7e5e289..858bdc3543 100644 --- a/src/runtime/rpc/rpc_task.cpp +++ b/src/rpc/rpc_task.cpp @@ -30,7 +30,7 @@ #include "runtime/api_layer1.h" #include "runtime/api_task.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "runtime/service_engine.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" diff --git a/src/runtime/rpc/serialization.h b/src/rpc/serialization.h similarity index 97% rename from src/runtime/rpc/serialization.h rename to src/rpc/serialization.h index 7aa5738a11..c8cf50cc05 100644 --- a/src/runtime/rpc/serialization.h +++ b/src/rpc/serialization.h @@ -27,9 +27,9 @@ #pragma once #include "utils/utils.h" -#include "rpc_address.h" -#include "rpc_host_port.h" -#include "runtime/rpc/rpc_stream.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_stream.h" #include "common/serialization_helper/thrift_helper.h" namespace dsn { diff --git a/src/rpc/test/CMakeLists.txt b/src/rpc/test/CMakeLists.txt new file mode 100644 index 0000000000..5a1a30d01f --- /dev/null +++ b/src/rpc/test/CMakeLists.txt @@ -0,0 +1,30 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +set(MY_PROJ_NAME dsn_rpc_tests) +set(MY_PROJ_SRC "") +set(MY_SRC_SEARCH_MODE "GLOB") +set(MY_PROJ_LIBS + dsn_meta_server + dsn_replication_common + dsn_runtime + dsn_utils + gtest) +set(MY_BINPLACES + config.ini + run.sh) +dsn_add_test() diff --git a/src/runtime/test/address_test.cpp b/src/rpc/test/address_test.cpp similarity index 99% rename from src/runtime/test/address_test.cpp rename to src/rpc/test/address_test.cpp index 01edb34a07..cb6fc0db2c 100644 --- a/src/runtime/test/address_test.cpp +++ b/src/rpc/test/address_test.cpp @@ -36,8 +36,8 @@ #include #include "gtest/gtest.h" -#include "runtime/rpc/group_address.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/group_address.h" +#include "rpc/rpc_address.h" #include "utils/errors.h" namespace dsn { diff --git a/src/rpc/test/config.ini b/src/rpc/test/config.ini new file mode 100644 index 0000000000..5b8763e033 --- /dev/null +++ b/src/rpc/test/config.ini @@ -0,0 +1,125 @@ +; Licensed to the Apache Software Foundation (ASF) under one +; or more contributor license agreements. See the NOTICE file +; distributed with this work for additional information +; regarding copyright ownership. The ASF licenses this file +; to you under the Apache License, Version 2.0 (the +; "License"); you may not use this file except in compliance +; with the License. You may obtain a copy of the License at +; +; http://www.apache.org/licenses/LICENSE-2.0 +; +; Unless required by applicable law or agreed to in writing, +; software distributed under the License is distributed on an +; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +; KIND, either express or implied. See the License for the +; specific language governing permissions and limitations +; under the License. + +[apps..default] +run = true +count = 1 + +[apps.client] +type = test +arguments = localhost 20101 +run = true +ports = 20001 +count = 1 +pools = THREAD_POOL_DEFAULT, THREAD_POOL_TEST_SERVER + +[apps.server] +type = test +arguments = +ports = 20101,20102 +run = true +count = 1 +pools = THREAD_POOL_DEFAULT, THREAD_POOL_TEST_SERVER + +[apps.server_group] +type = test +arguments = +ports = 20201 +run = true +count = 3 +pools = THREAD_POOL_DEFAULT, THREAD_POOL_TEST_SERVER + +[apps.server_not_run] +type = test +arguments = +ports = 20301 +run = false +count = 1 +pools = THREAD_POOL_DEFAULT, THREAD_POOL_TEST_SERVER + +[core] +tool = nativerun +toollets = tracer, profiler, fault_injector +pause_on_start = false +logging_start_level = LOG_LEVEL_DEBUG +logging_factory_name = dsn::tools::screen_logger + +[tools.simulator] +random_seed = 0 + +[network] +; how many network threads for network library (used by asio) +io_service_worker_count = 2 + +[task..default] +is_trace = true +is_profile = true +allow_inline = false +rpc_call_channel = RPC_CHANNEL_TCP +rpc_message_header_format = dsn +rpc_timeout_milliseconds = 1000 + +[task.RPC_TEST_HASH1_ACK] +is_trace = true +rpc_message_crc_required = true +rpc_request_drop_ratio = 0 +rpc_timeout_milliseconds = 1000 +rpc_request_data_corrupted_ratio = 1 +rpc_message_data_corrupted_type = header + +[task.RPC_TEST_HASH2_ACK] +is_trace = true +rpc_message_crc_required = true +rpc_request_drop_ratio = 0 +rpc_timeout_milliseconds = 1000 +rpc_request_data_corrupted_ratio = 1 +rpc_message_data_corrupted_type = body + +[task.RPC_TEST_HASH3_ACK] +is_trace = true +rpc_message_crc_required = true +rpc_response_drop_ratio = 0 +rpc_timeout_milliseconds = 1000 +rpc_response_data_corrupted_ratio = 1 +rpc_message_data_corrupted_type = header + +[task.RPC_TEST_HASH4_ACK] +is_trace = true +rpc_message_crc_required = true +rpc_response_drop_ratio = 0 +rpc_timeout_milliseconds = 1000 +rpc_response_data_corrupted_ratio = 1 +rpc_message_data_corrupted_type = body + +[task.LPC_RPC_TIMEOUT] +is_trace = false +is_profile = false + +[task.RPC_TEST_UDP] +rpc_call_channel = RPC_CHANNEL_UDP +rpc_message_crc_required = true + +; specification for each thread pool +[threadpool..default] +worker_count = 2 + +[threadpool.THREAD_POOL_DEFAULT] +partitioned = false +worker_priority = THREAD_xPRIORITY_NORMAL + +[threadpool.THREAD_POOL_TEST_SERVER] +partitioned = false diff --git a/src/runtime/test/corrupt_message.cpp b/src/rpc/test/corrupt_message_test.cpp similarity index 70% rename from src/runtime/test/corrupt_message.cpp rename to src/rpc/test/corrupt_message_test.cpp index c4f45b4b0e..74a82671c6 100644 --- a/src/runtime/test/corrupt_message.cpp +++ b/src/rpc/test/corrupt_message_test.cpp @@ -28,34 +28,27 @@ #include #include #include +#include #include "gtest/gtest.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" #include "runtime/task/async_calls.h" +#include "runtime/task/task_code.h" #include "runtime/test_utils.h" #include "utils/error_code.h" // TODO(yingchun): the tests are failed because the fault injector is not work well as expected. // Now just disable the tests before we fix it. // this only works with the fault injector -TEST(core, DISABLED_corrupt_message) +TEST(corrupt_message_test, DISABLED_basic) { int req = 0; const auto server = dsn::rpc_address::from_host_port("localhost", 20101); - - auto result = ::dsn::rpc::call_wait( - server, RPC_TEST_HASH1, req, std::chrono::milliseconds(0), 1); - ASSERT_EQ(result.first, dsn::ERR_TIMEOUT); - - result = ::dsn::rpc::call_wait( - server, RPC_TEST_HASH2, req, std::chrono::milliseconds(0), 1); - ASSERT_EQ(result.first, dsn::ERR_TIMEOUT); - - result = ::dsn::rpc::call_wait( - server, RPC_TEST_HASH3, req, std::chrono::milliseconds(0), 1); - ASSERT_EQ(result.first, dsn::ERR_TIMEOUT); - - result = ::dsn::rpc::call_wait( - server, RPC_TEST_HASH4, req, std::chrono::milliseconds(0), 1); - ASSERT_EQ(result.first, dsn::ERR_TIMEOUT); + std::vector codes( + {RPC_TEST_HASH1, RPC_TEST_HASH2, RPC_TEST_HASH3, RPC_TEST_HASH4}); + for (const auto &code : codes) { + const auto result = + ::dsn::rpc::call_wait(server, code, req, std::chrono::milliseconds(1), 1); + EXPECT_EQ(dsn::ERR_TIMEOUT, result.first) << code; + } } diff --git a/src/runtime/test/host_port_test.cpp b/src/rpc/test/host_port_test.cpp similarity index 98% rename from src/runtime/test/host_port_test.cpp rename to src/rpc/test/host_port_test.cpp index 70d3699e1e..11bdb2ce36 100644 --- a/src/runtime/test/host_port_test.cpp +++ b/src/rpc/test/host_port_test.cpp @@ -31,13 +31,13 @@ #include "fd_types.h" #include "gtest/gtest.h" #include "meta_admin_types.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/group_address.h" -#include "runtime/rpc/group_host_port.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/dns_resolver.h" +#include "rpc/group_address.h" +#include "rpc/group_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "runtime/task/task_spec.h" diff --git a/src/rpc/test/main.cpp b/src/rpc/test/main.cpp new file mode 100644 index 0000000000..e43ee68ee5 --- /dev/null +++ b/src/rpc/test/main.cpp @@ -0,0 +1,43 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include +#include +#include + +#include "runtime/app_model.h" +#include "runtime/service_app.h" +#include "runtime/test_utils.h" + +int g_test_count = 0; +int g_test_ret = 0; + +GTEST_API_ int main(int argc, char **argv) +{ + testing::InitGoogleTest(&argc, argv); + + dsn::service_app::register_factory("test"); + dsn_run(argc, argv, false); + while (g_test_count == 0) { + std::this_thread::sleep_for(std::chrono::seconds(1)); + } + +#ifndef ENABLE_GCOV + dsn_exit(g_test_ret); +#endif + return g_test_ret; +} diff --git a/src/runtime/test/message_reader_test.cpp b/src/rpc/test/message_reader_test.cpp similarity index 98% rename from src/runtime/test/message_reader_test.cpp rename to src/rpc/test/message_reader_test.cpp index 515dcf8370..3dcf1e2840 100644 --- a/src/runtime/test/message_reader_test.cpp +++ b/src/rpc/test/message_reader_test.cpp @@ -19,7 +19,7 @@ #include #include "gtest/gtest.h" -#include "runtime/rpc/message_parser.h" +#include "rpc/message_parser.h" #include "utils/blob.h" namespace dsn { diff --git a/src/runtime/test/message_utils_test.cpp b/src/rpc/test/message_utils_test.cpp similarity index 92% rename from src/runtime/test/message_utils_test.cpp rename to src/rpc/test/message_utils_test.cpp index 7d280db8b6..cffd9b6bfd 100644 --- a/src/runtime/test/message_utils_test.cpp +++ b/src/rpc/test/message_utils_test.cpp @@ -32,8 +32,8 @@ #include "common/replication.codes.h" #include "dsn.layer2_types.h" #include "gtest/gtest.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_message.h" #include "utils/autoref_ptr.h" #include "utils/threadpool_code.h" @@ -43,7 +43,7 @@ DEFINE_TASK_CODE_RPC(RPC_CODE_FOR_TEST, TASK_PRIORITY_COMMON, THREAD_POOL_DEFAUL typedef rpc_holder t_rpc; -TEST(message_utils, msg_blob_convertion) +TEST(message_utils_test, msg_blob_convertion) { std::string data = "hello"; @@ -54,7 +54,7 @@ TEST(message_utils, msg_blob_convertion) ASSERT_EQ(b.to_string(), move_message_to_blob(m.get()).to_string()); } -TEST(message_utils, thrift_msg_convertion) +TEST(message_utils_test, thrift_msg_convertion) { query_cfg_request request; request.app_name = "haha"; @@ -66,7 +66,7 @@ TEST(message_utils, thrift_msg_convertion) ASSERT_EQ(rpc.request().app_name, "haha"); } -TEST(message_utils, complex_convertion) +TEST(message_utils_test, complex_convertion) { query_cfg_request request; request.app_name = "haha"; diff --git a/src/runtime/test/netprovider.cpp b/src/rpc/test/net_provider_test.cpp similarity index 95% rename from src/runtime/test/netprovider.cpp rename to src/rpc/test/net_provider_test.cpp index 4de70ed00e..fd92420160 100644 --- a/src/runtime/test/netprovider.cpp +++ b/src/rpc/test/net_provider_test.cpp @@ -35,13 +35,13 @@ #include "runtime/api_layer1.h" #include "runtime/api_task.h" #include "runtime/global_config.h" -#include "runtime/rpc/asio_net_provider.h" -#include "runtime/rpc/network.h" -#include "runtime/rpc/network.sim.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_engine.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/asio_net_provider.h" +#include "rpc/network.h" +#include "rpc/network.sim.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_engine.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/service_engine.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" @@ -133,7 +133,7 @@ void rpc_client_session_send(rpc_session_ptr client_session, bool reject = false wait_response(); } -TEST(tools_common, asio_net_provider) +TEST(net_provider_test, asio_net_provider) { if (dsn::service_engine::instance().spec().semaphore_factory_name == "dsn::tools::sim_semaphore_provider") @@ -180,7 +180,7 @@ TEST(tools_common, asio_net_provider) TEST_PORT++; } -TEST(tools_common, asio_udp_provider) +TEST(net_provider_test, asio_udp_provider) { if (dsn::service_engine::instance().spec().semaphore_factory_name == "dsn::tools::sim_semaphore_provider") @@ -223,7 +223,7 @@ TEST(tools_common, asio_udp_provider) TEST_PORT++; } -TEST(tools_common, sim_net_provider) +TEST(net_provider_test, sim_net_provider) { if (dsn::service_engine::instance().spec().semaphore_factory_name == "dsn::tools::sim_semaphore_provider") @@ -253,7 +253,7 @@ TEST(tools_common, sim_net_provider) TEST_PORT++; } -TEST(tools_common, asio_network_provider_connection_threshold) +TEST(net_provider_test, asio_network_provider_connection_threshold) { if (dsn::service_engine::instance().spec().semaphore_factory_name == "dsn::tools::sim_semaphore_provider") diff --git a/src/runtime/test/rpc_holder_test.cpp b/src/rpc/test/rpc_holder_test.cpp similarity index 95% rename from src/runtime/test/rpc_holder_test.cpp rename to src/rpc/test/rpc_holder_test.cpp index 88eb3b31e5..37a7bea11a 100644 --- a/src/runtime/test/rpc_holder_test.cpp +++ b/src/rpc/test/rpc_holder_test.cpp @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_holder.h" #include #include @@ -33,7 +33,7 @@ #include "common/serialization_helper/dsn.layer2_types.h" #include "gtest/gtest.h" #include "runtime/message_utils.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" #include "utils/threadpool_code.h" using namespace dsn; @@ -44,13 +44,13 @@ DEFINE_TASK_CODE_RPC(RPC_CM_QUERY_PARTITION_CONFIG_BY_INDEX, TASK_PRIORITY_COMMON, THREAD_POOL_DEFAULT) -TEST(rpc_holder, type_traits) +TEST(rpc_holder_test, type_traits) { ASSERT_FALSE(is_rpc_holder::value); ASSERT_TRUE(is_rpc_holder::value); } -TEST(rpc_holder, construct) +TEST(rpc_holder_test, construct) { { t_rpc rpc; @@ -90,7 +90,7 @@ TEST(rpc_holder, construct) } } -TEST(rpc_holder, mock_rpc_call) +TEST(rpc_holder_test, mock_rpc_call) { RPC_MOCKING(t_rpc) { @@ -140,7 +140,7 @@ TEST(rpc_holder, mock_rpc_call) } } -TEST(rpc_holder, mock_rpc_reply) +TEST(rpc_holder_test, mock_rpc_reply) { RPC_MOCKING(t_rpc) { @@ -160,7 +160,7 @@ TEST(rpc_holder, mock_rpc_reply) } } -TEST(rpc_holder, mock_rpc_forward) +TEST(rpc_holder_test, mock_rpc_forward) { RPC_MOCKING(t_rpc) { diff --git a/src/runtime/test/rpc_message.cpp b/src/rpc/test/rpc_message_test.cpp similarity index 96% rename from src/runtime/test/rpc_message.cpp rename to src/rpc/test/rpc_message_test.cpp index 3c87913938..d3a710dd0f 100644 --- a/src/runtime/test/rpc_message.cpp +++ b/src/rpc/test/rpc_message_test.cpp @@ -35,9 +35,9 @@ #include "gtest/gtest.h" #include "runtime/message_utils.cpp" #include "runtime/message_utils.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/task/task_code.h" #include "runtime/task/task_spec.h" #include "utils/autoref_ptr.h" @@ -49,7 +49,7 @@ using namespace ::dsn; DEFINE_TASK_CODE_RPC(RPC_CODE_FOR_TEST, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT) -TEST(core, message_ex) +TEST(rpc_message_test, message_ex) { msg_context_t ctx0, ctx1; ctx0.context = 0; @@ -192,7 +192,7 @@ TEST(core, message_ex) } } -TEST(rpc_message, restore_read) +TEST(rpc_message_test, restore_read) { using namespace dsn; query_cfg_request request, result; @@ -203,7 +203,7 @@ TEST(rpc_message, restore_read) } } -TEST(rpc_message, create_receive_message_with_standalone_header) +TEST(rpc_message_test, create_receive_message_with_standalone_header) { auto data = blob::create_from_bytes("10086"); @@ -213,7 +213,7 @@ TEST(rpc_message, create_receive_message_with_standalone_header) ASSERT_EQ(msg->header->body_length, data.length()); } -TEST(rpc_message, copy_message_no_reply) +TEST(rpc_message_test, copy_message_no_reply) { auto data = blob::create_from_bytes("10086"); message_ptr old_msg = message_ex::create_receive_message_with_standalone_header(data); diff --git a/src/runtime/test/rpc.cpp b/src/rpc/test/rpc_test.cpp similarity index 96% rename from src/runtime/test/rpc.cpp rename to src/rpc/test/rpc_test.cpp index 3682ca5789..80fc8bba7d 100644 --- a/src/runtime/test/rpc.cpp +++ b/src/rpc/test/rpc_test.cpp @@ -32,11 +32,11 @@ #include #include "gtest/gtest.h" -#include "runtime/rpc/group_address.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/group_address.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "runtime/test_utils.h" @@ -61,7 +61,7 @@ static dsn::rpc_address build_group() return server_group; } -TEST(core, rpc) +TEST(rpc_test, rpc) { int req = 0; const auto server = ::dsn::rpc_address::from_host_port("localhost", 20101); @@ -74,7 +74,7 @@ TEST(core, rpc) "server.THREAD_POOL_TEST_SERVER"); } -TEST(core, group_address_talk_to_others) +TEST(rpc_test, group_address_talk_to_others) { ::dsn::rpc_address addr = build_group(); @@ -93,7 +93,7 @@ TEST(core, group_address_talk_to_others) resp->wait(); } -TEST(core, group_address_change_leader) +TEST(rpc_test, group_address_change_leader) { ::dsn::rpc_address addr = build_group(); @@ -200,7 +200,7 @@ static void send_message(::dsn::rpc_address addr, } } -TEST(core, group_address_no_response_2) +TEST(rpc_test, group_address_no_response_2) { ::dsn::rpc_address addr = build_group(); rpc_reply_handler action_on_succeed = @@ -222,7 +222,7 @@ TEST(core, group_address_no_response_2) send_message(addr, std::string("expect_no_reply"), 1, action_on_succeed, action_on_failure); } -TEST(core, send_to_invalid_address) +TEST(rpc_test, send_to_invalid_address) { ::dsn::rpc_address group = build_group(); /* here we assume 127.0.0.1:32766 is not assigned */ diff --git a/src/rpc/test/run.sh b/src/rpc/test/run.sh new file mode 100755 index 0000000000..be3542e599 --- /dev/null +++ b/src/rpc/test/run.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +if [ -z "${REPORT_DIR}" ]; then + REPORT_DIR="." +fi + +rm -rf data dsn_rpc_tests.xml +output_xml="${REPORT_DIR}/dsn_rpc_tests.xml" +GTEST_OUTPUT="xml:${output_xml}" ./dsn_rpc_tests config.ini diff --git a/src/runtime/test/thrift_message_parser_test.cpp b/src/rpc/test/thrift_message_parser_test.cpp similarity index 99% rename from src/runtime/test/thrift_message_parser_test.cpp rename to src/rpc/test/thrift_message_parser_test.cpp index 722b2860b6..6c78a18d30 100644 --- a/src/runtime/test/thrift_message_parser_test.cpp +++ b/src/rpc/test/thrift_message_parser_test.cpp @@ -28,10 +28,10 @@ #include "common/serialization_helper/thrift_helper.h" #include "gtest/gtest.h" #include "request_meta_types.h" -#include "runtime/rpc/message_parser.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/rpc_stream.h" -#include "runtime/rpc/thrift_message_parser.h" +#include "rpc/message_parser.h" +#include "rpc/rpc_message.h" +#include "rpc/rpc_stream.h" +#include "rpc/thrift_message_parser.h" #include "runtime/task/task_code.h" #include "runtime/task/task_spec.h" #include "utils/autoref_ptr.h" diff --git a/src/runtime/rpc/thrift_message_parser.cpp b/src/rpc/thrift_message_parser.cpp similarity index 99% rename from src/runtime/rpc/thrift_message_parser.cpp rename to src/rpc/thrift_message_parser.cpp index d547075025..e9731413b7 100644 --- a/src/runtime/rpc/thrift_message_parser.cpp +++ b/src/rpc/thrift_message_parser.cpp @@ -34,8 +34,8 @@ #include "boost/smart_ptr/shared_ptr.hpp" #include "common/gpid.h" #include "common/serialization_helper/thrift_helper.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/rpc_stream.h" +#include "rpc/rpc_message.h" +#include "rpc/rpc_stream.h" #include "thrift/protocol/TBinaryProtocol.h" #include "thrift/protocol/TBinaryProtocol.tcc" #include "thrift/protocol/TProtocol.h" diff --git a/src/runtime/rpc/thrift_message_parser.h b/src/rpc/thrift_message_parser.h similarity index 99% rename from src/runtime/rpc/thrift_message_parser.h rename to src/rpc/thrift_message_parser.h index dc76e41dd4..c295d4bb5c 100644 --- a/src/runtime/rpc/thrift_message_parser.h +++ b/src/rpc/thrift_message_parser.h @@ -31,7 +31,7 @@ #include #include "request_meta_types.h" -#include "runtime/rpc/message_parser.h" +#include "rpc/message_parser.h" #include "runtime/task/task_spec.h" #include "utils/customizable_id.h" diff --git a/src/runtime/CMakeLists.txt b/src/runtime/CMakeLists.txt index 6527ffb17f..ab4f11175f 100644 --- a/src/runtime/CMakeLists.txt +++ b/src/runtime/CMakeLists.txt @@ -23,12 +23,10 @@ # THE SOFTWARE. add_subdirectory(test) -add_subdirectory(rpc) add_subdirectory(task) # TODO(zlw) remove perf_counter from dsn_runtime after the refactor by WuTao add_library(dsn_runtime STATIC - $ $ $ core_main.cpp @@ -48,6 +46,6 @@ add_library(dsn_runtime STATIC tool_api.cpp tracer.cpp zlocks.cpp) -target_link_libraries(dsn_runtime PRIVATE dsn_security dsn_utils sasl2 gssapi_krb5 krb5) +target_link_libraries(dsn_runtime PRIVATE dsn_rpc dsn_security dsn_utils sasl2 gssapi_krb5 krb5) define_file_basename_for_sources(dsn_runtime) install(TARGETS dsn_runtime DESTINATION "lib") diff --git a/src/runtime/api_layer1.h b/src/runtime/api_layer1.h index 6c2d675a13..6734c359f7 100644 --- a/src/runtime/api_layer1.h +++ b/src/runtime/api_layer1.h @@ -32,8 +32,8 @@ #include "runtime/api_task.h" #include "common/gpid.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "runtime/task/task_tracker.h" /*! diff --git a/src/runtime/fault_injector.cpp b/src/runtime/fault_injector.cpp index c7d54e192f..85b9e38884 100644 --- a/src/runtime/fault_injector.cpp +++ b/src/runtime/fault_injector.cpp @@ -34,7 +34,7 @@ #include "aio/aio_task.h" #include "fmt/core.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" #include "runtime/task/task_spec.h" diff --git a/src/runtime/message_utils.cpp b/src/runtime/message_utils.cpp index 35bd29c778..65c9459e26 100644 --- a/src/runtime/message_utils.cpp +++ b/src/runtime/message_utils.cpp @@ -28,7 +28,7 @@ #include -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" namespace dsn { diff --git a/src/runtime/message_utils.h b/src/runtime/message_utils.h index 954b54cd2f..bffcfeae51 100644 --- a/src/runtime/message_utils.h +++ b/src/runtime/message_utils.h @@ -19,7 +19,7 @@ #include -#include "runtime/rpc/rpc_stream.h" +#include "rpc/rpc_stream.h" #include "runtime/task/task_code.h" #include "runtime/task/task_spec.h" #include "thrift_helper.h" diff --git a/src/runtime/profiler.cpp b/src/runtime/profiler.cpp index 2228cc35b3..d4607dfdd6 100644 --- a/src/runtime/profiler.cpp +++ b/src/runtime/profiler.cpp @@ -62,7 +62,7 @@ START<== queue(server) == ENQUEUE <===== net(reply) ======= REPLY <============= #include "fmt/core.h" #include "profiler_header.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" #include "runtime/task/task_spec.h" diff --git a/src/runtime/providers.common.cpp b/src/runtime/providers.common.cpp index 17a8b195d7..007e016cd2 100644 --- a/src/runtime/providers.common.cpp +++ b/src/runtime/providers.common.cpp @@ -28,11 +28,11 @@ #include "runtime/env_provider.h" #include "runtime/providers.common.h" -#include "runtime/rpc/asio_net_provider.h" -#include "runtime/rpc/dsn_message_parser.h" -#include "runtime/rpc/network.sim.h" -#include "runtime/rpc/raw_message_parser.h" -#include "runtime/rpc/thrift_message_parser.h" +#include "rpc/asio_net_provider.h" +#include "rpc/dsn_message_parser.h" +#include "rpc/network.sim.h" +#include "rpc/raw_message_parser.h" +#include "rpc/thrift_message_parser.h" #include "runtime/task/hpc_task_queue.h" #include "runtime/task/simple_task_queue.h" #include "runtime/task/task_spec.h" diff --git a/src/runtime/rpc/CMakeLists.txt b/src/runtime/rpc/CMakeLists.txt deleted file mode 100644 index 08de0852f6..0000000000 --- a/src/runtime/rpc/CMakeLists.txt +++ /dev/null @@ -1,45 +0,0 @@ -# The MIT License (MIT) -# -# Copyright (c) 2015 Microsoft Corporation -# -# -=- Robust Distributed System Nucleus (rDSN) -=- -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -set(MY_PROJ_NAME dsn.rpc) - -# Search mode for source files under CURRENT project directory? -# "GLOB_RECURSE" for recursive search -# "GLOB" for non-recursive search -set(MY_SRC_SEARCH_MODE "GLOB") - -set(MY_PROJ_LIBS "") - -# Extra files that will be installed -set(MY_BINPLACES "") - -thrift_generate_cpp( - REQUEST_META_THRIFT_SRCS - REQUEST_META_THRIFT_HDRS - ${CMAKE_CURRENT_SOURCE_DIR}/request_meta.thrift -) - -set(MY_PROJ_SRC ${REQUEST_META_THRIFT_SRCS}) - -dsn_add_object() diff --git a/src/runtime/serverlet.h b/src/runtime/serverlet.h index 90ff8e2e1f..e5a7df0b38 100644 --- a/src/runtime/serverlet.h +++ b/src/runtime/serverlet.h @@ -27,8 +27,8 @@ #pragma once #include "runtime/service_app.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/serialization.h" +#include "rpc/rpc_holder.h" +#include "rpc/serialization.h" namespace dsn { /*! diff --git a/src/runtime/service_api_c.cpp b/src/runtime/service_api_c.cpp index f4ed022344..64b6bb66c3 100644 --- a/src/runtime/service_api_c.cpp +++ b/src/runtime/service_api_c.cpp @@ -47,14 +47,14 @@ #include "fmt/core.h" #include "fmt/format.h" #include "perf_counter/perf_counters.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_engine.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_message.h" #include "runtime/api_layer1.h" #include "runtime/api_task.h" #include "runtime/app_model.h" #include "runtime/global_config.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_engine.h" -#include "runtime/rpc/rpc_host_port.h" -#include "runtime/rpc/rpc_message.h" #include "runtime/service_app.h" #include "runtime/service_engine.h" #include "runtime/task/task.h" diff --git a/src/runtime/service_app.h b/src/runtime/service_app.h index 71e23fc6d7..b8e62d1659 100644 --- a/src/runtime/service_app.h +++ b/src/runtime/service_app.h @@ -34,7 +34,8 @@ #include "utils/threadpool_code.h" #include "runtime/task/task_code.h" #include "common/gpid.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" +#include "rpc/rpc_address.h" #include "common/gpid.h" #include "utils/factory_store.h" #include diff --git a/src/runtime/service_engine.cpp b/src/runtime/service_engine.cpp index dee8a53342..defc3f5794 100644 --- a/src/runtime/service_engine.cpp +++ b/src/runtime/service_engine.cpp @@ -36,8 +36,8 @@ #include "fmt/core.h" #include "nlohmann/json.hpp" #include "runtime/node_scoper.h" -#include "runtime/rpc/rpc_engine.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_engine.h" +#include "rpc/rpc_message.h" #include "runtime/task/task.h" #include "runtime/task/task_engine.h" #include "runtime/task/task_spec.h" diff --git a/src/runtime/task/async_calls.h b/src/runtime/task/async_calls.h index 4d279a613e..3a01d1d1c9 100644 --- a/src/runtime/task/async_calls.h +++ b/src/runtime/task/async_calls.h @@ -33,7 +33,7 @@ #include "utils/function_traits.h" #include "aio/file_io.h" #include "runtime/task/task_tracker.h" -#include "runtime/rpc/serialization.h" +#include "rpc/serialization.h" namespace dsn { diff --git a/src/runtime/task/task.h b/src/runtime/task/task.h index 68b41bf625..fe27e6b007 100644 --- a/src/runtime/task/task.h +++ b/src/runtime/task/task.h @@ -38,7 +38,7 @@ #include "runtime/api_layer1.h" #include "runtime/api_task.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "runtime/task/task_code.h" #include "task_spec.h" #include "task_tracker.h" diff --git a/src/runtime/task/task_queue.cpp b/src/runtime/task/task_queue.cpp index b22e01bdb8..be54bdf25f 100644 --- a/src/runtime/task/task_queue.cpp +++ b/src/runtime/task/task_queue.cpp @@ -28,9 +28,9 @@ #include #include "fmt/core.h" -#include "runtime/rpc/network.h" -#include "runtime/rpc/rpc_engine.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/network.h" +#include "rpc/rpc_engine.h" +#include "rpc/rpc_message.h" #include "runtime/task/task.h" #include "runtime/task/task_spec.h" #include "task_engine.h" diff --git a/src/runtime/task/task_spec.cpp b/src/runtime/task/task_spec.cpp index 096b0bd1b0..d760de6c44 100644 --- a/src/runtime/task/task_spec.cpp +++ b/src/runtime/task/task_spec.cpp @@ -31,7 +31,7 @@ #include #include -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "utils/flags.h" #include "utils/fmt_logging.h" #include "utils/threadpool_spec.h" diff --git a/src/runtime/test/CMakeLists.txt b/src/runtime/test/CMakeLists.txt index 063fffda60..92316efd39 100644 --- a/src/runtime/test/CMakeLists.txt +++ b/src/runtime/test/CMakeLists.txt @@ -36,7 +36,6 @@ set(MY_PROJ_LIBS gtest) set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES - config-test-corrupt-message.ini config-test.ini config-test-sim.ini command.txt diff --git a/src/runtime/test/async_call.cpp b/src/runtime/test/async_call.cpp index 7a32736ba2..e98c36cf63 100644 --- a/src/runtime/test/async_call.cpp +++ b/src/runtime/test/async_call.cpp @@ -36,8 +36,8 @@ #include "gtest/gtest.h" #include "runtime/api_task.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_message.h" #include "runtime/task/async_calls.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" diff --git a/src/runtime/test/config-test-corrupt-message.ini b/src/runtime/test/config-test-corrupt-message.ini deleted file mode 100644 index 3ecf76ff7f..0000000000 --- a/src/runtime/test/config-test-corrupt-message.ini +++ /dev/null @@ -1,141 +0,0 @@ -; The MIT License (MIT) -; -; Copyright (c) 2015 Microsoft Corporation -; -; -=- Robust Distributed System Nucleus (rDSN) -=- -; -; Permission is hereby granted, free of charge, to any person obtaining a copy -; of this software and associated documentation files (the "Software"), to deal -; in the Software without restriction, including without limitation the rights -; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -; copies of the Software, and to permit persons to whom the Software is -; furnished to do so, subject to the following conditions: -; -; The above copyright notice and this permission notice shall be included in -; all copies or substantial portions of the Software. -; -; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -; THE SOFTWARE. - -[apps..default] -run = true -count = 1 -network.client.RPC_CHANNEL_TCP = dsn::tools::asio_network_provider, 65536 -network.client.RPC_CHANNEL_UDP = dsn::tools::asio_udp_provider, 65536 -network.server.0.RPC_CHANNEL_TCP = dsn::tools::asio_network_provider, 65536 -network.server.0.RPC_CHANNEL_UDP = dsn::tools::asio_udp_provider, 65536 - -[apps.client] -type = test -arguments = localhost 20101 -run = true -ports = 20001 -count = 1 -delay_seconds = 1 -pools = THREAD_POOL_DEFAULT, THREAD_POOL_TEST_SERVER, THREAD_POOL_FOR_TEST_1, THREAD_POOL_FOR_TEST_2 - -[apps.server] -type = test -arguments = -ports = 20101,20102 -run = true -count = 1 -pools = THREAD_POOL_DEFAULT, THREAD_POOL_TEST_SERVER -network.client.RPC_CHANNEL_TCP = dsn::tools::asio_network_provider,65536 -network.server.20101.RPC_CHANNEL_TCP = dsn::tools::asio_network_provider,65536 -network.server.20102.RPC_CHANNEL_TCP = dsn::tools::asio_network_provider,65536 -network.server.20103.RPC_CHANNEL_TCP = dsn::tools::asio_network_provider,65536 - -[core] -;tool = simulator -tool = nativerun - -toollets = fault_injector -pause_on_start = false - -logging_start_level = LOG_LEVEL_DEBUG -logging_factory_name = dsn::tools::simple_logger - - - - -[tools.simple_logger] -fast_flush = true -short_header = false -stderr_start_level = LOG_LEVEL_FATAL - -[tools.simulator] -random_seed = 0 - -[network] -; how many network threads for network library (used by asio) -io_service_worker_count = 2 - -[task..default] -is_trace = true -is_profile = true -allow_inline = false -rpc_call_channel = RPC_CHANNEL_TCP -rpc_message_header_format = dsn -rpc_timeout_milliseconds = 1000 - -[task.RPC_TEST_HASH1] -is_trace = true -rpc_message_crc_required = true -rpc_request_drop_ratio = 0 -rpc_timeout_milliseconds = 1000 -rpc_request_data_corrupted_ratio = 1 -rpc_message_data_corrupted_type = header - -[task.RPC_TEST_HASH2] -is_trace = true -rpc_message_crc_required = true -rpc_request_drop_ratio = 0 -rpc_timeout_milliseconds = 1000 -rpc_request_data_corrupted_ratio = 1 -rpc_message_data_corrupted_type = body - -[task.RPC_TEST_HASH3_ACK] -is_trace = true -rpc_message_crc_required = true -rpc_response_drop_ratio = 0 -rpc_timeout_milliseconds = 1000 -rpc_response_data_corrupted_ratio = 1 -rpc_message_data_corrupted_type = header - -[task.RPC_TEST_HASH4_ACK] -is_trace = true -rpc_message_crc_required = true -rpc_response_drop_ratio = 0 -rpc_timeout_milliseconds = 1000 -rpc_response_data_corrupted_ratio = 1 -rpc_message_data_corrupted_type = body - -[task.LPC_AIO_IMMEDIATE_CALLBACK] -is_trace = false -is_profile = false -allow_inline = false - -[task.LPC_RPC_TIMEOUT] -is_trace = false -is_profile = false - -[task.RPC_TEST_UDP] -rpc_call_channel = RPC_CHANNEL_UDP -rpc_message_crc_required = true - -; specification for each thread pool -[threadpool..default] -worker_count = 2 - -[threadpool.THREAD_POOL_DEFAULT] -partitioned = false -worker_priority = THREAD_xPRIORITY_NORMAL - -[threadpool.THREAD_POOL_TEST_SERVER] -partitioned = false diff --git a/src/runtime/test/dns_resolver_test.cpp b/src/runtime/test/dns_resolver_test.cpp index 86a0cc7e17..4e4ec57b2b 100644 --- a/src/runtime/test/dns_resolver_test.cpp +++ b/src/runtime/test/dns_resolver_test.cpp @@ -21,11 +21,11 @@ #include #include "gtest/gtest.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/group_address.h" -#include "runtime/rpc/group_host_port.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/dns_resolver.h" +#include "rpc/group_address.h" +#include "rpc/group_host_port.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" namespace dsn { diff --git a/src/runtime/test_utils.h b/src/runtime/test_utils.h index 4b54fde386..8278404729 100644 --- a/src/runtime/test_utils.h +++ b/src/runtime/test_utils.h @@ -34,12 +34,18 @@ #include "utils/threadpool_code.h" #include "runtime/task/task_code.h" #include "common/gpid.h" -#include "runtime/rpc/dns_resolver.h" -#include "runtime/rpc/serialization.h" -#include "runtime/rpc/rpc_stream.h" +#include "rpc/dns_resolver.h" +#include "rpc/serialization.h" +#include "rpc/rpc_stream.h" #include "runtime/serverlet.h" #include "runtime/service_app.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" +#include "rpc/serialization.h" +#include "rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_host_port.h" #include "runtime/task/task.h" #include "runtime/task/task_worker.h" #include diff --git a/src/runtime/tool_api.cpp b/src/runtime/tool_api.cpp index fa9bff1542..c04117106b 100644 --- a/src/runtime/tool_api.cpp +++ b/src/runtime/tool_api.cpp @@ -34,7 +34,7 @@ #include #include "runtime/global_config.h" -#include "runtime/rpc/message_parser_manager.h" +#include "rpc/message_parser_manager.h" #include "runtime/service_engine.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" diff --git a/src/runtime/tool_api.h b/src/runtime/tool_api.h index c9e145a435..1da3613de6 100644 --- a/src/runtime/tool_api.h +++ b/src/runtime/tool_api.h @@ -43,8 +43,8 @@ Component providers define the interface for the local components (e.g., network #include #include "runtime/env_provider.h" -#include "runtime/rpc/message_parser.h" -#include "runtime/rpc/network.h" +#include "rpc/message_parser.h" +#include "rpc/network.h" #include "runtime/task/task_queue.h" #include "runtime/task/task_spec.h" #include "runtime/task/task_worker.h" diff --git a/src/runtime/tracer.cpp b/src/runtime/tracer.cpp index e85d88ed5f..fec9432a75 100644 --- a/src/runtime/tracer.cpp +++ b/src/runtime/tracer.cpp @@ -37,7 +37,7 @@ #include "fmt/core.h" #include "fmt/format.h" #include "runtime/global_config.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "runtime/task/task.h" #include "runtime/task/task_code.h" #include "runtime/task/task_spec.h" diff --git a/src/security/client_negotiation.cpp b/src/security/client_negotiation.cpp index 68a954baa2..c8b6b5ba27 100644 --- a/src/security/client_negotiation.cpp +++ b/src/security/client_negotiation.cpp @@ -26,8 +26,8 @@ #include "fmt/format.h" #include "negotiation_manager.h" #include "negotiation_utils.h" -#include "runtime/rpc/network.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/network.h" +#include "rpc/rpc_address.h" #include "security/negotiation.h" #include "security/sasl_wrapper.h" #include "utils/autoref_ptr.h" diff --git a/src/security/client_negotiation.h b/src/security/client_negotiation.h index 990a525fc6..604cab8045 100644 --- a/src/security/client_negotiation.h +++ b/src/security/client_negotiation.h @@ -20,7 +20,7 @@ #include #include "negotiation.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "security_types.h" #include "utils/blob.h" diff --git a/src/security/meta_access_controller.cpp b/src/security/meta_access_controller.cpp index 204e34cb12..b8dc5cd50d 100644 --- a/src/security/meta_access_controller.cpp +++ b/src/security/meta_access_controller.cpp @@ -21,8 +21,8 @@ #include "ranger/ranger_resource_policy_manager.h" #include "ranger/ranger_resource_policy.h" -#include "runtime/rpc/network.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/network.h" +#include "rpc/rpc_message.h" #include "runtime/task/task_code.h" #include "utils/autoref_ptr.h" #include "utils/flags.h" diff --git a/src/security/negotiation.h b/src/security/negotiation.h index c9098a2491..235d8d42b8 100644 --- a/src/security/negotiation.h +++ b/src/security/negotiation.h @@ -22,9 +22,9 @@ #include #include -#include "runtime/rpc/network.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/network.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_message.h" #include "sasl_wrapper.h" #include "security_types.h" #include "utils/autoref_ptr.h" diff --git a/src/security/negotiation_manager.cpp b/src/security/negotiation_manager.cpp index 22a4098f52..f4bc2de928 100644 --- a/src/security/negotiation_manager.cpp +++ b/src/security/negotiation_manager.cpp @@ -23,8 +23,8 @@ #include "failure_detector/fd.code.definition.h" #include "http/http_server.h" #include "negotiation_utils.h" -#include "runtime/rpc/network.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/network.h" +#include "rpc/rpc_message.h" #include "runtime/task/task_code.h" #include "security_types.h" #include "server_negotiation.h" diff --git a/src/security/replica_access_controller.cpp b/src/security/replica_access_controller.cpp index 0f480c77b4..6d19b213d7 100644 --- a/src/security/replica_access_controller.cpp +++ b/src/security/replica_access_controller.cpp @@ -28,8 +28,8 @@ #pragma GCC diagnostic pop #include "replica_access_controller.h" -#include "runtime/rpc/network.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/network.h" +#include "rpc/rpc_message.h" #include "utils/autoref_ptr.h" #include "utils/blob.h" #include "utils/flags.h" diff --git a/src/security/server_negotiation.cpp b/src/security/server_negotiation.cpp index 174b418677..b5daee2588 100644 --- a/src/security/server_negotiation.cpp +++ b/src/security/server_negotiation.cpp @@ -22,8 +22,8 @@ #include "fmt/core.h" #include "fmt/format.h" -#include "runtime/rpc/network.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/network.h" +#include "rpc/rpc_address.h" #include "security/negotiation.h" #include "security/sasl_wrapper.h" #include "security_types.h" diff --git a/src/security/server_negotiation.h b/src/security/server_negotiation.h index c43e55c022..48d7023f2b 100644 --- a/src/security/server_negotiation.h +++ b/src/security/server_negotiation.h @@ -20,7 +20,7 @@ #include #include "negotiation.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" namespace dsn { class blob; diff --git a/src/security/test/client_negotiation_test.cpp b/src/security/test/client_negotiation_test.cpp index fcfaf61227..596d73ee35 100644 --- a/src/security/test/client_negotiation_test.cpp +++ b/src/security/test/client_negotiation_test.cpp @@ -20,10 +20,10 @@ #include #include "gtest/gtest.h" -#include "runtime/rpc/network.sim.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/network.sim.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_message.h" #include "security/client_negotiation.h" #include "security/negotiation.h" #include "security_types.h" diff --git a/src/security/test/meta_access_controller_test.cpp b/src/security/test/meta_access_controller_test.cpp index 11fc1c588e..4beeaf443b 100644 --- a/src/security/test/meta_access_controller_test.cpp +++ b/src/security/test/meta_access_controller_test.cpp @@ -21,10 +21,10 @@ #include "common/replication.codes.h" #include "gtest/gtest.h" -#include "runtime/rpc/network.h" -#include "runtime/rpc/network.sim.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/network.h" +#include "rpc/network.sim.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_message.h" #include "security/access_controller.h" #include "runtime/task/task_code.h" #include "utils/autoref_ptr.h" diff --git a/src/security/test/negotiation_manager_test.cpp b/src/security/test/negotiation_manager_test.cpp index dbf79db51d..179b72382f 100644 --- a/src/security/test/negotiation_manager_test.cpp +++ b/src/security/test/negotiation_manager_test.cpp @@ -21,11 +21,11 @@ #include "gtest/gtest.h" #include "http/http_server.h" #include "nfs/nfs_code_definition.h" -#include "runtime/rpc/network.h" -#include "runtime/rpc/network.sim.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/network.h" +#include "rpc/network.sim.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_message.h" #include "security/negotiation_utils.h" #include "runtime/task/task_code.h" #include "security_types.h" diff --git a/src/security/test/replica_access_controller_test.cpp b/src/security/test/replica_access_controller_test.cpp index 998d828b96..aca34f2db8 100644 --- a/src/security/test/replica_access_controller_test.cpp +++ b/src/security/test/replica_access_controller_test.cpp @@ -23,10 +23,10 @@ #include "common/replication.codes.h" #include "gtest/gtest.h" #include "ranger/access_type.h" -#include "runtime/rpc/network.h" -#include "runtime/rpc/network.sim.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/network.h" +#include "rpc/network.sim.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_message.h" #include "security/replica_access_controller.h" #include "utils/autoref_ptr.h" #include "utils/flags.h" diff --git a/src/security/test/server_negotiation_test.cpp b/src/security/test/server_negotiation_test.cpp index 92b5b0b188..8fff293de0 100644 --- a/src/security/test/server_negotiation_test.cpp +++ b/src/security/test/server_negotiation_test.cpp @@ -21,9 +21,9 @@ #include #include "gtest/gtest.h" -#include "runtime/rpc/network.sim.h" -#include "runtime/rpc/rpc_address.h" -#include "runtime/rpc/rpc_holder.h" +#include "rpc/network.sim.h" +#include "rpc/rpc_address.h" +#include "rpc/rpc_holder.h" #include "security/negotiation.h" #include "security/negotiation_utils.h" #include "security_types.h" diff --git a/src/server/available_detector.h b/src/server/available_detector.h index 5de60d150e..bc31e2fed5 100644 --- a/src/server/available_detector.h +++ b/src/server/available_detector.h @@ -26,7 +26,7 @@ #include #include "perf_counter/perf_counter_wrapper.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "runtime/task/task.h" #include "runtime/task/task_tracker.h" #include "utils/synchronize.h" diff --git a/src/server/capacity_unit_calculator.cpp b/src/server/capacity_unit_calculator.cpp index 8a4745f4ba..88f6e2f172 100644 --- a/src/server/capacity_unit_calculator.cpp +++ b/src/server/capacity_unit_calculator.cpp @@ -27,7 +27,7 @@ #include "hotkey_collector.h" #include "rrdb/rrdb_types.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "utils/autoref_ptr.h" #include "utils/blob.h" #include "utils/flags.h" diff --git a/src/server/hotspot_partition_calculator.cpp b/src/server/hotspot_partition_calculator.cpp index 9b99abfabb..dbf4e64789 100644 --- a/src/server/hotspot_partition_calculator.cpp +++ b/src/server/hotspot_partition_calculator.cpp @@ -21,13 +21,13 @@ #include #include #include - #include + #include "client/replication_ddl_client.h" #include "common/gpid.h" #include "common/serialization_helper/dsn.layer2_types.h" #include "perf_counter/perf_counter.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "server/hotspot_partition_stat.h" #include "shell/command_executor.h" #include "utils/error_code.h" diff --git a/src/server/hotspot_partition_calculator.h b/src/server/hotspot_partition_calculator.h index d117bdc717..f5e3d93eda 100644 --- a/src/server/hotspot_partition_calculator.h +++ b/src/server/hotspot_partition_calculator.h @@ -27,7 +27,7 @@ #include "hotspot_partition_stat.h" #include "perf_counter/perf_counter_wrapper.h" #include "replica_admin_types.h" -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_holder.h" struct row_data; struct shell_context; diff --git a/src/server/info_collector.cpp b/src/server/info_collector.cpp index c2b1fe0943..eb6cc25a95 100644 --- a/src/server/info_collector.cpp +++ b/src/server/info_collector.cpp @@ -32,7 +32,7 @@ #include "hotspot_partition_calculator.h" #include "pegasus/client.h" #include "result_writer.h" -#include "runtime/rpc/group_host_port.h" +#include "rpc/group_host_port.h" #include "runtime/task/async_calls.h" #include "runtime/task/task_code.h" #include "shell/command_executor.h" diff --git a/src/server/info_collector.h b/src/server/info_collector.h index fe168ad7f1..727864b652 100644 --- a/src/server/info_collector.h +++ b/src/server/info_collector.h @@ -29,7 +29,7 @@ #include "perf_counter/perf_counter.h" #include "perf_counter/perf_counter_wrapper.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "runtime/task/task.h" #include "runtime/task/task_tracker.h" #include "shell/command_helper.h" @@ -43,6 +43,7 @@ class pegasus_client; namespace server { class hotspot_partition_calculator; + class result_writer; class info_collector diff --git a/src/server/pegasus_mutation_duplicator.cpp b/src/server/pegasus_mutation_duplicator.cpp index 8b82557bb4..091d1247a8 100644 --- a/src/server/pegasus_mutation_duplicator.cpp +++ b/src/server/pegasus_mutation_duplicator.cpp @@ -19,7 +19,6 @@ #include "pegasus_mutation_duplicator.h" -#include #include #include #include @@ -27,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -37,10 +37,10 @@ #include "duplication_internal_types.h" #include "pegasus/client.h" #include "pegasus_key_schema.h" +#include "rpc/rpc_message.h" #include "rrdb/rrdb.code.definition.h" #include "rrdb/rrdb_types.h" #include "runtime/message_utils.h" -#include "runtime/rpc/rpc_message.h" #include "utils/autoref_ptr.h" #include "utils/blob.h" #include "utils/chrono_literals.h" diff --git a/src/server/pegasus_server_impl.cpp b/src/server/pegasus_server_impl.cpp index ffb4b8c1c9..a91add8e5f 100644 --- a/src/server/pegasus_server_impl.cpp +++ b/src/server/pegasus_server_impl.cpp @@ -43,8 +43,8 @@ #include #include #include - #include + #include "base/idl_utils.h" // IWYU pragma: keep #include "base/meta_store.h" #include "base/pegasus_key_schema.h" @@ -60,10 +60,10 @@ #include "pegasus_rpc_types.h" #include "pegasus_server_write.h" #include "replica_admin_types.h" +#include "rpc/rpc_message.h" #include "rrdb/rrdb.code.definition.h" #include "rrdb/rrdb_types.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_message.h" #include "runtime/task/async_calls.h" #include "runtime/task/task_code.h" #include "server/key_ttl_compaction_filter.h" diff --git a/src/server/pegasus_server_impl_init.cpp b/src/server/pegasus_server_impl_init.cpp index d679d6ce3d..6e54c25a89 100644 --- a/src/server/pegasus_server_impl_init.cpp +++ b/src/server/pegasus_server_impl_init.cpp @@ -44,8 +44,8 @@ #include "pegasus_server_impl.h" #include "pegasus_value_schema.h" #include "replica_admin_types.h" +#include "rpc/rpc_host_port.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_host_port.h" #include "server/capacity_unit_calculator.h" // IWYU pragma: keep #include "server/key_ttl_compaction_filter.h" #include "server/pegasus_read_service.h" diff --git a/src/server/pegasus_server_write.cpp b/src/server/pegasus_server_write.cpp index 33437ca692..77f679ee71 100644 --- a/src/server/pegasus_server_write.cpp +++ b/src/server/pegasus_server_write.cpp @@ -17,11 +17,11 @@ * under the License. */ -#include #include #include #include #include +#include #include #include "base/pegasus_key_schema.h" @@ -32,9 +32,9 @@ #include "pegasus_server_impl.h" #include "pegasus_server_write.h" #include "pegasus_utils.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_message.h" #include "rrdb/rrdb.code.definition.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_message.h" #include "server/pegasus_write_service.h" #include "utils/autoref_ptr.h" #include "utils/blob.h" diff --git a/src/server/test/capacity_unit_calculator_test.cpp b/src/server/test/capacity_unit_calculator_test.cpp index b093cb0586..87309e6756 100644 --- a/src/server/test/capacity_unit_calculator_test.cpp +++ b/src/server/test/capacity_unit_calculator_test.cpp @@ -31,7 +31,7 @@ #include "pegasus_server_test_base.h" #include "replica_admin_types.h" #include "rrdb/rrdb_types.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "server/capacity_unit_calculator.h" #include "server/hotkey_collector.h" #include "utils/autoref_ptr.h" diff --git a/src/server/test/hotkey_collector_test.cpp b/src/server/test/hotkey_collector_test.cpp index 56864962af..43d68b705c 100644 --- a/src/server/test/hotkey_collector_test.cpp +++ b/src/server/test/hotkey_collector_test.cpp @@ -29,7 +29,7 @@ #include "pegasus_server_test_base.h" #include "rrdb/rrdb.code.definition.h" #include "rrdb/rrdb_types.h" -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_holder.h" #include "runtime/task/async_calls.h" #include "runtime/task/task_tracker.h" #include "server/hotkey_collector_state.h" diff --git a/src/server/test/pegasus_mutation_duplicator_test.cpp b/src/server/test/pegasus_mutation_duplicator_test.cpp index f4e6d871db..1bb4be6246 100644 --- a/src/server/test/pegasus_mutation_duplicator_test.cpp +++ b/src/server/test/pegasus_mutation_duplicator_test.cpp @@ -38,11 +38,11 @@ #include "pegasus_key_schema.h" #include "pegasus_server_test_base.h" #include "replica/replica_base.h" +#include "rpc/rpc_holder.h" +#include "rpc/rpc_message.h" #include "rrdb/rrdb.code.definition.h" #include "rrdb/rrdb_types.h" #include "runtime/message_utils.h" -#include "runtime/rpc/rpc_holder.h" -#include "runtime/rpc/rpc_message.h" #include "utils/blob.h" #include "utils/error_code.h" diff --git a/src/server/test/pegasus_server_write_test.cpp b/src/server/test/pegasus_server_write_test.cpp index 556cd9d7fe..72d21eb6a2 100644 --- a/src/server/test/pegasus_server_write_test.cpp +++ b/src/server/test/pegasus_server_write_test.cpp @@ -31,7 +31,7 @@ #include "pegasus_rpc_types.h" #include "pegasus_server_test_base.h" #include "rrdb/rrdb_types.h" -#include "runtime/rpc/rpc_holder.h" +#include "rpc/rpc_holder.h" #include "server/pegasus_server_write.h" #include "server/pegasus_write_service.h" #include "server/pegasus_write_service_impl.h" diff --git a/src/server/test/pegasus_write_service_test.cpp b/src/server/test/pegasus_write_service_test.cpp index 6e448a4ade..01e2ef0a8b 100644 --- a/src/server/test/pegasus_write_service_test.cpp +++ b/src/server/test/pegasus_write_service_test.cpp @@ -35,7 +35,7 @@ #include "rrdb/rrdb.code.definition.h" #include "rrdb/rrdb_types.h" #include "runtime/message_utils.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "runtime/task/task_code.h" #include "server/pegasus_server_write.h" #include "server/pegasus_write_service.h" diff --git a/src/shell/command_utils.cpp b/src/shell/command_utils.cpp index 96e5235a0b..c5311cb985 100644 --- a/src/shell/command_utils.cpp +++ b/src/shell/command_utils.cpp @@ -22,7 +22,7 @@ #include "client/replication_ddl_client.h" #include "command_executor.h" #include "meta_admin_types.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "utils/error_code.h" bool validate_ip(shell_context *sc, diff --git a/src/shell/commands/bulk_load.cpp b/src/shell/commands/bulk_load.cpp index 8a57fe21a2..5c6246f7e4 100644 --- a/src/shell/commands/bulk_load.cpp +++ b/src/shell/commands/bulk_load.cpp @@ -37,7 +37,7 @@ #include "bulk_load_types.h" #include "client/replication_ddl_client.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" #include "runtime/task/task_spec.h" #include "shell/command_executor.h" #include "shell/commands.h" diff --git a/src/shell/commands/data_operations.cpp b/src/shell/commands/data_operations.cpp index 2c36739c27..cf73d72b7a 100644 --- a/src/shell/commands/data_operations.cpp +++ b/src/shell/commands/data_operations.cpp @@ -50,8 +50,8 @@ #include "pegasus/client.h" #include "pegasus_key_schema.h" #include "pegasus_utils.h" +#include "rpc/rpc_host_port.h" #include "rrdb/rrdb_types.h" -#include "runtime/rpc/rpc_host_port.h" #include "runtime/task/async_calls.h" #include "shell/args.h" #include "shell/command_executor.h" diff --git a/src/shell/commands/debugger.cpp b/src/shell/commands/debugger.cpp index 100c6ef75d..b52dfdab14 100644 --- a/src/shell/commands/debugger.cpp +++ b/src/shell/commands/debugger.cpp @@ -54,8 +54,8 @@ #include "pegasus_value_schema.h" #include "rrdb/rrdb.code.definition.h" #include "rrdb/rrdb_types.h" -#include "runtime/rpc/rpc_message.h" -#include "runtime/rpc/serialization.h" +#include "rpc/rpc_message.h" +#include "rpc/serialization.h" #include "runtime/task/task_code.h" #include "shell/args.h" #include "shell/command_executor.h" diff --git a/src/shell/commands/detect_hotkey.cpp b/src/shell/commands/detect_hotkey.cpp index 05acc7cd04..b93acd1d05 100644 --- a/src/shell/commands/detect_hotkey.cpp +++ b/src/shell/commands/detect_hotkey.cpp @@ -24,7 +24,7 @@ #include "client/replication_ddl_client.h" #include "common/gpid.h" #include "replica_admin_types.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "shell/argh.h" #include "shell/command_executor.h" #include "shell/command_utils.h" diff --git a/src/shell/commands/node_management.cpp b/src/shell/commands/node_management.cpp index 57b649f881..3b0a823ee4 100644 --- a/src/shell/commands/node_management.cpp +++ b/src/shell/commands/node_management.cpp @@ -44,7 +44,7 @@ #include "common/replication_enums.h" #include "dsn.layer2_types.h" #include "meta_admin_types.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "shell/argh.h" #include "shell/command_executor.h" #include "shell/command_helper.h" diff --git a/src/shell/commands/rebalance.cpp b/src/shell/commands/rebalance.cpp index 42a5ac5e2d..9b6f19d814 100644 --- a/src/shell/commands/rebalance.cpp +++ b/src/shell/commands/rebalance.cpp @@ -32,7 +32,7 @@ #include "common/gpid.h" #include "meta/load_balance_policy.h" #include "meta_admin_types.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "shell/command_executor.h" #include "shell/command_utils.h" #include "shell/commands.h" diff --git a/src/shell/commands/recovery.cpp b/src/shell/commands/recovery.cpp index 7793142c68..85789f57fa 100644 --- a/src/shell/commands/recovery.cpp +++ b/src/shell/commands/recovery.cpp @@ -33,7 +33,7 @@ #include "dsn.layer2_types.h" #include "meta/load_balance_policy.h" #include "meta_admin_types.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "shell/command_executor.h" #include "shell/commands.h" #include "utils/error_code.h" diff --git a/src/shell/commands/table_management.cpp b/src/shell/commands/table_management.cpp index f93939ff68..07dc658217 100644 --- a/src/shell/commands/table_management.cpp +++ b/src/shell/commands/table_management.cpp @@ -38,7 +38,7 @@ #include "dsn.layer2_types.h" #include "meta_admin_types.h" #include "pegasus_utils.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "shell/command_executor.h" #include "shell/command_helper.h" #include "shell/command_utils.h" diff --git a/src/test/function_test/recovery/test_recovery.cpp b/src/test/function_test/recovery/test_recovery.cpp index 04d59933f4..33d1b0adf1 100644 --- a/src/test/function_test/recovery/test_recovery.cpp +++ b/src/test/function_test/recovery/test_recovery.cpp @@ -32,7 +32,7 @@ #include "gtest/gtest.h" #include "include/pegasus/client.h" #include "pegasus/error.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "test/function_test/utils/test_util.h" #include "utils/error_code.h" #include "utils/rand.h" diff --git a/src/test/function_test/utils/global_env.cpp b/src/test/function_test/utils/global_env.cpp index a703fefd2f..12395bea77 100644 --- a/src/test/function_test/utils/global_env.cpp +++ b/src/test/function_test/utils/global_env.cpp @@ -27,7 +27,7 @@ #include "gtest/gtest.h" // IWYU pragma: no_include "gtest/gtest-message.h" // IWYU pragma: no_include "gtest/gtest-test-part.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" #include "test/function_test/utils/utils.h" #include "utils/fmt_logging.h" diff --git a/src/test/function_test/utils/test_util.h b/src/test/function_test/utils/test_util.h index 519da64718..3fb7c16f6f 100644 --- a/src/test/function_test/utils/test_util.h +++ b/src/test/function_test/utils/test_util.h @@ -28,7 +28,7 @@ #include #include "dsn.layer2_types.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" // TODO(yingchun): it's too tricky, but I don't know how does it happen, we can fix it later. #define TRICKY_CODE_TO_AVOID_LINK_ERROR \ diff --git a/src/test/kill_test/kill_testor.h b/src/test/kill_test/kill_testor.h index 7c3f105719..23b309d316 100644 --- a/src/test/kill_test/kill_testor.h +++ b/src/test/kill_test/kill_testor.h @@ -24,7 +24,7 @@ #include #include "dsn.layer2_types.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "utils/error_code.h" namespace dsn { diff --git a/src/tools/mutation_log_tool.cpp b/src/tools/mutation_log_tool.cpp index 0e88d06f4a..5c1bacbe96 100644 --- a/src/tools/mutation_log_tool.cpp +++ b/src/tools/mutation_log_tool.cpp @@ -39,7 +39,7 @@ #include "replica/mutation_log.h" #include "replica/replica.h" #include "replica/replica_stub.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/rpc_message.h" #include "runtime/task/task_spec.h" #include "utils/autoref_ptr.h" #include "utils/blob.h" diff --git a/src/utils/distributed_lock_service.h b/src/utils/distributed_lock_service.h index eb1858ef65..4f43150e9b 100644 --- a/src/utils/distributed_lock_service.h +++ b/src/utils/distributed_lock_service.h @@ -34,11 +34,11 @@ #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 "rpc/serialization.h" +#include "rpc/rpc_stream.h" #include "runtime/serverlet.h" #include "runtime/service_app.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" #include "utils/error_code.h" #include "runtime/task/future_types.h" #include diff --git a/src/utils/metrics.cpp b/src/utils/metrics.cpp index 89e3ff1f7f..06a5754c73 100644 --- a/src/utils/metrics.cpp +++ b/src/utils/metrics.cpp @@ -17,7 +17,6 @@ #include "utils/metrics.h" -#include #include #include #include @@ -25,12 +24,13 @@ #include #include #include +#include #include "http/http_method.h" #include "http/http_status_code.h" +#include "rpc/rpc_engine.h" +#include "rpc/rpc_host_port.h" #include "runtime/api_layer1.h" -#include "runtime/rpc/rpc_engine.h" -#include "runtime/rpc/rpc_host_port.h" #include "runtime/service_app.h" #include "runtime/service_engine.h" #include "runtime/task/task.h" diff --git a/src/utils/test/json_helper_test.cpp b/src/utils/test/json_helper_test.cpp index 6389e7b0ea..6027264931 100644 --- a/src/utils/test/json_helper_test.cpp +++ b/src/utils/test/json_helper_test.cpp @@ -36,7 +36,7 @@ #include "common/json_helper.h" #include "gtest/gtest.h" -#include "runtime/rpc/rpc_host_port.h" +#include "rpc/rpc_host_port.h" #include "utils/blob.h" namespace dsn { diff --git a/src/utils/test/metrics_test.cpp b/src/utils/test/metrics_test.cpp index fcd9cf227c..a9047b50f3 100644 --- a/src/utils/test/metrics_test.cpp +++ b/src/utils/test/metrics_test.cpp @@ -35,8 +35,8 @@ #include "http/http_message_parser.h" #include "percentile_utils.h" -#include "runtime/rpc/message_parser.h" -#include "runtime/rpc/rpc_message.h" +#include "rpc/message_parser.h" +#include "rpc/rpc_message.h" #include "utils/errors.h" #include "utils/flags.h" #include "gutil/map_util.h" diff --git a/src/zookeeper/zookeeper_session.cpp b/src/zookeeper/zookeeper_session.cpp index 380eafa0b0..dfff72b47f 100644 --- a/src/zookeeper/zookeeper_session.cpp +++ b/src/zookeeper/zookeeper_session.cpp @@ -31,7 +31,7 @@ #include #include "runtime/app_model.h" -#include "runtime/rpc/rpc_address.h" +#include "rpc/rpc_address.h" #include "utils/filesystem.h" #include "utils/flags.h" #include "utils/fmt_logging.h"