From 3b65dd79e33e48b8312aac30a0a6bdec15516650 Mon Sep 17 00:00:00 2001 From: Yingchun Lai Date: Sun, 16 Oct 2022 21:49:34 +0800 Subject: [PATCH] refactor(rdsn): remove 'include' directory in rdsn --- .github/workflows/lint_and_test_cpp.yaml | 8 +- .gitignore | 3 +- .licenserc.yaml | 237 +++++++++--------- CMakeLists.txt | 5 - LICENSE | 24 +- run.sh | 21 +- scripts/compile_thrift.py | 10 +- scripts/pack_client.sh | 14 +- scripts/pack_common.sh | 10 +- scripts/pack_server.sh | 12 +- scripts/pack_tools.sh | 40 +-- scripts/recompile_thrift.sh | 2 +- src/CMakeLists.txt | 18 +- src/base/CMakeLists.txt | 2 +- src/base/pegasus_key_schema.h | 14 +- src/base/pegasus_rpc_types.h | 10 +- src/base/pegasus_utils.cpp | 4 +- src/base/pegasus_utils.h | 4 +- src/base/pegasus_value_schema.h | 19 +- src/base/test/main.cpp | 7 +- src/base/test/value_manager_test.cpp | 3 +- src/base/value_schema_manager.h | 2 +- src/base/value_schema_v0.cpp | 4 +- src/base/value_schema_v1.cpp | 8 +- src/base/value_schema_v2.cpp | 8 +- src/client_lib/CMakeLists.txt | 51 +--- src/client_lib/pegasus_client_impl.cpp | 11 +- src/client_lib/pegasus_client_impl.h | 2 +- src/geo/bench/bench.cpp | 8 +- src/geo/lib/geo_client.cpp | 19 +- src/geo/lib/geo_client.h | 2 +- src/geo/lib/latlng_codec.cpp | 23 +- src/geo/lib/latlng_codec.h | 2 +- src/geo/test/geo_test.cpp | 10 +- src/geo/test/latlng_codec_test.cpp | 2 +- src/geo/test/main.cpp | 6 +- src/include/rrdb/rrdb.client.h | 7 +- src/include/rrdb/rrdb.code.definition.h | 3 +- src/rdsn/include/dsn/c/api_common.h | 61 ----- src/rdsn/include/dsn/dist/failure_detector.h | 38 --- src/rdsn/include/dsn/dist/replication.h | 40 --- .../dsn/dist/replication/replication_types.h | 28 --- src/rdsn/include/dsn/service_api_cpp.h | 44 ---- src/rdsn/include/dsn/tool-api/auto_codes.h | 41 --- src/rdsn/src/CMakeLists.txt | 4 - src/rdsn/src/aio/aio_provider.h | 6 +- src/rdsn/src/aio/aio_task.cpp | 6 +- .../dsn/tool-api => src/aio}/aio_task.h | 3 +- src/rdsn/src/aio/disk_engine.cpp | 6 +- src/rdsn/src/aio/disk_engine.h | 6 +- src/rdsn/src/aio/file_io.cpp | 2 +- .../dsn/tool-api => src/aio}/file_io.h | 2 +- .../src/aio/native_linux_aio_provider.cpp | 10 +- src/rdsn/src/aio/test/aio.cpp | 8 +- src/rdsn/src/aio/test/main.cpp | 15 +- .../block_service}/block_service.h | 21 +- .../block_service/block_service_manager.cpp | 6 +- .../src/block_service/block_service_manager.h | 6 +- .../block_service/directio_writable_file.cpp | 4 +- .../src/block_service/fds/fds_service.cpp | 14 +- src/rdsn/src/block_service/fds/fds_service.h | 2 +- .../src/block_service/hdfs/hdfs_service.cpp | 20 +- .../src/block_service/hdfs/hdfs_service.h | 2 +- .../src/block_service/local/local_service.cpp | 20 +- .../src/block_service/local/local_service.h | 2 +- .../test/block_service_manager_test.cpp | 2 +- .../block_service/test/block_service_mock.h | 4 +- .../block_service/test/fds_service_test.cpp | 10 +- .../block_service/test/hdfs_service_test.cpp | 8 +- src/rdsn/src/block_service/test/main.cpp | 15 +- src/rdsn/src/client/partition_resolver.cpp | 6 +- .../client}/partition_resolver.h | 12 +- .../src/client/partition_resolver_manager.cpp | 4 +- .../src/client/partition_resolver_manager.h | 8 +- .../src/client/partition_resolver_simple.cpp | 8 +- .../src/client/partition_resolver_simple.h | 14 +- .../src/client/replication_ddl_client.cpp | 16 +- .../client}/replication_ddl_client.h | 31 ++- .../common/api_common.h} | 48 ++-- src/rdsn/src/common/backup_common.h | 4 +- src/rdsn/src/common/bulk_load_common.h | 2 +- src/rdsn/src/common/common.cpp | 4 +- .../{include/dsn/dist => src/common}/common.h | 0 src/rdsn/src/common/duplication_common.cpp | 17 +- .../common}/duplication_common.h | 14 +- src/rdsn/src/common/fs_manager.cpp | 8 +- src/rdsn/src/common/fs_manager.h | 21 +- .../dsn/tool-api => src/common}/gpid.h | 0 .../dsn/cpp => src/common}/json_helper.h | 22 +- src/rdsn/src/common/manual_compact.h | 2 +- src/rdsn/src/common/partition_split_common.h | 2 +- .../replication => src/common}/replica_envs.h | 0 .../common}/replication.codes.h | 5 +- src/rdsn/src/common/replication_common.cpp | 8 +- src/rdsn/src/common/replication_common.h | 17 +- .../common}/replication_enums.h | 2 +- .../common}/replication_other_types.h | 10 +- .../common}/serialization_helper/dsn_types.h | 2 +- .../serialization_helper/thrift_helper.h | 56 +---- .../common}/storage_serverlet.h | 15 +- src/rdsn/src/common/test/common_test.cpp | 2 +- .../common/test/duplication_common_test.cpp | 2 +- src/rdsn/src/common/test/fs_manager_test.cpp | 2 +- src/rdsn/src/common/test/main.cpp | 15 +- .../common/test/replication_common_test.cpp | 2 +- .../src/failure_detector/failure_detector.cpp | 4 +- .../failure_detector/failure_detector.h | 8 +- .../failure_detector_multimaster.cpp | 8 +- .../failure_detector_multimaster.h | 15 +- .../dist => src}/failure_detector/fd.client.h | 4 +- .../failure_detector/fd.code.definition.h | 26 +- .../dist => src}/failure_detector/fd.server.h | 0 .../test/failure_detector.cpp | 15 +- src/rdsn/src/failure_detector/test/main.cpp | 15 +- src/rdsn/src/http/builtin_http_calls.cpp | 4 +- src/rdsn/src/http/builtin_http_calls.h | 6 +- src/rdsn/src/http/config_http_service.cpp | 6 +- src/rdsn/src/http/http_call_registry.h | 6 +- src/rdsn/src/http/http_message_parser.cpp | 14 +- src/rdsn/src/http/http_message_parser.h | 6 +- src/rdsn/src/http/http_server.cpp | 6 +- .../{include/dsn => src}/http/http_server.h | 7 +- src/rdsn/src/http/http_server_impl.h | 6 +- .../src/http/perf_counter_http_service.cpp | 2 +- src/rdsn/src/http/pprof_http_service.cpp | 14 +- src/rdsn/src/http/pprof_http_service.h | 2 +- src/rdsn/src/http/test/http_server_test.cpp | 2 +- .../test/perf_counter_http_service_test.cpp | 4 +- src/rdsn/src/http/test/uri_decoder_test.cpp | 2 +- src/rdsn/src/http/uri_decoder.cpp | 2 +- src/rdsn/src/http/uri_decoder.h | 2 +- src/rdsn/src/meta/app_balance_policy.cpp | 4 +- src/rdsn/src/meta/app_env_validator.cpp | 8 +- src/rdsn/src/meta/app_env_validator.h | 2 +- src/rdsn/src/meta/backup_engine.cpp | 4 +- src/rdsn/src/meta/backup_engine.h | 6 +- src/rdsn/src/meta/cluster_balance_policy.cpp | 4 +- .../meta/distributed_lock_service_simple.cpp | 2 +- .../meta/distributed_lock_service_simple.h | 4 +- src/rdsn/src/meta/dump_file.h | 25 +- .../src/meta/duplication/duplication_info.cpp | 2 +- .../src/meta/duplication/duplication_info.h | 18 +- .../duplication/meta_duplication_service.cpp | 14 +- src/rdsn/src/meta/greedy_load_balancer.cpp | 10 +- src/rdsn/src/meta/load_balance_policy.cpp | 6 +- src/rdsn/src/meta/meta_backup_service.cpp | 10 +- src/rdsn/src/meta/meta_backup_service.h | 6 +- .../meta/meta_bulk_load_ingestion_context.cpp | 4 +- src/rdsn/src/meta/meta_bulk_load_service.cpp | 6 +- src/rdsn/src/meta/meta_data.cpp | 19 +- src/rdsn/src/meta/meta_data.h | 20 +- src/rdsn/src/meta/meta_http_service.cpp | 22 +- src/rdsn/src/meta/meta_http_service.h | 4 +- src/rdsn/src/meta/meta_options.cpp | 2 +- src/rdsn/src/meta/meta_options.h | 17 +- src/rdsn/src/meta/meta_rpc_types.h | 10 +- .../src/meta/meta_server_failure_detector.cpp | 6 +- .../src/meta/meta_server_failure_detector.h | 4 +- src/rdsn/src/meta/meta_service.cpp | 16 +- src/rdsn/src/meta/meta_service.h | 6 +- src/rdsn/src/meta/meta_service_app.cpp | 23 +- .../meta}/meta_service_app.h | 2 +- src/rdsn/src/meta/meta_split_service.cpp | 6 +- .../dist => src/meta}/meta_state_service.h | 19 +- .../src/meta/meta_state_service_simple.cpp | 6 +- src/rdsn/src/meta/meta_state_service_simple.h | 4 +- .../src/meta/meta_state_service_utils.cpp | 21 +- src/rdsn/src/meta/meta_state_service_utils.h | 2 +- .../src/meta/meta_state_service_utils_impl.h | 4 +- .../src/meta/meta_state_service_zookeeper.cpp | 4 +- .../src/meta/meta_state_service_zookeeper.h | 10 +- src/rdsn/src/meta/partition_guardian.cpp | 2 +- src/rdsn/src/meta/server_load_balancer.cpp | 8 +- src/rdsn/src/meta/server_load_balancer.h | 21 +- src/rdsn/src/meta/server_state.cpp | 16 +- src/rdsn/src/meta/server_state.h | 8 +- src/rdsn/src/meta/server_state_restore.cpp | 6 +- src/rdsn/src/meta/test/backup_test.cpp | 19 +- src/rdsn/src/meta/test/balancer_validator.cpp | 31 ++- .../meta/test/cluster_balance_policy_test.cpp | 4 +- .../meta/test/copy_replica_operation_test.cpp | 2 +- src/rdsn/src/meta/test/json_compacity.cpp | 21 +- src/rdsn/src/meta/test/main.cpp | 15 +- src/rdsn/src/meta/test/meta_app_envs_test.cpp | 10 +- .../src/meta/test/meta_app_operation_test.cpp | 12 +- src/rdsn/src/meta/test/meta_backup_test.cpp | 4 +- .../test/meta_bulk_load_ingestion_test.cpp | 4 +- .../meta/test/meta_bulk_load_service_test.cpp | 6 +- .../test/meta_duplication_service_test.cpp | 8 +- .../src/meta/test/meta_http_service_test.cpp | 6 +- .../meta/test/meta_mauanl_compaction_test.cpp | 2 +- .../test/meta_partition_guardian_test.cpp | 38 ++- src/rdsn/src/meta/test/meta_service_test.cpp | 4 +- .../src/meta/test/meta_service_test_app.h | 27 +- .../src/meta/test/meta_split_service_test.cpp | 10 +- src/rdsn/src/meta/test/meta_state/main.cpp | 15 +- .../test/meta_state/meta_state_service.cpp | 2 +- .../test/meta_state_service_utils_test.cpp | 19 +- src/rdsn/src/meta/test/meta_test_base.cpp | 2 +- src/rdsn/src/meta/test/meta_test_base.h | 8 +- src/rdsn/src/meta/test/misc/misc.cpp | 2 +- src/rdsn/src/meta/test/misc/misc.h | 21 +- .../meta/test/server_state_restore_test.cpp | 4 +- src/rdsn/src/meta/test/server_state_test.cpp | 6 +- src/rdsn/src/meta/test/state_sync_test.cpp | 15 +- .../meta/test/update_configuration_test.cpp | 23 +- src/rdsn/src/nfs/nfs_client_impl.cpp | 4 +- src/rdsn/src/nfs/nfs_client_impl.h | 18 +- src/rdsn/src/nfs/nfs_node.cpp | 6 +- .../{include/dsn/dist => src/nfs}/nfs_node.h | 8 +- src/rdsn/src/nfs/nfs_node_simple.h | 4 +- src/rdsn/src/nfs/nfs_server_impl.cpp | 4 +- src/rdsn/src/nfs/nfs_server_impl.h | 12 +- src/rdsn/src/nfs/test/main.cpp | 14 +- .../src/perf_counter/builtin_counters.cpp | 5 +- src/rdsn/src/perf_counter/builtin_counters.h | 2 +- src/rdsn/src/perf_counter/perf_counter.cpp | 2 +- .../dsn => src}/perf_counter/perf_counter.h | 7 +- .../src/perf_counter/perf_counter_atomic.h | 10 +- .../perf_counter/perf_counter_utils.h | 4 +- .../perf_counter/perf_counter_wrapper.h | 4 +- src/rdsn/src/perf_counter/perf_counters.cpp | 22 +- .../dsn => src}/perf_counter/perf_counters.h | 13 +- src/rdsn/src/perf_counter/test/main.cpp | 15 +- .../perf_counter/test/perf_counter_test.cpp | 2 +- .../perf_counter/test/perf_counters_test.cpp | 6 +- src/rdsn/src/remote_cmd/remote_command.cpp | 10 +- .../dist => src/remote_cmd}/remote_command.h | 4 +- .../replica/backup/cold_backup_context.cpp | 2 +- .../src/replica/backup/cold_backup_context.h | 6 +- .../replica/backup/replica_backup_manager.cpp | 6 +- .../replica/backup/replica_backup_manager.h | 10 +- .../replica/backup/replica_backup_server.h | 10 +- src/rdsn/src/replica/backup/test/main.cpp | 15 +- .../replica/bulk_load/replica_bulk_loader.cpp | 10 +- .../replica/bulk_load/replica_bulk_loader.h | 2 +- src/rdsn/src/replica/bulk_load/test/main.cpp | 15 +- .../test/replica_bulk_loader_test.cpp | 4 +- src/rdsn/src/replica/disk_cleaner.cpp | 8 +- src/rdsn/src/replica/disk_cleaner.h | 4 +- .../duplication/duplication_pipeline.cpp | 4 +- .../duplication/duplication_pipeline.h | 7 +- .../duplication/duplication_sync_timer.cpp | 8 +- .../duplication/duplication_sync_timer.h | 4 +- .../duplication/load_from_private_log.cpp | 4 +- .../duplication/load_from_private_log.h | 8 +- .../replica/duplication/mutation_batch.cpp | 4 +- .../src/replica/duplication/mutation_batch.h | 4 +- .../duplication}/mutation_duplicator.h | 14 +- .../duplication/replica_duplicator.cpp | 4 +- .../replica/duplication/replica_duplicator.h | 25 +- .../replica_duplicator_manager.cpp | 4 +- .../duplication/replica_duplicator_manager.h | 10 +- .../replica/duplication/replica_follower.cpp | 10 +- .../test/duplication_sync_timer_test.cpp | 4 +- .../test/load_from_private_log_test.cpp | 6 +- .../src/replica/duplication/test/main.cpp | 15 +- .../test/replica_duplicator_test.cpp | 2 +- .../test/replica_follower_test.cpp | 6 +- src/rdsn/src/replica/log_file.cpp | 6 +- src/rdsn/src/replica/log_file.h | 2 +- src/rdsn/src/replica/mutation.cpp | 4 +- src/rdsn/src/replica/mutation.h | 4 +- src/rdsn/src/replica/mutation_log.cpp | 14 +- src/rdsn/src/replica/mutation_log.h | 8 +- src/rdsn/src/replica/mutation_log_replay.cpp | 6 +- src/rdsn/src/replica/mutation_log_utils.cpp | 4 +- src/rdsn/src/replica/mutation_log_utils.h | 6 +- src/rdsn/src/replica/prepare_list.cpp | 4 +- src/rdsn/src/replica/prepare_list.h | 2 +- src/rdsn/src/replica/replica.cpp | 20 +- src/rdsn/src/replica/replica.h | 10 +- src/rdsn/src/replica/replica_2pc.cpp | 6 +- src/rdsn/src/replica/replica_backup.cpp | 10 +- .../replica}/replica_base.h | 4 +- src/rdsn/src/replica/replica_check.cpp | 6 +- src/rdsn/src/replica/replica_chkpt.cpp | 10 +- src/rdsn/src/replica/replica_config.cpp | 10 +- src/rdsn/src/replica/replica_context.cpp | 4 +- src/rdsn/src/replica/replica_context.h | 6 +- .../src/replica/replica_disk_migrator.cpp | 8 +- src/rdsn/src/replica/replica_http_service.cpp | 2 +- src/rdsn/src/replica/replica_http_service.h | 2 +- src/rdsn/src/replica/replica_init.cpp | 10 +- src/rdsn/src/replica/replica_learn.cpp | 6 +- src/rdsn/src/replica/replica_restore.cpp | 12 +- src/rdsn/src/replica/replica_stub.cpp | 20 +- src/rdsn/src/replica/replica_stub.h | 6 +- src/rdsn/src/replica/replica_test_utils.cpp | 2 +- .../replica}/replica_test_utils.h | 2 +- src/rdsn/src/replica/replica_throttle.cpp | 6 +- src/rdsn/src/replica/replication_app_base.cpp | 26 +- .../replica}/replication_app_base.h | 18 +- .../src/replica/replication_service_app.cpp | 4 +- .../replica}/replication_service_app.h | 13 +- .../replica/split/replica_split_manager.cpp | 10 +- src/rdsn/src/replica/split/test/main.cpp | 15 +- .../replica/split/test/replica_split_test.cpp | 2 +- .../storage/simple_kv/simple_kv.client.h | 6 +- .../simple_kv/simple_kv.code.definition.h | 2 +- .../storage/simple_kv/simple_kv.main.cpp | 6 +- .../storage/simple_kv/simple_kv.server.h | 4 +- .../simple_kv/simple_kv.server.impl.cpp | 2 +- .../replica/storage/simple_kv/test/case.cpp | 4 +- .../src/replica/storage/simple_kv/test/case.h | 4 +- .../storage/simple_kv/test/checker.cpp | 4 +- .../replica/storage/simple_kv/test/checker.h | 8 +- .../replica/storage/simple_kv/test/client.cpp | 4 +- .../replica/storage/simple_kv/test/client.h | 10 +- .../replica/storage/simple_kv/test/common.cpp | 2 +- .../replica/storage/simple_kv/test/common.h | 17 +- .../storage/simple_kv/test/injector.cpp | 10 +- .../replica/storage/simple_kv/test/injector.h | 2 +- .../storage/simple_kv/test/simple_kv.main.cpp | 2 +- .../simple_kv/test/simple_kv.server.impl.cpp | 2 +- .../simple_kv/test/simple_kv.server.impl.h | 2 +- .../replica/test/backup_block_service_mock.h | 11 +- src/rdsn/src/replica/test/main.cpp | 2 +- src/rdsn/src/replica/test/mock_utils.h | 8 +- .../replica/test/mutation_log_learn_test.cpp | 2 +- .../src/replica/test/mutation_log_test.cpp | 2 +- .../test/replica_disk_migrate_test.cpp | 2 +- .../src/replica/test/replica_disk_test.cpp | 2 +- .../src/replica/test/replica_disk_test_base.h | 4 +- src/rdsn/src/replica/test/replica_test.cpp | 6 +- src/rdsn/src/replica/test/replica_test_base.h | 8 +- .../test/replication_service_test_app.h | 2 +- .../dsn/c => src/runtime}/api_layer1.h | 14 +- .../{include/dsn/c => src/runtime}/api_task.h | 18 +- .../dsn/c => src/runtime}/app_model.h | 11 +- src/rdsn/src/runtime/core_main.cpp | 12 +- src/rdsn/src/runtime/env.sim.cpp | 2 +- src/rdsn/src/runtime/env.sim.h | 2 +- .../tool-api => src/runtime}/env_provider.h | 15 +- src/rdsn/src/runtime/fault_injector.cpp | 12 +- .../toollet => src/runtime}/fault_injector.h | 11 +- src/rdsn/src/runtime/global_config.cpp | 18 +- .../tool-api => src/runtime}/global_config.h | 6 +- src/rdsn/src/runtime/message_utils.cpp | 2 +- .../dsn/cpp => src/runtime}/message_utils.h | 14 +- src/rdsn/src/runtime/nativerun.cpp | 2 +- .../dsn/tool => src/runtime}/nativerun.h | 2 +- .../dsn/tool => src/runtime}/node_scoper.h | 11 +- .../dsn/cpp => src/runtime}/pipeline.h | 10 +- src/rdsn/src/runtime/profiler.cpp | 14 +- .../dsn/toollet => src/runtime}/profiler.h | 2 +- src/rdsn/src/runtime/profiler_header.h | 2 +- src/rdsn/src/runtime/providers.common.cpp | 2 +- .../tool => src/runtime}/providers.common.h | 11 +- .../src/runtime/rpc/asio_net_provider.cpp | 4 +- src/rdsn/src/runtime/rpc/asio_net_provider.h | 2 +- src/rdsn/src/runtime/rpc/asio_rpc_session.h | 6 +- .../src/runtime/rpc/dsn_message_parser.cpp | 8 +- src/rdsn/src/runtime/rpc/dsn_message_parser.h | 6 +- .../runtime/rpc}/group_address.h | 12 +- src/rdsn/src/runtime/rpc/message_parser.cpp | 6 +- .../runtime/rpc}/message_parser.h | 16 +- .../src/runtime/rpc/message_parser_manager.h | 2 +- src/rdsn/src/runtime/rpc/network.cpp | 9 +- .../tool-api => src/runtime/rpc}/network.h | 15 +- src/rdsn/src/runtime/rpc/network.sim.cpp | 12 +- src/rdsn/src/runtime/rpc/network.sim.h | 11 +- .../src/runtime/rpc/raw_message_parser.cpp | 10 +- src/rdsn/src/runtime/rpc/raw_message_parser.h | 6 +- src/rdsn/src/runtime/rpc/rpc_engine.cpp | 12 +- src/rdsn/src/runtime/rpc/rpc_engine.h | 8 +- .../dsn/cpp => src/runtime/rpc}/rpc_holder.h | 31 ++- src/rdsn/src/runtime/rpc/rpc_message.cpp | 10 +- .../runtime/rpc}/rpc_message.h | 19 +- .../dsn/cpp => src/runtime/rpc}/rpc_stream.h | 20 +- src/rdsn/src/runtime/rpc/rpc_task.cpp | 2 +- .../cpp => src/runtime/rpc}/serialization.h | 8 +- .../src/runtime/rpc/thrift_message_parser.cpp | 22 +- .../src/runtime/rpc/thrift_message_parser.h | 10 +- src/rdsn/src/runtime/scheduler.cpp | 12 +- src/rdsn/src/runtime/scheduler.h | 6 +- .../runtime/security/access_controller.cpp | 6 +- .../runtime/security/client_negotiation.cpp | 8 +- src/rdsn/src/runtime/security/init.cpp | 4 +- src/rdsn/src/runtime/security/init.h | 2 +- .../src/runtime/security/kinit_context.cpp | 14 +- src/rdsn/src/runtime/security/kinit_context.h | 2 +- .../security/meta_access_controller.cpp | 8 +- src/rdsn/src/runtime/security/negotiation.cpp | 6 +- src/rdsn/src/runtime/security/negotiation.h | 2 +- .../runtime/security/negotiation_manager.cpp | 10 +- .../runtime/security/negotiation_manager.h | 2 +- .../security/replica_access_controller.cpp | 6 +- .../security/replica_access_controller.h | 2 +- .../runtime/security/sasl_client_wrapper.cpp | 6 +- src/rdsn/src/runtime/security/sasl_init.cpp | 8 +- src/rdsn/src/runtime/security/sasl_init.h | 2 +- .../runtime/security/sasl_server_wrapper.cpp | 6 +- .../src/runtime/security/sasl_wrapper.cpp | 2 +- src/rdsn/src/runtime/security/sasl_wrapper.h | 2 +- .../runtime/security/server_negotiation.cpp | 6 +- .../src/runtime/security/server_negotiation.h | 2 +- .../dsn/cpp => src/runtime}/serverlet.h | 6 +- src/rdsn/src/runtime/service_api_c.cpp | 24 +- .../dsn/cpp => src/runtime}/service_app.h | 18 +- src/rdsn/src/runtime/service_engine.cpp | 14 +- src/rdsn/src/runtime/service_engine.h | 17 +- src/rdsn/src/runtime/sim_clock.h | 2 +- src/rdsn/src/runtime/simulator.cpp | 2 +- .../dsn/tool => src/runtime}/simulator.h | 13 +- .../runtime/task}/async_calls.h | 14 +- .../runtime/task}/future_types.h | 4 +- src/rdsn/src/runtime/task/hpc_task_queue.cpp | 9 - src/rdsn/src/runtime/task/hpc_task_queue.h | 11 +- src/rdsn/src/runtime/task/simple_task_queue.h | 4 +- src/rdsn/src/runtime/task/task.cpp | 31 +-- .../dsn/tool-api => src/runtime/task}/task.h | 35 ++- src/rdsn/src/runtime/task/task_code.cpp | 7 +- .../tool-api => src/runtime/task}/task_code.h | 6 +- src/rdsn/src/runtime/task/task_engine.cpp | 4 +- src/rdsn/src/runtime/task/task_engine.h | 8 +- src/rdsn/src/runtime/task/task_engine.sim.cpp | 2 +- src/rdsn/src/runtime/task/task_engine.sim.h | 6 +- src/rdsn/src/runtime/task/task_queue.cpp | 7 +- .../runtime/task}/task_queue.h | 16 +- src/rdsn/src/runtime/task/task_spec.cpp | 18 +- .../tool-api => src/runtime/task}/task_spec.h | 25 +- src/rdsn/src/runtime/task/task_tracker.cpp | 14 +- .../runtime/task}/task_tracker.h | 8 +- src/rdsn/src/runtime/task/task_worker.cpp | 4 +- .../runtime/task}/task_worker.h | 10 +- .../runtime/task}/timer_service.h | 11 +- src/rdsn/src/runtime/test/async_call.cpp | 19 +- .../runtime/test/client_negotiation_test.cpp | 4 +- src/rdsn/src/runtime/test/corrupt_message.cpp | 17 +- src/rdsn/src/runtime/test/lpc.cpp | 15 +- .../src/runtime/test/message_reader_test.cpp | 2 +- .../src/runtime/test/message_utils_test.cpp | 6 +- .../test/meta_access_controller_test.cpp | 21 +- .../runtime/test/negotiation_manager_test.cpp | 6 +- src/rdsn/src/runtime/test/netprovider.cpp | 21 +- src/rdsn/src/runtime/test/pipeline_test.cpp | 19 +- .../test/replica_access_controller_test.cpp | 19 +- src/rdsn/src/runtime/test/rpc.cpp | 21 +- src/rdsn/src/runtime/test/rpc_holder_test.cpp | 6 +- src/rdsn/src/runtime/test/rpc_message.cpp | 4 +- .../runtime/test/server_negotiation_test.cpp | 2 +- src/rdsn/src/runtime/test/service_api_c.cpp | 23 +- src/rdsn/src/runtime/test/sim_lock.cpp | 19 +- src/rdsn/src/runtime/test/task_engine.cpp | 2 +- src/rdsn/src/runtime/test/task_test.cpp | 7 +- src/rdsn/src/runtime/test/test_utils.h | 19 +- .../test/thrift_message_parser_test.cpp | 8 +- src/rdsn/src/runtime/threadpool_code.cpp | 4 +- src/rdsn/src/runtime/tool_api.cpp | 6 +- .../{include/dsn => src/runtime}/tool_api.h | 18 +- src/rdsn/src/runtime/tracer.cpp | 8 +- .../dsn/toollet => src/runtime}/tracer.h | 2 +- src/rdsn/src/runtime/zlocks.cpp | 4 +- src/rdsn/src/tools/mutation_log_tool.cpp | 4 +- .../tools}/mutation_log_tool.h | 2 +- .../dsn/utility => src/utils}/TokenBucket.h | 2 +- .../utils}/absl/base/internal/invoke.h | 0 .../utils}/absl/utility/utility.h | 2 +- src/rdsn/src/utils/alloc.cpp | 4 +- .../dsn/utility => src/utils}/alloc.h | 6 +- .../dsn/c => src/utils}/api_utilities.h | 16 +- .../dsn/utility => src/utils}/apply.h | 2 +- .../dsn/utility => src/utils}/autoref_ptr.h | 0 src/rdsn/src/utils/binary_reader.cpp | 7 +- .../dsn/utility => src/utils}/binary_reader.h | 4 +- src/rdsn/src/utils/binary_writer.cpp | 5 +- .../dsn/utility => src/utils}/binary_writer.h | 3 +- .../{include/dsn/utility => src/utils}/blob.h | 47 +++- .../dsn/utility => src/utils}/casts.h | 0 .../utility => src/utils}/chrono_literals.h | 0 src/rdsn/src/utils/clock.cpp | 9 +- .../dsn/utility => src/utils}/clock.h | 0 src/rdsn/src/utils/command_manager.cpp | 4 +- .../tool-api => src/utils}/command_manager.h | 9 +- src/rdsn/src/utils/config_api.cpp | 4 +- .../dsn/utility => src/utils}/config_api.h | 0 .../dsn/utility => src/utils}/config_helper.h | 4 +- src/rdsn/src/utils/configuration.cpp | 8 +- .../dsn/utility => src/utils}/configuration.h | 4 +- src/rdsn/src/utils/coredump.posix.cpp | 4 +- src/rdsn/src/utils/crc.cpp | 2 +- .../{include/dsn/utility => src/utils}/crc.h | 0 .../utility => src/utils}/customizable_id.h | 8 +- .../dsn/utility => src/utils}/defer.h | 0 .../utils}/distributed_lock_service.h | 19 +- .../{include/dsn/utility => src/utils}/dlib.h | 0 .../dsn/utility => src/utils}/endians.h | 8 +- .../dsn/utility => src/utils}/enum_helper.h | 0 src/rdsn/src/utils/error_code.cpp | 2 +- .../dsn/utility => src/utils}/error_code.h | 2 +- .../dsn/utility => src/utils}/errors.h | 8 +- .../dsn/utility => src/utils}/exp_delay.h | 2 +- .../utility => src/utils}/extensible_object.h | 2 +- .../dsn/utility => src/utils}/factory_store.h | 2 +- src/rdsn/src/utils/fail_point.cpp | 4 +- .../dsn/utility => src/utils}/fail_point.h | 2 +- src/rdsn/src/utils/fail_point_impl.h | 6 +- src/rdsn/src/utils/filesystem.cpp | 16 +- .../dsn/utility => src/utils}/filesystem.h | 2 +- .../utils}/fixed_size_buffer_pool.h | 0 src/rdsn/src/utils/flags.cpp | 18 +- .../dsn/utility => src/utils}/flags.h | 0 .../dsn/dist => src/utils}/fmt_logging.h | 0 .../utility => src/utils}/function_traits.h | 0 src/rdsn/src/utils/gpid.cpp | 4 +- .../utils}/hpc_locks/autoresetevent.h | 2 +- .../utils}/hpc_locks/autoreseteventcondvar.h | 0 .../utils}/hpc_locks/benaphore.h | 4 +- .../utils}/hpc_locks/bitfield.h | 0 .../utils}/hpc_locks/readme.txt | 0 .../utility => src/utils}/hpc_locks/rwlock.h | 4 +- .../utility => src/utils}/hpc_locks/sema.h | 0 src/rdsn/src/utils/je_ctl.cpp | 4 +- src/rdsn/src/utils/je_ctl.h | 2 +- .../dsn/utility => src/utils}/join_point.h | 2 +- src/rdsn/src/utils/latency_tracer.cpp | 16 +- .../dsn => src}/utils/latency_tracer.h | 10 +- .../{include/dsn/utility => src/utils}/link.h | 0 src/rdsn/src/utils/lockp.std.h | 2 +- src/rdsn/src/utils/logging.cpp | 13 +- .../tool-api => src/utils}/logging_provider.h | 2 +- src/rdsn/src/utils/long_adder.cpp | 12 +- .../dsn/utility => src/utils}/long_adder.h | 2 +- .../long_adder_bench/long_adder_bench.cpp | 8 +- src/rdsn/src/utils/math.cpp | 4 +- .../{include/dsn/utility => src/utils}/math.h | 0 src/rdsn/src/utils/metrics.cpp | 6 +- .../dsn/utility => src/utils}/metrics.h | 24 +- .../dsn/utility => src/utils}/nth_element.h | 6 +- .../dsn/utility => src/utils}/optional.h | 0 src/rdsn/src/utils/output_utils.cpp | 4 +- .../dsn/utility => src/utils}/output_utils.h | 2 +- .../dsn/utility => src/utils}/ports.h | 0 .../dsn/utility => src/utils}/preloadable.h | 2 +- .../utility => src/utils}/priority_queue.h | 2 +- src/rdsn/src/utils/process_utils.cpp | 8 +- .../dsn/utility => src/utils}/process_utils.h | 2 +- src/rdsn/src/utils/rand.cpp | 2 +- .../{include/dsn/utility => src/utils}/rand.h | 0 src/rdsn/src/utils/rpc_address.cpp | 12 +- .../dsn/tool-api => src/utils}/rpc_address.h | 3 +- src/rdsn/src/utils/safe_strerror_posix.cpp | 2 +- .../utils}/safe_strerror_posix.h | 0 src/rdsn/src/utils/shared_io_service.cpp | 2 +- src/rdsn/src/utils/shared_io_service.h | 2 +- src/rdsn/src/utils/simple_logger.cpp | 6 +- src/rdsn/src/utils/simple_logger.h | 2 +- .../dsn/utility => src/utils}/singleton.h | 0 .../utility => src/utils}/singleton_store.h | 4 +- .../utility => src/utils}/smart_pointers.h | 0 .../dsn/utility => src/utils}/string_conv.h | 2 +- .../utility => src/utils}/string_splitter.h | 0 src/rdsn/src/utils/string_view.cpp | 6 +- .../dsn/utility => src/utils}/string_view.h | 16 +- src/rdsn/src/utils/strings.cpp | 3 +- .../dsn/utility => src/utils}/strings.h | 0 .../dsn/utility => src/utils}/synchronize.h | 10 +- .../dsn/utility => src/utils}/sys_exit_hook.h | 2 +- src/rdsn/src/utils/test/TokenBucketTest.cpp | 2 +- src/rdsn/src/utils/test/TokenBucketTest.h | 2 +- src/rdsn/src/utils/test/address.cpp | 4 +- src/rdsn/src/utils/test/autoref_ptr_test.cpp | 2 +- .../src/utils/test/binary_reader_test.cpp | 4 +- src/rdsn/src/utils/test/command_manager.cpp | 2 +- src/rdsn/src/utils/test/configuration.cpp | 2 +- src/rdsn/src/utils/test/endian_test.cpp | 2 +- src/rdsn/src/utils/test/env.cpp | 2 +- src/rdsn/src/utils/test/file_system_test.cpp | 2 +- src/rdsn/src/utils/test/file_utils.cpp | 19 +- src/rdsn/src/utils/test/flag_test.cpp | 2 +- src/rdsn/src/utils/test/fmt_logging_test.cpp | 8 +- src/rdsn/src/utils/test/hostname_test.cpp | 4 +- src/rdsn/src/utils/test/join_point_test.cpp | 2 +- src/rdsn/src/utils/test/json_helper_test.cpp | 2 +- .../src/utils/test/latency_tracer_test.cpp | 4 +- src/rdsn/src/utils/test/logger.cpp | 2 +- src/rdsn/src/utils/test/logging.cpp | 4 +- src/rdsn/src/utils/test/long_adder_test.cpp | 4 +- src/rdsn/src/utils/test/main.cpp | 6 +- src/rdsn/src/utils/test/metrics_test.cpp | 4 +- .../nth_element_bench/nth_element_bench.cpp | 10 +- src/rdsn/src/utils/test/nth_element_test.cpp | 2 +- src/rdsn/src/utils/test/nth_element_utils.h | 10 +- src/rdsn/src/utils/test/output_utils_test.cpp | 2 +- src/rdsn/src/utils/test/percentile_utils.h | 6 +- src/rdsn/src/utils/test/priority_queue.cpp | 2 +- src/rdsn/src/utils/test/rand_test.cpp | 2 +- src/rdsn/src/utils/test/sema.cpp | 2 +- .../src/utils/test/smart_pointers_test.cpp | 2 +- src/rdsn/src/utils/test/string_conv_test.cpp | 2 +- src/rdsn/src/utils/test/string_view_test.cpp | 2 +- src/rdsn/src/utils/test/time_utils_test.cpp | 4 +- ...oken_bucket_throttling_controller_test.cpp | 2 +- .../src/utils/test/token_buckets_test.cpp | 2 +- src/rdsn/src/utils/test/utils.cpp | 18 +- src/rdsn/src/utils/thread_access_checker.cpp | 6 +- .../utils}/thread_access_checker.h | 0 .../tool-api => src/utils}/threadpool_code.h | 2 +- .../tool-api => src/utils}/threadpool_spec.h | 6 +- src/rdsn/src/utils/throttling_controller.cpp | 6 +- src/rdsn/src/utils/time_utils.cpp | 2 +- .../{include/dsn => src}/utils/time_utils.h | 3 +- .../dsn/utility => src/utils}/timer.h | 2 +- .../token_bucket_throttling_controller.cpp | 6 +- .../token_bucket_throttling_controller.h | 2 +- src/rdsn/src/utils/token_buckets.cpp | 2 +- .../dsn => src}/utils/token_buckets.h | 4 +- .../utils}/uniq_timestamp_us.h | 5 +- src/rdsn/src/utils/utils.cpp | 19 +- .../dsn/utility => src/utils}/utils.h | 13 +- .../dsn/utility => src/utils}/work_queue.h | 4 +- src/rdsn/src/utils/zlock_provider.h | 6 +- .../dsn/tool-api => src/utils}/zlocks.h | 4 +- .../distributed_lock_service_zookeeper.cpp | 4 +- .../distributed_lock_service_zookeeper.h | 2 +- src/rdsn/src/zookeeper/lock_struct.cpp | 4 +- src/rdsn/src/zookeeper/lock_struct.h | 4 +- src/rdsn/src/zookeeper/lock_types.h | 9 +- .../test/distributed_lock_zookeeper.cpp | 15 +- src/rdsn/src/zookeeper/test/main.cpp | 15 +- src/rdsn/src/zookeeper/zookeeper_error.cpp | 7 +- src/rdsn/src/zookeeper/zookeeper_error.h | 5 +- src/rdsn/src/zookeeper/zookeeper_session.cpp | 2 +- src/rdsn/src/zookeeper/zookeeper_session.h | 6 +- .../src/zookeeper/zookeeper_session_mgr.h | 17 +- src/redis_protocol/proxy_lib/proxy_layer.cpp | 2 +- src/redis_protocol/proxy_lib/proxy_layer.h | 17 +- src/redis_protocol/proxy_lib/redis_parser.cpp | 6 +- .../proxy_ut/redis_proxy_test.cpp | 4 +- src/reporter/pegasus_counter_reporter.cpp | 8 +- src/reporter/pegasus_counter_reporter.h | 6 +- src/reporter/pegasus_io_service.h | 2 +- src/sample/{Makefile => CMakeLists.txt} | 29 +-- src/sample/README.md | 5 - src/sample/run.sh | 4 +- src/server/available_detector.cpp | 4 +- src/server/available_detector.h | 4 +- src/server/brief_stat.cpp | 4 +- src/server/capacity_unit_calculator.cpp | 4 +- src/server/capacity_unit_calculator.h | 5 +- src/server/compaction_filter_rule.cpp | 6 +- src/server/compaction_filter_rule.h | 4 +- src/server/hashkey_transform.h | 6 +- src/server/hotkey_collector.cpp | 8 +- src/server/hotkey_collector.h | 10 +- src/server/hotkey_collector_state.h | 2 +- src/server/hotspot_partition_calculator.cpp | 12 +- src/server/hotspot_partition_calculator.h | 4 +- src/server/info_collector.cpp | 6 +- src/server/info_collector.h | 23 +- src/server/info_collector_app.cpp | 19 +- src/server/info_collector_app.h | 4 +- src/server/logging_utils.h | 2 +- src/server/main.cpp | 8 +- src/server/meta_store.cpp | 4 +- src/server/meta_store.h | 2 +- src/server/pegasus_event_listener.cpp | 2 +- src/server/pegasus_event_listener.h | 4 +- src/server/pegasus_manual_compact_service.cpp | 10 +- src/server/pegasus_manual_compact_service.h | 14 +- src/server/pegasus_mutation_duplicator.cpp | 4 +- src/server/pegasus_mutation_duplicator.h | 8 +- src/server/pegasus_read_service.h | 4 +- src/server/pegasus_scan_context.h | 4 +- src/server/pegasus_server_impl.cpp | 18 +- src/server/pegasus_server_impl.h | 6 +- src/server/pegasus_server_impl_init.cpp | 4 +- src/server/pegasus_server_write.cpp | 6 +- src/server/pegasus_server_write.h | 2 +- src/server/pegasus_service_app.h | 4 +- src/server/pegasus_write_service.cpp | 6 +- src/server/pegasus_write_service.h | 16 +- src/server/pegasus_write_service_impl.h | 6 +- src/server/range_read_limiter.h | 2 +- src/server/result_writer.cpp | 2 +- src/server/result_writer.h | 8 +- src/server/rocksdb_wrapper.cpp | 2 +- src/server/rocksdb_wrapper.h | 2 +- .../test/capacity_unit_calculator_test.cpp | 4 +- src/server/test/compaction_operation_test.cpp | 2 +- src/server/test/hotkey_collector_test.cpp | 8 +- src/server/test/hotspot_partition_test.cpp | 2 +- src/server/test/main.cpp | 17 +- .../test/manual_compact_service_test.cpp | 2 +- src/server/test/message_utils.h | 2 +- .../test/pegasus_mutation_duplicator_test.cpp | 4 +- src/server/test/pegasus_server_test_base.h | 4 +- src/server/test/pegasus_server_write_test.cpp | 4 +- .../test/pegasus_write_service_impl_test.cpp | 2 +- .../test/pegasus_write_service_test.cpp | 2 +- src/shell/args.h | 4 +- src/shell/command_executor.h | 2 +- src/shell/command_helper.h | 16 +- src/shell/command_output.h | 2 +- src/shell/command_utils.h | 2 +- src/shell/commands.h | 12 +- src/shell/commands/detect_hotkey.cpp | 8 +- src/shell/commands/duplication.cpp | 8 +- src/shell/commands/node_management.cpp | 2 +- src/shell/commands/table_management.cpp | 2 +- src/shell/main.cpp | 2 +- src/test/bench_test/benchmark.cpp | 8 +- src/test/bench_test/config.cpp | 2 +- src/test/bench_test/config.h | 2 +- src/test/bench_test/main.cpp | 4 +- src/test/bench_test/statistics.cpp | 2 +- .../backup_restore_test/main.cpp | 2 +- .../test_backup_and_restore.cpp | 10 +- src/test/function_test/base_api_test/main.cpp | 2 +- .../base_api_test/test_basic.cpp | 6 +- .../base_api_test/test_batch_get.cpp | 8 +- .../base_api_test/test_check_and_mutate.cpp | 6 +- .../base_api_test/test_check_and_set.cpp | 6 +- .../function_test/base_api_test/test_copy.cpp | 10 +- .../function_test/base_api_test/test_incr.cpp | 6 +- .../base_api_test/test_range_read.cpp | 6 +- .../base_api_test/test_recall.cpp | 8 +- .../function_test/base_api_test/test_scan.cpp | 8 +- .../function_test/base_api_test/test_ttl.cpp | 2 +- .../function_test/bulk_load_test/main.cpp | 2 +- .../bulk_load_test/test_bulk_load.cpp | 10 +- .../detect_hotspot_test/main.cpp | 2 +- .../test_detect_hotspot.cpp | 10 +- .../partition_split_test/main.cpp | 2 +- .../partition_split_test/test_split.cpp | 2 +- src/test/function_test/recovery_test/main.cpp | 2 +- .../recovery_test/test_recovery.cpp | 10 +- src/test/function_test/restore_test/main.cpp | 2 +- .../restore_test/test_restore.cpp | 6 +- src/test/function_test/throttle_test/main.cpp | 2 +- .../throttle_test/test_throttle.cpp | 23 +- src/test/function_test/utils/global_env.cpp | 8 +- src/test/function_test/utils/global_env.h | 2 +- src/test/function_test/utils/test_util.cpp | 6 +- src/test/function_test/utils/utils.h | 8 +- src/test/kill_test/data_verifier.cpp | 15 +- src/test/kill_test/kill_testor.cpp | 19 +- src/test/kill_test/kill_testor.h | 2 +- src/test/kill_test/killer_handler.h | 2 +- src/test/kill_test/killer_handler_shell.cpp | 6 +- src/test/kill_test/partition_kill_testor.cpp | 2 +- src/test/kill_test/partition_kill_testor.h | 2 +- src/test/kill_test/process_kill_testor.cpp | 4 +- src/test/pressure_test/main.cpp | 8 +- 745 files changed, 3385 insertions(+), 2668 deletions(-) delete mode 100644 src/rdsn/include/dsn/c/api_common.h delete mode 100644 src/rdsn/include/dsn/dist/failure_detector.h delete mode 100644 src/rdsn/include/dsn/dist/replication.h delete mode 100644 src/rdsn/include/dsn/dist/replication/replication_types.h delete mode 100644 src/rdsn/include/dsn/service_api_cpp.h delete mode 100644 src/rdsn/include/dsn/tool-api/auto_codes.h rename src/rdsn/{include/dsn/tool-api => src/aio}/aio_task.h (99%) rename src/rdsn/{include/dsn/tool-api => src/aio}/file_io.h (98%) rename src/rdsn/{include/dsn/dist => src/block_service}/block_service.h (95%) rename src/rdsn/{include/dsn/dist/replication => src/client}/partition_resolver.h (95%) rename src/rdsn/{include/dsn/dist/replication => src/client}/replication_ddl_client.h (95%) rename src/rdsn/{include/dsn/service_api_c.h => src/common/api_common.h} (76%) rename src/rdsn/{include/dsn/dist => src/common}/common.h (100%) rename src/rdsn/{include/dsn/dist/replication => src/common}/duplication_common.h (91%) rename src/rdsn/{include/dsn/tool-api => src/common}/gpid.h (100%) rename src/rdsn/{include/dsn/cpp => src/common}/json_helper.h (98%) rename src/rdsn/{include/dsn/dist/replication => src/common}/replica_envs.h (100%) rename src/rdsn/{include/dsn/dist/replication => src/common}/replication.codes.h (98%) rename src/rdsn/{include/dsn/dist/replication => src/common}/replication_enums.h (99%) rename src/rdsn/{include/dsn/dist/replication => src/common}/replication_other_types.h (93%) rename src/rdsn/{include/dsn/cpp => src/common}/serialization_helper/dsn_types.h (96%) rename src/rdsn/{include/dsn/cpp => src/common}/serialization_helper/thrift_helper.h (92%) rename src/rdsn/{include/dsn/dist/replication => src/common}/storage_serverlet.h (91%) rename src/rdsn/{include/dsn/dist => src}/failure_detector/failure_detector.h (97%) rename src/rdsn/{include/dsn/dist => src/failure_detector}/failure_detector_multimaster.h (91%) rename src/rdsn/{include/dsn/dist => src}/failure_detector/fd.client.h (98%) rename src/rdsn/{include/dsn/dist => src}/failure_detector/fd.code.definition.h (78%) rename src/rdsn/{include/dsn/dist => src}/failure_detector/fd.server.h (100%) rename src/rdsn/{include/dsn => src}/http/http_server.h (96%) rename src/rdsn/{include/dsn/dist/replication => src/meta}/meta_service_app.h (98%) rename src/rdsn/{include/dsn/dist => src/meta}/meta_state_service.h (93%) rename src/rdsn/{include/dsn/dist => src/nfs}/nfs_node.h (96%) rename src/rdsn/{include/dsn => src}/perf_counter/perf_counter.h (97%) rename src/rdsn/{include/dsn => src}/perf_counter/perf_counter_utils.h (95%) rename src/rdsn/{include/dsn => src}/perf_counter/perf_counter_wrapper.h (97%) rename src/rdsn/{include/dsn => src}/perf_counter/perf_counters.h (97%) rename src/rdsn/{include/dsn/dist => src/remote_cmd}/remote_command.h (95%) rename src/rdsn/{include/dsn/dist/replication => src/replica/duplication}/mutation_duplicator.h (90%) rename src/rdsn/{include/dsn/dist/replication => src/replica}/replica_base.h (96%) rename src/rdsn/{include/dsn/dist/replication => src/replica}/replica_test_utils.h (97%) rename src/rdsn/{include/dsn/dist/replication => src/replica}/replication_app_base.h (96%) rename src/rdsn/{include/dsn/dist/replication => src/replica}/replication_service_app.h (89%) rename src/rdsn/{include/dsn/c => src/runtime}/api_layer1.h (96%) rename src/rdsn/{include/dsn/c => src/runtime}/api_task.h (88%) rename src/rdsn/{include/dsn/c => src/runtime}/app_model.h (94%) rename src/rdsn/{include/dsn/tool-api => src/runtime}/env_provider.h (84%) rename src/rdsn/{include/dsn/toollet => src/runtime}/fault_injector.h (91%) rename src/rdsn/{include/dsn/tool-api => src/runtime}/global_config.h (98%) rename src/rdsn/{include/dsn/cpp => src/runtime}/message_utils.h (90%) rename src/rdsn/{include/dsn/tool => src/runtime}/nativerun.h (98%) rename src/rdsn/{include/dsn/tool => src/runtime}/node_scoper.h (89%) rename src/rdsn/{include/dsn/cpp => src/runtime}/pipeline.h (98%) rename src/rdsn/{include/dsn/toollet => src/runtime}/profiler.h (98%) rename src/rdsn/{include/dsn/tool => src/runtime}/providers.common.h (87%) rename src/rdsn/{include/dsn/tool-api => src/runtime/rpc}/group_address.h (96%) rename src/rdsn/{include/dsn/tool-api => src/runtime/rpc}/message_parser.h (93%) rename src/rdsn/{include/dsn/tool-api => src/runtime/rpc}/network.h (97%) rename src/rdsn/{include/dsn/cpp => src/runtime/rpc}/rpc_holder.h (94%) rename src/rdsn/{include/dsn/tool-api => src/runtime/rpc}/rpc_message.h (96%) rename src/rdsn/{include/dsn/cpp => src/runtime/rpc}/rpc_stream.h (90%) rename src/rdsn/{include/dsn/cpp => src/runtime/rpc}/serialization.h (95%) rename src/rdsn/{include/dsn/cpp => src/runtime}/serverlet.h (98%) rename src/rdsn/{include/dsn/cpp => src/runtime}/service_app.h (89%) rename src/rdsn/{include/dsn/tool => src/runtime}/simulator.h (88%) rename src/rdsn/{include/dsn/tool-api => src/runtime/task}/async_calls.h (96%) rename src/rdsn/{include/dsn/tool-api => src/runtime/task}/future_types.h (95%) rename src/rdsn/{include/dsn/tool-api => src/runtime/task}/task.h (96%) rename src/rdsn/{include/dsn/tool-api => src/runtime/task}/task_code.h (98%) rename src/rdsn/{include/dsn/tool-api => src/runtime/task}/task_queue.h (91%) rename src/rdsn/{include/dsn/tool-api => src/runtime/task}/task_spec.h (96%) rename src/rdsn/{include/dsn/tool-api => src/runtime/task}/task_tracker.h (98%) rename src/rdsn/{include/dsn/tool-api => src/runtime/task}/task_worker.h (94%) rename src/rdsn/{include/dsn/tool-api => src/runtime/task}/timer_service.h (90%) rename src/rdsn/{include/dsn => src/runtime}/tool_api.h (94%) rename src/rdsn/{include/dsn/toollet => src/runtime}/tracer.h (98%) rename src/rdsn/{include/dsn/dist/replication => src/tools}/mutation_log_tool.h (97%) rename src/rdsn/{include/dsn/utility => src/utils}/TokenBucket.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/absl/base/internal/invoke.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/absl/utility/utility.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/alloc.h (96%) rename src/rdsn/{include/dsn/c => src/utils}/api_utilities.h (96%) rename src/rdsn/{include/dsn/utility => src/utils}/apply.h (96%) rename src/rdsn/{include/dsn/utility => src/utils}/autoref_ptr.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/binary_reader.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/binary_writer.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/blob.h (77%) rename src/rdsn/{include/dsn/utility => src/utils}/casts.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/chrono_literals.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/clock.h (100%) rename src/rdsn/{include/dsn/tool-api => src/utils}/command_manager.h (96%) rename src/rdsn/{include/dsn/utility => src/utils}/config_api.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/config_helper.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/configuration.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/crc.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/customizable_id.h (96%) rename src/rdsn/{include/dsn/utility => src/utils}/defer.h (100%) rename src/rdsn/{include/dsn/dist => src/utils}/distributed_lock_service.h (93%) rename src/rdsn/{include/dsn/utility => src/utils}/dlib.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/endians.h (96%) rename src/rdsn/{include/dsn/utility => src/utils}/enum_helper.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/error_code.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/errors.h (97%) rename src/rdsn/{include/dsn/utility => src/utils}/exp_delay.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/extensible_object.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/factory_store.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/fail_point.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/filesystem.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/fixed_size_buffer_pool.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/flags.h (100%) rename src/rdsn/{include/dsn/dist => src/utils}/fmt_logging.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/function_traits.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/hpc_locks/autoresetevent.h (98%) rename src/rdsn/{include/dsn/utility => src/utils}/hpc_locks/autoreseteventcondvar.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/hpc_locks/benaphore.h (97%) rename src/rdsn/{include/dsn/utility => src/utils}/hpc_locks/bitfield.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/hpc_locks/readme.txt (100%) rename src/rdsn/{include/dsn/utility => src/utils}/hpc_locks/rwlock.h (98%) rename src/rdsn/{include/dsn/utility => src/utils}/hpc_locks/sema.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/join_point.h (99%) rename src/rdsn/{include/dsn => src}/utils/latency_tracer.h (97%) rename src/rdsn/{include/dsn/utility => src/utils}/link.h (100%) rename src/rdsn/{include/dsn/tool-api => src/utils}/logging_provider.h (98%) rename src/rdsn/{include/dsn/utility => src/utils}/long_adder.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/math.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/metrics.h (98%) rename src/rdsn/{include/dsn/utility => src/utils}/nth_element.h (98%) rename src/rdsn/{include/dsn/utility => src/utils}/optional.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/output_utils.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/ports.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/preloadable.h (97%) rename src/rdsn/{include/dsn/utility => src/utils}/priority_queue.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/process_utils.h (98%) rename src/rdsn/{include/dsn/utility => src/utils}/rand.h (100%) rename src/rdsn/{include/dsn/tool-api => src/utils}/rpc_address.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/safe_strerror_posix.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/singleton.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/singleton_store.h (98%) rename src/rdsn/{include/dsn/utility => src/utils}/smart_pointers.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/string_conv.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/string_splitter.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/string_view.h (98%) rename src/rdsn/{include/dsn/utility => src/utils}/strings.h (100%) rename src/rdsn/{include/dsn/utility => src/utils}/synchronize.h (95%) rename src/rdsn/{include/dsn/utility => src/utils}/sys_exit_hook.h (97%) rename src/rdsn/{include/dsn/tool-api => src/utils}/thread_access_checker.h (100%) rename src/rdsn/{include/dsn/tool-api => src/utils}/threadpool_code.h (98%) rename src/rdsn/{include/dsn/tool-api => src/utils}/threadpool_spec.h (97%) rename src/rdsn/{include/dsn => src}/utils/time_utils.h (99%) rename src/rdsn/{include/dsn/utility => src/utils}/timer.h (97%) rename src/rdsn/{include/dsn => src}/utils/token_bucket_throttling_controller.h (98%) rename src/rdsn/{include/dsn => src}/utils/token_buckets.h (94%) rename src/rdsn/{include/dsn/tool-api => src/utils}/uniq_timestamp_us.h (96%) rename src/rdsn/{include/dsn/utility => src/utils}/utils.h (95%) rename src/rdsn/{include/dsn/utility => src/utils}/work_queue.h (97%) rename src/rdsn/{include/dsn/tool-api => src/utils}/zlocks.h (97%) rename src/sample/{Makefile => CMakeLists.txt} (53%) diff --git a/.github/workflows/lint_and_test_cpp.yaml b/.github/workflows/lint_and_test_cpp.yaml index f1778c6c5c..fd170a3b64 100644 --- a/.github/workflows/lint_and_test_cpp.yaml +++ b/.github/workflows/lint_and_test_cpp.yaml @@ -108,7 +108,7 @@ jobs: run: | mv thirdparty/hadoop-bin ./ rm -rf thirdparty - tar -zcvhf release__builder.tar DSN_ROOT/ src/builder/bin src/builder/src/server/test/config.ini hadoop-bin --exclude='*CMakeFiles*' + tar -zcvhf release__builder.tar src/builder/output src/builder/bin src/builder/src/server/test/config.ini hadoop-bin --exclude='*CMakeFiles*' - name: Upload Artifact uses: actions/upload-artifact@v3 with: @@ -222,7 +222,7 @@ jobs: run: | mv thirdparty/hadoop-bin ./ rm -rf thirdparty - tar -zcvhf release_address_builder.tar DSN_ROOT/ src/builder/bin src/builder/src/server/test/config.ini hadoop-bin --exclude='*CMakeFiles*' + tar -zcvhf release_address_builder.tar src/builder/output src/builder/bin src/builder/src/server/test/config.ini hadoop-bin --exclude='*CMakeFiles*' - name: Upload Artifact uses: actions/upload-artifact@v3 with: @@ -341,7 +341,7 @@ jobs: # run: | # mv thirdparty/hadoop-bin ./ # rm -rf thirdparty -# tar -zcvhf release_undefined_builder.tar DSN_ROOT/ src/builder/bin src/builder/src/server/test/config.ini hadoop-bin --exclude='*CMakeFiles*' +# tar -zcvhf release_undefined_builder.tar src/builder/output src/builder/bin src/builder/src/server/test/config.ini hadoop-bin --exclude='*CMakeFiles*' # - name: Upload Artifact # uses: actions/upload-artifact@v3 # with: @@ -457,7 +457,7 @@ jobs: run: | mv thirdparty/hadoop-bin ./ rm -rf thirdparty - tar -zcvhf release_jemalloc_builder.tar DSN_ROOT/ src/builder/bin src/builder/src/server/test/config.ini hadoop-bin --exclude='*CMakeFiles*' + tar -zcvhf release_jemalloc_builder.tar src/builder/output src/builder/bin src/builder/src/server/test/config.ini hadoop-bin --exclude='*CMakeFiles*' - name: Upload Artifact uses: actions/upload-artifact@v3 with: diff --git a/.gitignore b/.gitignore index 8448fcc476..e75d1ad43b 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,7 @@ src/.matchfile src/base/rrdb_types.cpp src/include/rrdb/rrdb_types.h -src/rdsn/include/dsn/cpp/serialization_helper/dsn.layer2_types.h +src/rdsn/src/common/serialization_helper/dsn.layer2_types.h src/rdsn/src/runtime/dsn.layer2_types.cpp src/runtime src/*builder @@ -38,7 +38,6 @@ src/include/pegasus/git_commit.h src/sample/data src/sample/pegasus_cpp_sample test_report -DSN_ROOT *.config *.creator *.creator.* diff --git a/.licenserc.yaml b/.licenserc.yaml index 588b47f544..3c4685781d 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -43,27 +43,27 @@ header: - 'nodejs-client/src/dsn/*.js' - '**/.npmigonre' # Copyright (c) Facebook, Inc - - 'src/rdsn/include/dsn/utility/TokenBucket.h' + - 'src/rdsn/src/utils/TokenBucket.h' - 'src/rdsn/src/utils/test/TokenBucketTest.cpp' - 'src/rdsn/src/utils/test/TokenBucketTest.h' # https://github.com/preshing/cpp11-on-multicore/blob/master/LICENSE - - 'src/rdsn/include/dsn/utility/hpc_locks/autoresetevent.h' - - 'src/rdsn/include/dsn/utility/hpc_locks/autoreseteventcondvar.h' - - 'src/rdsn/include/dsn/utility/hpc_locks/benaphore.h' - - 'src/rdsn/include/dsn/utility/hpc_locks/bitfield.h' - - 'src/rdsn/include/dsn/utility/hpc_locks/readme.txt' - - 'src/rdsn/include/dsn/utility/hpc_locks/rwlock.h' - - 'src/rdsn/include/dsn/utility/hpc_locks/sema.h' + - 'src/rdsn/src/utils/hpc_locks/autoresetevent.h' + - 'src/rdsn/src/utils/hpc_locks/autoreseteventcondvar.h' + - 'src/rdsn/src/utils/hpc_locks/benaphore.h' + - 'src/rdsn/src/utils/hpc_locks/bitfield.h' + - 'src/rdsn/src/utils/hpc_locks/readme.txt' + - 'src/rdsn/src/utils/hpc_locks/rwlock.h' + - 'src/rdsn/src/utils/hpc_locks/sema.h' # Copyright (c) xxxx The Chromium Authors - - 'src/rdsn/include/dsn/utility/safe_strerror_posix.h' + - 'src/rdsn/src/utils/safe_strerror_posix.h' - 'src/rdsn/src/runtime/build_config.h' - 'src/rdsn/src/utils/test/autoref_ptr_test.cpp' - 'src/rdsn/src/utils/safe_strerror_posix.cpp' # Copyright 2017 The Abseil Authors - - 'src/rdsn/include/dsn/utility/absl/base/internal/invoke.h' - - 'src/rdsn/include/dsn/utility/absl/utility/utility.h' - - 'src/rdsn/include/dsn/utility/smart_pointers.h' - - 'src/rdsn/include/dsn/utility/string_view.h' + - 'src/rdsn/src/utils/absl/base/internal/invoke.h' + - 'src/rdsn/src/utils/absl/utility/utility.h' + - 'src/rdsn/src/utils/smart_pointers.h' + - 'src/rdsn/src/utils/string_view.h' - 'src/rdsn/src/utils/test/memutil_test.cpp' - 'src/rdsn/src/utils/test/string_view_test.cpp' - 'src/rdsn/src/utils/test/smart_pointers_test.cpp' @@ -96,114 +96,109 @@ header: - 'idl/dsn.thrift' - 'scripts/compile_thrift.py' - 'scripts/learn_stat.py' - - 'src/rdsn/include/dsn/c/api_common.h' - - 'src/rdsn/include/dsn/c/api_layer1.h' - - 'src/rdsn/include/dsn/c/api_task.h' - - 'src/rdsn/include/dsn/c/api_utilities.h' - - 'src/rdsn/include/dsn/c/app_model.h' - - 'src/rdsn/include/dsn/cpp/json_helper.h' - - 'src/rdsn/include/dsn/cpp/rpc_stream.h' - - 'src/rdsn/include/dsn/cpp/serialization.h' - - 'src/rdsn/include/dsn/cpp/serialization_helper/dsn.layer2_types.h' - - 'src/rdsn/include/dsn/cpp/serialization_helper/dsn_types.h' - - 'src/rdsn/include/dsn/cpp/serialization_helper/thrift_helper.h' - - 'src/rdsn/include/dsn/cpp/serverlet.h' - - 'src/rdsn/include/dsn/cpp/service_app.h' - - 'src/rdsn/include/dsn/dist/distributed_lock_service.h' - - 'src/rdsn/include/dsn/dist/failure_detector.h' - - 'src/rdsn/include/dsn/dist/failure_detector/failure_detector.h' - - 'src/rdsn/include/dsn/dist/failure_detector/fd.client.h' - - 'src/rdsn/include/dsn/dist/failure_detector/fd.code.definition.h' - - 'src/rdsn/include/dsn/dist/failure_detector/fd.server.h' - - 'src/rdsn/include/dsn/dist/failure_detector_multimaster.h' - - 'src/rdsn/include/dsn/dist/meta_state_service.h' - - 'src/rdsn/include/dsn/dist/nfs_node.h' - - 'src/rdsn/include/dsn/dist/replication.h' - - 'src/rdsn/include/dsn/dist/replication/meta_service_app.h' - - 'src/rdsn/include/dsn/dist/replication/mutation_log_tool.h' - - 'src/rdsn/include/dsn/dist/replication/partition_resolver.h' - - 'src/rdsn/include/dsn/dist/replication/replica_base.h' - - 'src/rdsn/include/dsn/dist/replication/replica_envs.h' - - 'src/rdsn/include/dsn/dist/replication/replica_test_utils.h' - - 'src/rdsn/include/dsn/dist/replication/replication.codes.h' - - 'src/rdsn/include/dsn/dist/replication/replication_app_base.h' - - 'src/rdsn/include/dsn/dist/replication/replication_ddl_client.h' - - 'src/rdsn/include/dsn/dist/replication/replication_enums.h' - - 'src/rdsn/include/dsn/dist/replication/replication_other_types.h' - - 'src/rdsn/include/dsn/dist/replication/replication_service_app.h' - - 'src/rdsn/include/dsn/dist/replication/storage_serverlet.h' - - 'src/rdsn/include/dsn/perf_counter/perf_counter.h' - - 'src/rdsn/include/dsn/perf_counter/perf_counter_wrapper.h' - - 'src/rdsn/include/dsn/perf_counter/perf_counters.h' - - 'src/rdsn/include/dsn/service_api_c.h' - - 'src/rdsn/include/dsn/service_api_cpp.h' - - 'src/rdsn/include/dsn/tool-api/aio_task.h' - - 'src/rdsn/include/dsn/tool-api/async_calls.h' - - 'src/rdsn/include/dsn/tool-api/auto_codes.h' - - 'src/rdsn/include/dsn/tool-api/command_manager.h' - - 'src/rdsn/include/dsn/tool-api/env_provider.h' - - 'src/rdsn/include/dsn/tool-api/file_io.h' - - 'src/rdsn/include/dsn/tool-api/future_types.h' - - 'src/rdsn/include/dsn/tool-api/global_config.h' - - 'src/rdsn/include/dsn/tool-api/gpid.h' - - 'src/rdsn/include/dsn/tool-api/group_address.h' - - 'src/rdsn/include/dsn/tool-api/logging_provider.h' - - 'src/rdsn/include/dsn/tool-api/message_parser.h' - - 'src/rdsn/include/dsn/tool-api/network.h' - - 'src/rdsn/include/dsn/tool-api/rpc_address.h' - - 'src/rdsn/include/dsn/tool-api/rpc_message.h' - - 'src/rdsn/include/dsn/tool-api/task.h' - - 'src/rdsn/include/dsn/tool-api/task_code.h' - - 'src/rdsn/include/dsn/tool-api/task_queue.h' - - 'src/rdsn/include/dsn/tool-api/task_spec.h' - - 'src/rdsn/include/dsn/tool-api/task_tracker.h' - - 'src/rdsn/include/dsn/tool-api/task_worker.h' - - 'src/rdsn/include/dsn/tool-api/thread_access_checker.h' - - 'src/rdsn/include/dsn/tool-api/threadpool_code.h' - - 'src/rdsn/include/dsn/tool-api/threadpool_spec.h' - - 'src/rdsn/include/dsn/tool-api/timer_service.h' - - 'src/rdsn/include/dsn/tool-api/uniq_timestamp_us.h' - - 'src/rdsn/include/dsn/tool-api/zlocks.h' - - 'src/rdsn/include/dsn/tool/nativerun.h' - - 'src/rdsn/include/dsn/tool/node_scoper.h' - - 'src/rdsn/include/dsn/tool/providers.common.h' - - 'src/rdsn/include/dsn/tool/simulator.h' - - 'src/rdsn/include/dsn/tool_api.h' - - 'src/rdsn/include/dsn/toollet/fault_injector.h' - - 'src/rdsn/include/dsn/toollet/profiler.h' - - 'src/rdsn/include/dsn/toollet/tracer.h' - - 'src/rdsn/include/dsn/utility/apply.h' - - 'src/rdsn/include/dsn/utility/autoref_ptr.h' - - 'src/rdsn/include/dsn/utility/binary_reader.h' - - 'src/rdsn/include/dsn/utility/binary_writer.h' - - 'src/rdsn/include/dsn/utility/blob.h' - - 'src/rdsn/include/dsn/utility/chrono_literals.h' - - 'src/rdsn/include/dsn/utility/config_api.h' - - 'src/rdsn/include/dsn/utility/config_helper.h' - - 'src/rdsn/include/dsn/utility/configuration.h' - - 'src/rdsn/include/dsn/utility/crc.h' - - 'src/rdsn/include/dsn/utility/customizable_id.h' - - 'src/rdsn/include/dsn/utility/dlib.h' - - 'src/rdsn/include/dsn/utility/enum_helper.h' - - 'src/rdsn/include/dsn/utility/error_code.h' - - 'src/rdsn/include/dsn/utility/errors.h' - - 'src/rdsn/include/dsn/utility/exp_delay.h' - - 'src/rdsn/include/dsn/utility/extensible_object.h' - - 'src/rdsn/include/dsn/utility/factory_store.h' - - 'src/rdsn/include/dsn/utility/filesystem.h' - - 'src/rdsn/include/dsn/utility/fixed_size_buffer_pool.h' - - 'src/rdsn/include/dsn/utility/function_traits.h' - - 'src/rdsn/include/dsn/utility/join_point.h' - - 'src/rdsn/include/dsn/utility/link.h' - - 'src/rdsn/include/dsn/utility/optional.h' - - 'src/rdsn/include/dsn/utility/ports.h' - - 'src/rdsn/include/dsn/utility/priority_queue.h' - - 'src/rdsn/include/dsn/utility/singleton_store.h' - - 'src/rdsn/include/dsn/utility/strings.h' - - 'src/rdsn/include/dsn/utility/synchronize.h' - - 'src/rdsn/include/dsn/utility/utils.h' - - 'src/rdsn/include/dsn/utility/work_queue.h' - - 'src/rdsn/include/dsn/utils/time_utils.h' + - 'src/rdsn/src/common/api_common.h' + - 'src/rdsn/src/runtime/api_layer1.h' + - 'src/rdsn/src/runtime/api_task.h' + - 'src/rdsn/src/utils/api_utilities.h' + - 'src/rdsn/src/runtime/app_model.h' + - 'src/rdsn/src/common/json_helper.h' + - 'src/rdsn/src/runtime/rpc/rpc_stream.h' + - 'src/rdsn/src/runtime/rpc/serialization.h' + - 'src/rdsn/src/common/serialization_helper/dsn.layer2_types.h' + - 'src/rdsn/src/common/serialization_helper/dsn_types.h' + - 'src/rdsn/src/common/serialization_helper/thrift_helper.h' + - 'src/rdsn/src/runtime/serverlet.h' + - 'src/rdsn/src/runtime/service_app.h' + - 'src/rdsn/src/utils/distributed_lock_service.h' + - 'src/rdsn/src/failure_detector/failure_detector.h' + - 'src/rdsn/src/failure_detector/fd.client.h' + - 'src/rdsn/src/failure_detector/fd.code.definition.h' + - 'src/rdsn/src/failure_detector/fd.server.h' + - 'src/rdsn/src/failure_detector/failure_detector_multimaster.h' + - 'src/rdsn/src/meta/meta_state_service.h' + - 'src/rdsn/src/nfs/nfs_node.h' + - 'src/rdsn/src/meta/meta_service_app.h' + - 'src/rdsn/src/tools/mutation_log_tool.h' + - 'src/rdsn/src/client/partition_resolver.h' + - 'src/rdsn/src/replica/replica_base.h' + - 'src/rdsn/src/common/replica_envs.h' + - 'src/rdsn/src/replica/replica_test_utils.h' + - 'src/rdsn/src/common/replication.codes.h' + - 'src/rdsn/src/replica/replication_app_base.h' + - 'src/rdsn/src/client/replication_ddl_client.h' + - 'src/rdsn/src/common/replication_enums.h' + - 'src/rdsn/src/common/replication_other_types.h' + - 'src/rdsn/src/replica/replication_service_app.h' + - 'src/rdsn/src/common/storage_serverlet.h' + - 'src/rdsn/src/perf_counter/perf_counter.h' + - 'src/rdsn/src/perf_counter/perf_counter_wrapper.h' + - 'src/rdsn/src/perf_counter/perf_counters.h' + - 'src/rdsn/src/aio/aio_task.h' + - 'src/rdsn/src/runtime/task/async_calls.h' + - 'src/rdsn/src/utils/command_manager.h' + - 'src/rdsn/src/runtime/env_provider.h' + - 'src/rdsn/src/aio/file_io.h' + - 'src/rdsn/src/runtime/task/future_types.h' + - 'src/rdsn/src/runtime/global_config.h' + - 'src/rdsn/src/common/gpid.h' + - 'src/rdsn/src/runtime/rpc/group_address.h' + - 'src/rdsn/src/utils/logging_provider.h' + - 'src/rdsn/src/runtime/rpc/message_parser.h' + - 'src/rdsn/src/runtime/rpc/network.h' + - 'src/rdsn/src/utils/rpc_address.h' + - 'src/rdsn/src/runtime/rpc/rpc_message.h' + - 'src/rdsn/src/runtime/task/task.h' + - 'src/rdsn/src/runtime/task/task_code.h' + - 'src/rdsn/src/runtime/task/task_queue.h' + - 'src/rdsn/src/runtime/task/task_spec.h' + - 'src/rdsn/src/runtime/task/task_tracker.h' + - 'src/rdsn/src/runtime/task/task_worker.h' + - 'src/rdsn/src/utils/thread_access_checker.h' + - 'src/rdsn/src/utils/threadpool_code.h' + - 'src/rdsn/src/utils/threadpool_spec.h' + - 'src/rdsn/src/runtime/task/timer_service.h' + - 'src/rdsn/src/utils/uniq_timestamp_us.h' + - 'src/rdsn/src/utils/zlocks.h' + - 'src/rdsn/src/runtime/nativerun.h' + - 'src/rdsn/src/runtime/node_scoper.h' + - 'src/rdsn/src/runtime/providers.common.h' + - 'src/rdsn/src/runtime/simulator.h' + - 'src/rdsn/src/runtime/tool_api.h' + - 'src/rdsn/src/runtime/fault_injector.h' + - 'src/rdsn/src/runtime/profiler.h' + - 'src/rdsn/src/runtime/tracer.h' + - 'src/rdsn/src/utils/apply.h' + - 'src/rdsn/src/utils/autoref_ptr.h' + - 'src/rdsn/src/utils/binary_reader.h' + - 'src/rdsn/src/utils/binary_writer.h' + - 'src/rdsn/src/utils/blob.h' + - 'src/rdsn/src/utils/chrono_literals.h' + - 'src/rdsn/src/utils/config_api.h' + - 'src/rdsn/src/utils/config_helper.h' + - 'src/rdsn/src/utils/configuration.h' + - 'src/rdsn/src/utils/crc.h' + - 'src/rdsn/src/utils/customizable_id.h' + - 'src/rdsn/src/utils/dlib.h' + - 'src/rdsn/src/utils/enum_helper.h' + - 'src/rdsn/src/utils/error_code.h' + - 'src/rdsn/src/utils/errors.h' + - 'src/rdsn/src/utils/exp_delay.h' + - 'src/rdsn/src/utils/extensible_object.h' + - 'src/rdsn/src/utils/factory_store.h' + - 'src/rdsn/src/utils/filesystem.h' + - 'src/rdsn/src/utils/fixed_size_buffer_pool.h' + - 'src/rdsn/src/utils/function_traits.h' + - 'src/rdsn/src/utils/join_point.h' + - 'src/rdsn/src/utils/link.h' + - 'src/rdsn/src/utils/optional.h' + - 'src/rdsn/src/utils/ports.h' + - 'src/rdsn/src/utils/priority_queue.h' + - 'src/rdsn/src/utils/singleton_store.h' + - 'src/rdsn/src/utils/strings.h' + - 'src/rdsn/src/utils/synchronize.h' + - 'src/rdsn/src/utils/utils.h' + - 'src/rdsn/src/utils/work_queue.h' + - 'src/rdsn/src/utils/time_utils.h' - 'src/rdsn/src/aio/CMakeLists.txt' - 'src/rdsn/src/aio/aio_provider.cpp' - 'src/rdsn/src/aio/aio_provider.h' diff --git a/CMakeLists.txt b/CMakeLists.txt index 036041f795..bc451ae269 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,11 +39,6 @@ set(THIRDPARTY_ROOT ${PROJECT_ROOT}/thirdparty) set(THIRDPARTY_INSTALL_DIR ${PROJECT_ROOT}/thirdparty/output) message(STATUS "THIRDPARTY_INSTALL_DIR = ${THIRDPARTY_INSTALL_DIR}") -# TODO(yingchun): we will remove it later -# Set DSN_ROOT to ./DSN_ROOT, this is where rdsn will be installed -set(DSN_ROOT ${PROJECT_ROOT}/DSN_ROOT) -message(STATUS "DSN_ROOT = ${DSN_ROOT}") - set(BUILD_DIR ${PROJECT_ROOT}/src/builder) message(STATUS "BUILD_DIR = ${BUILD_DIR}") diff --git a/LICENSE b/LICENSE index 5353d77296..99162cc85c 100644 --- a/LICENSE +++ b/LICENSE @@ -327,10 +327,10 @@ src/shell/argh.h - BSD-3-Clause License -------------------------------------------------------------------------------- -src/rdsn/include/dsn/utility/smart_pointers.h - Apache 2.0 License -src/rdsn/include/dsn/utility/string_view.h -src/rdsn/include/dsn/utility/absl/base/internal/invoke.h -src/rdsn/include/dsn/utility/absl/utility/utility.h +src/rdsn/src/utils/smart_pointers.h - Apache 2.0 License +src/rdsn/utils/string_view.h +src/rdsn/src/utils/absl/base/internal/invoke.h +src/rdsn/src/utils/absl/utility/utility.h src/rdsn/src/utils/memutil.h src/rdsn/src/utils/string_view.cpp src/rdsn/src/utils/test/memutil_test.cpp @@ -385,7 +385,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -src/rdsn/include/dsn/utility/TokenBucket.h - Apache License, Version 2.0 +src/rdsn/src/utils/TokenBucket.h - Apache License, Version 2.0 src/rdsn/src/utils/test/TokenBucketTest.cpp src/rdsn/src/utils/test/TokenBucketTest.h @@ -405,12 +405,12 @@ limitations under the License. -------------------------------------------------------------------------------- -src/rdsn/include/dsn/utility/hpc_locks/autoreseteventcondvar.h - zlib License -src/rdsn/include/dsn/utility/hpc_locks/rwlock.h -src/rdsn/include/dsn/utility/hpc_locks/autoresetevent.h -src/rdsn/include/dsn/utility/hpc_locks/sema.h -src/rdsn/include/dsn/utility/hpc_locks/bitfield.h -src/rdsn/include/dsn/utility/hpc_locks/benaphore.h +src/rdsn/src/utils/hpc_locks/autoreseteventcondvar.h - zlib License +src/rdsn/src/utils/hpc_locks/rwlock.h +src/rdsn/src/utils/hpc_locks/autoresetevent.h +src/rdsn/src/utils/hpc_locks/sema.h +src/rdsn/src/utils/hpc_locks/bitfield.h +src/rdsn/src/utils/hpc_locks/benaphore.h Copyright (c) 2015 Jeff Preshing @@ -532,7 +532,7 @@ SOFTWARE. -------------------------------------------------------------------------------- -src/rdsn/include/dsn/utility/safe_strerror_posix.h - BSD-3-Clause License +src/rdsn/src/utils/safe_strerror_posix.h - BSD-3-Clause License Copyright (c) 2011 The Chromium Authors. All rights reserved. diff --git a/run.sh b/run.sh index 67e774cc94..aa73be1780 100755 --- a/run.sh +++ b/run.sh @@ -18,13 +18,13 @@ set -e +LOCAL_HOSTNAME=`hostname -f` PID=$$ ROOT=`pwd` -LOCAL_HOSTNAME=`hostname -f` +export BUILD_DIR=$ROOT/src/builder export REPORT_DIR="$ROOT/test_report" -export DSN_ROOT=$ROOT/DSN_ROOT export THIRDPARTY_ROOT=$ROOT/thirdparty -export LD_LIBRARY_PATH=$DSN_ROOT/lib:$THIRDPARTY_ROOT/output/lib:$LD_LIBRARY_PATH +export LD_LIBRARY_PATH=$BUILD_DIR/output/lib:$THIRDPARTY_ROOT/output/lib:$LD_LIBRARY_PATH function usage() { @@ -259,7 +259,6 @@ function run_build() python3 $ROOT/scripts/compile_thrift.py sh ${ROOT}/scripts/recompile_thrift.sh - mkdir -p ${DSN_ROOT} if [ ! -d "$BUILD_DIR" ]; then mkdir -p $BUILD_DIR @@ -615,7 +614,7 @@ function usage_start_onebox() echo " -w|--wait_healthy" echo " wait cluster to become healthy, default not wait" echo " -s|--server_path " - echo " server binary path, default is ${DSN_ROOT}/bin/pegasus_server" + echo " server binary path, default is ${BUILD_DIR}/output/bin/pegasus_server" echo " --config_path" echo " specify the config template path, default is ./src/server/config.min.ini in non-production env" echo " ./src/server/config.ini in production env" @@ -633,7 +632,7 @@ function run_start_onebox() APP_NAME=temp PARTITION_COUNT=8 WAIT_HEALTHY=false - SERVER_PATH=${DSN_ROOT}/bin/pegasus_server + SERVER_PATH=${BUILD_DIR}/output/bin/pegasus_server CONFIG_FILE="" USE_PRODUCT_CONFIG=false OPTS="" @@ -1251,7 +1250,7 @@ s+@ONEBOX_RUN_PATH@+`pwd`+g" ${ROOT}/src/test/kill_test/config.ini >$CONFIG # start verifier mkdir -p onebox/verifier && cd onebox/verifier - ln -s -f ${DSN_ROOT}/bin/pegasus_kill_test/pegasus_kill_test + ln -s -f ${BUILD_DIR}/output/bin/pegasus_kill_test/pegasus_kill_test ln -s -f ${ROOT}/$CONFIG config.ini echo "$PWD/pegasus_kill_test config.ini verifier &>/dev/null &" $PWD/pegasus_kill_test config.ini verifier &>/dev/null & @@ -1262,7 +1261,7 @@ s+@ONEBOX_RUN_PATH@+`pwd`+g" ${ROOT}/src/test/kill_test/config.ini >$CONFIG #start killer mkdir -p onebox/killer && cd onebox/killer - ln -s -f ${DSN_ROOT}/bin/pegasus_kill_test/pegasus_kill_test + ln -s -f ${BUILD_DIR}/output/bin/pegasus_kill_test/pegasus_kill_test ln -s -f ${ROOT}/$CONFIG config.ini echo "$PWD/pegasus_kill_test config.ini $KILLER_TYPE &>/dev/null &" $PWD/pegasus_kill_test config.ini $KILLER_TYPE &>/dev/null & @@ -1478,9 +1477,9 @@ function run_bench() shift done cd ${ROOT} - cp ${DSN_ROOT}/bin/pegasus_bench/config.ini ./config-bench.ini + cp ${BUILD_DIR}/output/bin/pegasus_bench/config.ini ./config-bench.ini fill_bench_config - ln -s -f ${DSN_ROOT}/bin/pegasus_bench/pegasus_bench + ln -s -f ${BUILD_DIR}/output/bin/pegasus_bench/pegasus_bench ./pegasus_bench ./config-bench.ini rm -f ./config-bench.ini } @@ -1607,7 +1606,7 @@ function run_shell() fi cd ${ROOT} - ln -s -f ${DSN_ROOT}/bin/pegasus_shell/pegasus_shell + ln -s -f ${BUILD_DIR}/output/bin/pegasus_shell/pegasus_shell ./pegasus_shell ${CONFIG} $CLUSTER_NAME # because pegasus shell will catch 'Ctrl-C' signal, so the following commands will be executed # even user inputs 'Ctrl-C', so that the temporary config file will be cleared when exit shell. diff --git a/scripts/compile_thrift.py b/scripts/compile_thrift.py index 54dab7c87d..0d79a5db72 100755 --- a/scripts/compile_thrift.py +++ b/scripts/compile_thrift.py @@ -39,16 +39,16 @@ "path": "idl", "include_fix": { "_types.h": { - "add": [""], - "remove": ["\"dsn_types.h\""] + "add": ["\"runtime/rpc/serialization.h\""], + "remove": ["dsn_types.h"] }, "_types.cpp": { - "add": [""], - "remove": ["\"dsn.layer2_types.h\""] + "add": ["\"common/serialization_helper/dsn.layer2_types.h\""], + "remove": ["dsn.layer2_types.h"] } }, "file_move": { - "_types.h": "src/rdsn/include/dsn/cpp/serialization_helper", + "_types.h": "src/rdsn/src/common/serialization_helper", "_types.cpp": "src/rdsn/src/runtime" } }, diff --git a/scripts/pack_client.sh b/scripts/pack_client.sh index 519255df2f..4613f5d455 100755 --- a/scripts/pack_client.sh +++ b/scripts/pack_client.sh @@ -39,9 +39,9 @@ then exit 1 fi -if [ ! -f DSN_ROOT/bin/pegasus_server/pegasus_server ] +if [ ! -f ${BUILD_DIR}/output/bin/pegasus_server/pegasus_server ] then - echo "ERROR: DSN_ROOT/bin/pegasus_server/pegasus_server not found" + echo "ERROR: ${BUILD_DIR}/output/bin/pegasus_server/pegasus_server not found" exit 1 fi @@ -106,8 +106,9 @@ while [[ $# > 0 ]]; do done mkdir -p ${pack}/lib -copy_file ./DSN_ROOT/lib/libpegasus_client_static.a ${pack}/lib -copy_file ./DSN_ROOT/lib/libpegasus_client_shared.so ${pack}/lib +copy_file ${BUILD_DIR}/output/lib/libpegasus_client_static.a ${pack}/lib +# TODO(yingchun): make sure shared lib works well too +# copy_file ${BUILD_DIR}/output/lib/libpegasus_client_shared.so ${pack}/lib copy_file ./thirdparty/output/lib/libboost*.so.1.69.0 ${pack}/lib ln -sf `ls ${pack}/lib | grep libboost_system` ${pack}/lib/libboost_system.so ln -sf `ls ${pack}/lib | grep libboost_filesystem` ${pack}/lib/libboost_filesystem.so @@ -115,11 +116,6 @@ ln -sf `ls ${pack}/lib | grep libboost_regex` ${pack}/lib/libboost_regex.so cp -v -r ./src/include ${pack} -cd src/sample -make clean &>/dev/null -cd $shell_dir -cp -v -r ./src/sample ${pack} - echo "Pegasus Client $version ($commit_id) $platform $build_type" >${pack}/VERSION tar cfz ${pack}.tar.gz ${pack} diff --git a/scripts/pack_common.sh b/scripts/pack_common.sh index 55b3127462..5ee39025ad 100755 --- a/scripts/pack_common.sh +++ b/scripts/pack_common.sh @@ -20,7 +20,7 @@ set -e function get_stdcpp_lib() { - libname=`ldd ./DSN_ROOT/bin/pegasus_server/pegasus_server 2>/dev/null | grep libstdc++` + libname=`ldd ${BUILD_DIR}/output/bin/pegasus_server/pegasus_server 2>/dev/null | grep libstdc++` libname=`echo $libname | cut -f1 -d" "` if [ $1 = "true" ]; then gcc_path=`which gcc` @@ -40,7 +40,7 @@ function get_stdcpp_lib() # USAGE: get_system_lib server snappy function get_system_lib() { - libname=`ldd ./DSN_ROOT/bin/pegasus_$1/pegasus_$1 2>/dev/null | grep "lib${2}\.so"` + libname=`ldd ${BUILD_DIR}/output/bin/pegasus_$1/pegasus_$1 2>/dev/null | grep "lib${2}\.so"` libname=`echo $libname | cut -f1 -d" "` libs=(`ldconfig -p|grep $libname|awk '{print $NF}'`) @@ -53,7 +53,7 @@ function get_system_lib() done; # if get failed by ldconfig, then just extract lib from ldd result - libname=`ldd ./DSN_ROOT/bin/pegasus_$1/pegasus_$1 2>/dev/null | grep "lib${2}\.so"` + libname=`ldd ${BUILD_DIR}/output/bin/pegasus_$1/pegasus_$1 2>/dev/null | grep "lib${2}\.so"` libname=`echo $libname | cut -f3 -d" "` if echo "$libname" | grep -q "lib${2}\.so"; then echo "$libname" @@ -63,7 +63,7 @@ function get_system_lib() # USAGE: get_system_libname server snappy function get_system_libname() { - libname=`ldd ./DSN_ROOT/bin/pegasus_$1/pegasus_$1 2>/dev/null | grep "lib${2}\.so"` + libname=`ldd ${BUILD_DIR}/output/bin/pegasus_$1/pegasus_$1 2>/dev/null | grep "lib${2}\.so"` libname=`echo $libname | cut -f1 -d" "` echo "$libname" } @@ -104,7 +104,7 @@ function check_bit() function need_system_lib() { # return if system libname is not empty, if false, it means this library is not a dependency - libname=$(ldd ./DSN_ROOT/bin/pegasus_"$1"/pegasus_"$1" 2>/dev/null | grep "lib${2}\.so") + libname=$(ldd ${BUILD_DIR}/output/bin/pegasus_"$1"/pegasus_"$1" 2>/dev/null | grep "lib${2}\.so") [ -n "${libname}" ] } diff --git a/scripts/pack_server.sh b/scripts/pack_server.sh index 60d8aa4934..c7111bce41 100755 --- a/scripts/pack_server.sh +++ b/scripts/pack_server.sh @@ -39,8 +39,8 @@ if [ ! -f src/include/pegasus/git_commit.h ]; then exit 1 fi -if [ ! -f DSN_ROOT/bin/pegasus_server/pegasus_server ]; then - echo "ERROR: DSN_ROOT/bin/pegasus_server/pegasus_server not found" +if [ ! -f ${BUILD_DIR}/output/bin/pegasus_server/pegasus_server ]; then + echo "ERROR: ${BUILD_DIR}/output/bin/pegasus_server/pegasus_server not found" exit 1 fi @@ -110,10 +110,10 @@ while [[ $# > 0 ]]; do done mkdir -p ${pack}/bin -copy_file ./DSN_ROOT/bin/pegasus_server/pegasus_server ${pack}/bin -copy_file ./DSN_ROOT/lib/libdsn_meta_server.so ${pack}/bin -copy_file ./DSN_ROOT/lib/libdsn_replica_server.so ${pack}/bin -copy_file ./DSN_ROOT/lib/libdsn_utils.so ${pack}/bin +copy_file ${BUILD_DIR}/output/bin/pegasus_server/pegasus_server ${pack}/bin +copy_file ${BUILD_DIR}/output/lib/libdsn_meta_server.so ${pack}/bin +copy_file ${BUILD_DIR}/output/lib/libdsn_replica_server.so ${pack}/bin +copy_file ${BUILD_DIR}/output/lib/libdsn_utils.so ${pack}/bin copy_file ./thirdparty/output/lib/libPoco*.so.* ${pack}/bin if [ "$use_jemalloc" == "on" ]; then diff --git a/scripts/pack_tools.sh b/scripts/pack_tools.sh index 924c33ab46..b14225c1d9 100755 --- a/scripts/pack_tools.sh +++ b/scripts/pack_tools.sh @@ -40,9 +40,9 @@ then exit 1 fi -if [ ! -f DSN_ROOT/bin/pegasus_shell/pegasus_shell ] +if [ ! -f ${BUILD_DIR}/output/bin/pegasus_shell/pegasus_shell ] then - echo "ERROR: DSN_ROOT/bin/pegasus_shell/pegasus_shell not found" + echo "ERROR: ${BUILD_DIR}/output/bin/pegasus_shell/pegasus_shell not found" exit 1 fi @@ -113,31 +113,31 @@ done mkdir -p ${pack} copy_file ./run.sh ${pack}/ -mkdir -p ${pack}/DSN_ROOT/bin -cp -v -r ./DSN_ROOT/bin/pegasus_server ${pack}/DSN_ROOT/bin/ -cp -v -r ./DSN_ROOT/bin/pegasus_shell ${pack}/DSN_ROOT/bin/ -cp -v -r ./DSN_ROOT/bin/pegasus_bench ${pack}/DSN_ROOT/bin/ -cp -v -r ./DSN_ROOT/bin/pegasus_kill_test ${pack}/DSN_ROOT/bin/ -cp -v -r ./DSN_ROOT/bin/pegasus_rproxy ${pack}/DSN_ROOT/bin/ -cp -v -r ./DSN_ROOT/bin/pegasus_pressureclient ${pack}/DSN_ROOT/bin/ +mkdir -p ${pack}/bin +cp -v -r ${BUILD_DIR}/output/bin/pegasus_server ${pack}/bin/ +cp -v -r ${BUILD_DIR}/output/bin/pegasus_shell ${pack}/bin/ +cp -v -r ${BUILD_DIR}/output/bin/pegasus_bench ${pack}/bin/ +cp -v -r ${BUILD_DIR}/output/bin/pegasus_kill_test ${pack}/bin/ +cp -v -r ${BUILD_DIR}/output/bin/pegasus_rproxy ${pack}/bin/ +cp -v -r ${BUILD_DIR}/output/bin/pegasus_pressureclient ${pack}/bin/ -mkdir -p ${pack}/DSN_ROOT/lib -copy_file ./DSN_ROOT/lib/*.so* ${pack}/DSN_ROOT/lib/ -copy_file ./thirdparty/output/lib/libPoco*.so.* ${pack}/DSN_ROOT/lib/ +mkdir -p ${pack}/lib +copy_file ${BUILD_DIR}/output/lib/*.so* ${pack}/lib/ +copy_file ./thirdparty/output/lib/libPoco*.so.* ${pack}/lib/ if [ "$use_jemalloc" == "on" ]; then - copy_file ./thirdparty/output/lib/libjemalloc.so.2 ${pack}/DSN_ROOT/lib/ - copy_file ./thirdparty/output/lib/libprofiler.so.0 ${pack}/DSN_ROOT/lib/ + copy_file ./thirdparty/output/lib/libjemalloc.so.2 ${pack}/lib/ + copy_file ./thirdparty/output/lib/libprofiler.so.0 ${pack}/lib/ else - copy_file ./thirdparty/output/lib/libtcmalloc_and_profiler.so.4 ${pack}/DSN_ROOT/lib/ + copy_file ./thirdparty/output/lib/libtcmalloc_and_profiler.so.4 ${pack}/lib/ fi -copy_file ./thirdparty/output/lib/libboost*.so.1.69.0 ${pack}/DSN_ROOT/lib/ -copy_file ./thirdparty/output/lib/libhdfs* ${pack}/DSN_ROOT/lib -copy_file `get_stdcpp_lib $custom_gcc` ${pack}/DSN_ROOT/lib/ +copy_file ./thirdparty/output/lib/libboost*.so.1.69.0 ${pack}/lib/ +copy_file ./thirdparty/output/lib/libhdfs* ${pack}/lib +copy_file `get_stdcpp_lib $custom_gcc` ${pack}/lib/ pack_tools_lib() { - pack_system_lib "${pack}/DSN_ROOT/lib" shell "$1" + pack_system_lib "${pack}/lib" shell "$1" } pack_tools_lib snappy @@ -146,7 +146,7 @@ pack_tools_lib ssl pack_tools_lib zstd pack_tools_lib lz4 -chmod -x ${pack}/DSN_ROOT/lib/* +chmod -x ${pack}/lib/* mkdir -p ${pack}/scripts copy_file ./scripts/* ${pack}/scripts/ diff --git a/scripts/recompile_thrift.sh b/scripts/recompile_thrift.sh index ecfef7518f..1122daa6f9 100755 --- a/scripts/recompile_thrift.sh +++ b/scripts/recompile_thrift.sh @@ -30,7 +30,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 /' $TMP_DIR/rrdb_types.h > ../src/include/rrdb/rrdb_types.h +sed 's/#include "dsn_types.h"/#include "utils\/rpc_address.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 499ae93682..71d2f149fe 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,21 +19,12 @@ project(pegasus C CXX) set(PEGASUS_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) -if(NOT EXISTS "${DSN_ROOT}") - message(FATAL_ERROR "Please make sure that ${DSN_ROOT} is defined and does exists.") -endif() - dsn_common_setup() -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/rdsn/include) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/rdsn/include/dsn/cpp/serialization_helper) - -# Users don't have to configure CMAKE_INSTALL_PREFIX unless they want to customize -# the destination. -set(CMAKE_INSTALL_PREFIX ${DSN_ROOT} CACHE STRING "" FORCE) -message (STATUS "pegasus Installation directory: CMAKE_INSTALL_PREFIX = " ${CMAKE_INSTALL_PREFIX}) +include_directories(${PEGASUS_PROJECT_DIR}) +include_directories(${PEGASUS_PROJECT_DIR}/include) +include_directories(${PEGASUS_PROJECT_DIR}/rdsn/src) +include_directories(${PEGASUS_PROJECT_DIR}/rdsn/src/common/serialization_helper) add_subdirectory(rdsn/src) add_subdirectory(base) @@ -49,3 +40,4 @@ add_subdirectory(test/function_test) add_subdirectory(test/kill_test) add_subdirectory(test/pressure_test) add_subdirectory(test/bench_test) +add_subdirectory(sample) diff --git a/src/base/CMakeLists.txt b/src/base/CMakeLists.txt index 6488ebd933..7c117ef4f1 100644 --- a/src/base/CMakeLists.txt +++ b/src/base/CMakeLists.txt @@ -30,5 +30,5 @@ set(MY_PROJ_SRC "") dsn_add_static_library() -target_link_libraries(pegasus_base PUBLIC RocksDB::rocksdb sasl2 gssapi_krb5 krb5) +target_link_libraries(pegasus_base PUBLIC RocksDB::rocksdb sasl2 gssapi_krb5 krb5 dsn_replication_common) target_include_directories(pegasus_base PUBLIC "$") diff --git a/src/base/pegasus_key_schema.h b/src/base/pegasus_key_schema.h index 042da1cf4e..c6f1f6e32e 100644 --- a/src/base/pegasus_key_schema.h +++ b/src/base/pegasus_key_schema.h @@ -21,13 +21,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include "utils/ports.h" +#include "utils/utils.h" +#include "utils/blob.h" +#include "utils/endians.h" +#include "utils/utils.h" +#include "utils/crc.h" +#include "utils/api_utilities.h" namespace pegasus { diff --git a/src/base/pegasus_rpc_types.h b/src/base/pegasus_rpc_types.h index db0547eabd..8a680d5b6f 100644 --- a/src/base/pegasus_rpc_types.h +++ b/src/base/pegasus_rpc_types.h @@ -17,8 +17,14 @@ * under the License. */ -#include -#include +#include "runtime/rpc/rpc_holder.h" +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" #include #include diff --git a/src/base/pegasus_utils.cpp b/src/base/pegasus_utils.cpp index 1f0cb0bc1f..6dad198a61 100644 --- a/src/base/pegasus_utils.cpp +++ b/src/base/pegasus_utils.cpp @@ -25,8 +25,8 @@ #include #include -#include "dsn/c/api_utilities.h" -#include "dsn/dist/fmt_logging.h" +#include "utils/api_utilities.h" +#include "utils/fmt_logging.h" namespace pegasus { namespace utils { diff --git a/src/base/pegasus_utils.h b/src/base/pegasus_utils.h index 38f3207de8..c24d2d9b00 100644 --- a/src/base/pegasus_utils.h +++ b/src/base/pegasus_utils.h @@ -24,8 +24,8 @@ #include #include #include -#include -#include +#include "utils/rpc_address.h" +#include "utils/string_view.h" #include namespace pegasus { diff --git a/src/base/pegasus_value_schema.h b/src/base/pegasus_value_schema.h index 468ab1a7c0..7fa9997ecf 100644 --- a/src/base/pegasus_value_schema.h +++ b/src/base/pegasus_value_schema.h @@ -19,19 +19,24 @@ #pragma once -#include #include +#include #include #include -#include -#include -#include -#include -#include -#include #include +#include "common/api_common.h" +#include "utils/api_utilities.h" +#include "utils/blob.h" +#include "utils/endians.h" +#include "utils/fmt_logging.h" +#include "utils/ports.h" +#include "utils/smart_pointers.h" +#include "utils/utils.h" +#include "runtime/api_layer1.h" +#include "runtime/api_task.h" +#include "runtime/app_model.h" #include "value_field.h" namespace pegasus { diff --git a/src/base/test/main.cpp b/src/base/test/main.cpp index dca522f878..f16f059777 100644 --- a/src/base/test/main.cpp +++ b/src/base/test/main.cpp @@ -17,9 +17,14 @@ * under the License. */ -#include #include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" + GTEST_API_ int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); diff --git a/src/base/test/value_manager_test.cpp b/src/base/test/value_manager_test.cpp index 2474ffd12d..03caf1b749 100644 --- a/src/base/test/value_manager_test.cpp +++ b/src/base/test/value_manager_test.cpp @@ -17,7 +17,8 @@ * under the License. */ -#include "value_schema_manager.h" +#include "base/value_schema_manager.h" + #include using namespace pegasus; diff --git a/src/base/value_schema_manager.h b/src/base/value_schema_manager.h index 86ced84df9..f45c00f406 100644 --- a/src/base/value_schema_manager.h +++ b/src/base/value_schema_manager.h @@ -20,7 +20,7 @@ #pragma once #include "pegasus_value_schema.h" -#include +#include "utils/singleton.h" namespace pegasus { diff --git a/src/base/value_schema_v0.cpp b/src/base/value_schema_v0.cpp index 850c07c948..faba838956 100644 --- a/src/base/value_schema_v0.cpp +++ b/src/base/value_schema_v0.cpp @@ -19,8 +19,8 @@ #include "value_schema_v0.h" -#include -#include +#include "utils/fmt_logging.h" +#include "utils/smart_pointers.h" namespace pegasus { std::unique_ptr value_schema_v0::extract_field(dsn::string_view value, diff --git a/src/base/value_schema_v1.cpp b/src/base/value_schema_v1.cpp index 6dba1d46e8..aaf59f41fc 100644 --- a/src/base/value_schema_v1.cpp +++ b/src/base/value_schema_v1.cpp @@ -19,10 +19,10 @@ #include "value_schema_v1.h" -#include -#include -#include -#include +#include "utils/endians.h" +#include "utils/fmt_logging.h" +#include "utils/api_utilities.h" +#include "utils/smart_pointers.h" namespace pegasus { std::unique_ptr value_schema_v1::extract_field(dsn::string_view value, diff --git a/src/base/value_schema_v2.cpp b/src/base/value_schema_v2.cpp index 7b5ea9b9ec..eafd5c55c1 100644 --- a/src/base/value_schema_v2.cpp +++ b/src/base/value_schema_v2.cpp @@ -19,10 +19,10 @@ #include "value_schema_v2.h" -#include -#include -#include -#include +#include "utils/endians.h" +#include "utils/fmt_logging.h" +#include "utils/api_utilities.h" +#include "utils/smart_pointers.h" namespace pegasus { diff --git a/src/client_lib/CMakeLists.txt b/src/client_lib/CMakeLists.txt index 76f93b5e54..0bc95bfb51 100644 --- a/src/client_lib/CMakeLists.txt +++ b/src/client_lib/CMakeLists.txt @@ -15,54 +15,15 @@ # specific language governing permissions and limitations # under the License. -file("GLOB" - source_files - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +# TODO(yingchun): should export shared lib too!!! +set(MY_PROJ_NAME "pegasus_client_static") add_definitions(-fPIC) -add_library(pegasus_client_impl_objects OBJECT ${source_files}) -define_file_basename_for_sources(pegasus_client_impl_objects) -target_include_directories(pegasus_client_impl_objects PUBLIC $) +set(MY_SRC_SEARCH_MODE "GLOB") -# both shared & static version of pegasus client depends on boost_system,boost_filesystem,aio,dl -# -# link the static lib of pegasus_client: combine pegasus_client_impl, pegasus_base, etc into a single static lib -set(pegasus_client_static_lib ${CMAKE_CURRENT_BINARY_DIR}/libpegasus_client_static.a) -if (APPLE) - add_custom_target(pre_combine_lib - COMMAND ar -x ${BUILD_DIR}/src/rdsn/src/util/libdsn_utils.a) -endif() -add_custom_target(combine_lib - COMMAND ar -x ${BUILD_DIR}/src/rdsn/src/runtime/libdsn_runtime.a - COMMAND ar -x ${BUILD_DIR}/src/rdsn/src/client/libdsn_client.a - COMMAND ar -x ${BUILD_DIR}/src/rdsn/src/common/libdsn_replication_common.a - COMMAND ar -x ${THIRDPARTY_INSTALL_DIR}/lib/libthrift.a - COMMAND ar -x ${CMAKE_BINARY_DIR}/src/base/libpegasus_base.a - COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/$.dir/*.o . - COMMAND ar -qcs ${pegasus_client_static_lib} *.o - COMMAND rm -rf *.o - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS pegasus_base pegasus_client_impl_objects dsn_runtime dsn_client dsn_replication_common - COMMENT "generate pegasus client static library" -) -add_library(pegasus_client_static STATIC IMPORTED GLOBAL) -add_dependencies(pegasus_client_static combine_lib) -set_target_properties(pegasus_client_static - PROPERTIES - IMPORTED_LOCATION ${pegasus_client_static_lib}) -install(FILES ${pegasus_client_static_lib} DESTINATION "lib") +set(MY_PROJ_SRC "") -if (NOT APPLE) - # link the shared lib of pegasus client - add_library(pegasus_client_shared SHARED $) - target_link_libraries(pegasus_client_shared PRIVATE - pegasus_base - dsn_runtime - dsn_utils - dsn_client - dsn_replication_common - thrift) - install(TARGETS pegasus_client_shared DESTINATION "lib") -endif() +dsn_add_static_library() +target_link_libraries(pegasus_client_static PUBLIC pegasus_base dsn_runtime dsn_client dsn_replication_common) diff --git a/src/client_lib/pegasus_client_impl.cpp b/src/client_lib/pegasus_client_impl.cpp index 9e58942abe..3a4881ad67 100644 --- a/src/client_lib/pegasus_client_impl.cpp +++ b/src/client_lib/pegasus_client_impl.cpp @@ -22,10 +22,13 @@ #include #include -#include -#include -#include -#include +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/group_address.h" +#include "common/replication_other_types.h" +#include "common/serialization_helper/dsn.layer2_types.h" #include #include #include "pegasus_client_impl.h" diff --git a/src/client_lib/pegasus_client_impl.h b/src/client_lib/pegasus_client_impl.h index 42cc3462d0..808b033fe8 100644 --- a/src/client_lib/pegasus_client_impl.h +++ b/src/client_lib/pegasus_client_impl.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include "utils/zlocks.h" #include "base/pegasus_key_schema.h" #include "base/pegasus_utils.h" diff --git a/src/geo/bench/bench.cpp b/src/geo/bench/bench.cpp index ce85b7f1c4..17717e32c6 100644 --- a/src/geo/bench/bench.cpp +++ b/src/geo/bench/bench.cpp @@ -26,10 +26,10 @@ #include #include -#include "dsn/dist/fmt_logging.h" -#include "dsn/utility/errors.h" -#include "dsn/utility/strings.h" -#include "dsn/utility/string_conv.h" +#include "utils/fmt_logging.h" +#include "utils/errors.h" +#include "utils/strings.h" +#include "utils/string_conv.h" static const int data_count = 10000; diff --git a/src/geo/lib/geo_client.cpp b/src/geo/lib/geo_client.cpp index d4ab34d07f..cee2670438 100644 --- a/src/geo/lib/geo_client.cpp +++ b/src/geo/lib/geo_client.cpp @@ -22,9 +22,22 @@ #include #include #include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "utils/fmt_logging.h" +#include "utils/errors.h" #include "base/pegasus_key_schema.h" #include "base/pegasus_utils.h" diff --git a/src/geo/lib/geo_client.h b/src/geo/lib/geo_client.h index 161db5419a..c55bc11bf6 100644 --- a/src/geo/lib/geo_client.h +++ b/src/geo/lib/geo_client.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include "runtime/task/task_tracker.h" #include #include "latlng_codec.h" diff --git a/src/geo/lib/latlng_codec.cpp b/src/geo/lib/latlng_codec.cpp index 030ed6c362..bc52240e14 100644 --- a/src/geo/lib/latlng_codec.cpp +++ b/src/geo/lib/latlng_codec.cpp @@ -19,11 +19,24 @@ #include "latlng_codec.h" -#include -#include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "utils/fmt_logging.h" +#include "utils/error_code.h" +#include "utils/errors.h" +#include "utils/string_conv.h" namespace pegasus { namespace geo { diff --git a/src/geo/lib/latlng_codec.h b/src/geo/lib/latlng_codec.h index 7787a231a2..57b5639872 100644 --- a/src/geo/lib/latlng_codec.h +++ b/src/geo/lib/latlng_codec.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include "utils/strings.h" namespace dsn { class error_s; diff --git a/src/geo/test/geo_test.cpp b/src/geo/test/geo_test.cpp index d4594772f6..f0c9656504 100644 --- a/src/geo/test/geo_test.cpp +++ b/src/geo/test/geo_test.cpp @@ -23,12 +23,12 @@ #include #include #include -#include -#include +#include "utils/strings.h" +#include "utils/string_conv.h" #include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "common/replication_other_types.h" +#include "client/replication_ddl_client.h" #include "base/pegasus_const.h" namespace pegasus { diff --git a/src/geo/test/latlng_codec_test.cpp b/src/geo/test/latlng_codec_test.cpp index f9c4007b6b..630ac880a3 100644 --- a/src/geo/test/latlng_codec_test.cpp +++ b/src/geo/test/latlng_codec_test.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include "utils/errors.h" namespace pegasus { namespace geo { diff --git a/src/geo/test/main.cpp b/src/geo/test/main.cpp index 8729cde46b..e37b5ccdc7 100644 --- a/src/geo/test/main.cpp +++ b/src/geo/test/main.cpp @@ -17,7 +17,11 @@ * under the License. */ -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" #include GTEST_API_ int main(int argc, char **argv) diff --git a/src/include/rrdb/rrdb.client.h b/src/include/rrdb/rrdb.client.h index a9e9eed38b..8a7faa2fad 100644 --- a/src/include/rrdb/rrdb.client.h +++ b/src/include/rrdb/rrdb.client.h @@ -21,9 +21,10 @@ #include "rrdb.code.definition.h" #include "rrdb_types.h" #include -#include -#include -#include +#include "utils/optional.h" +#include "runtime/rpc/rpc_holder.h" +#include "runtime/task/task_tracker.h" +#include "client/partition_resolver.h" namespace dsn { namespace apps { diff --git a/src/include/rrdb/rrdb.code.definition.h b/src/include/rrdb/rrdb.code.definition.h index 9cc821d3f7..9607883d1f 100644 --- a/src/include/rrdb/rrdb.code.definition.h +++ b/src/include/rrdb/rrdb.code.definition.h @@ -18,7 +18,8 @@ */ #pragma once -#include + +#include "common/replication.codes.h" namespace dsn { namespace apps { diff --git a/src/rdsn/include/dsn/c/api_common.h b/src/rdsn/include/dsn/c/api_common.h deleted file mode 100644 index ad3b6ea702..0000000000 --- a/src/rdsn/include/dsn/c/api_common.h +++ /dev/null @@ -1,61 +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. - */ - -/* - * Description: - * basic data structures and macros for rDSN service API - * - * Revision history: - * Feb., 2016, @imzhenyu (Zhenyu Guo), first version - * xxxx-xx-xx, author, fix bug about xxx - */ - -#pragma once - -#include -#include -#include -#include - -#ifdef __cplusplus -#define DEFAULT(value) = value -#define NORETURN [[noreturn]] -#else -#define DEFAULT(value) -#define NORETURN -#include -#endif - -#define DSN_MAX_TASK_CODE_NAME_LENGTH 48 -#define DSN_MAX_ERROR_CODE_NAME_LENGTH 48 -#define DSN_MAX_ADDRESS_NAME_LENGTH 48 -#define DSN_MAX_BUFFER_COUNT_IN_MESSAGE 64 -#define DSN_MAX_APP_TYPE_NAME_LENGTH 32 -#define DSN_MAX_CALLBAC_COUNT 32 -#define DSN_MAX_APP_COUNT_IN_SAME_PROCESS 256 -#define DSN_MAX_PATH 1024 - -typedef void *dsn_handle_t; diff --git a/src/rdsn/include/dsn/dist/failure_detector.h b/src/rdsn/include/dsn/dist/failure_detector.h deleted file mode 100644 index 749c707b2b..0000000000 --- a/src/rdsn/include/dsn/dist/failure_detector.h +++ /dev/null @@ -1,38 +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. - */ - -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * xxxx-xx-xx, author, fix bug about xxx - */ - -#pragma once - -#include diff --git a/src/rdsn/include/dsn/dist/replication.h b/src/rdsn/include/dsn/dist/replication.h deleted file mode 100644 index 069a6bb532..0000000000 --- a/src/rdsn/include/dsn/dist/replication.h +++ /dev/null @@ -1,40 +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. - */ - -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * xxxx-xx-xx, author, fix bug about xxx - */ - -#pragma once - -#include -#include -#include diff --git a/src/rdsn/include/dsn/dist/replication/replication_types.h b/src/rdsn/include/dsn/dist/replication/replication_types.h deleted file mode 100644 index 9f2914dbb6..0000000000 --- a/src/rdsn/include/dsn/dist/replication/replication_types.h +++ /dev/null @@ -1,28 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#pragma once - -// WARN: This is a legacy file. Please do not include it when you make any modification. - -#include "meta_admin_types.h" -#include "partition_split_types.h" -#include "duplication_types.h" -#include "bulk_load_types.h" -#include "backup_types.h" -#include "consensus_types.h" -#include "replica_admin_types.h" diff --git a/src/rdsn/include/dsn/service_api_cpp.h b/src/rdsn/include/dsn/service_api_cpp.h deleted file mode 100644 index 3b91b1e11f..0000000000 --- a/src/rdsn/include/dsn/service_api_cpp.h +++ /dev/null @@ -1,44 +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. - */ - -/* - * Description: - * cpp development library atop zion's c service api - * - * Revision history: - * Mar., 2015, @imzhenyu (Zhenyu Guo), first version - * xxxx-xx-xx, author, fix bug about xxx - */ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include diff --git a/src/rdsn/include/dsn/tool-api/auto_codes.h b/src/rdsn/include/dsn/tool-api/auto_codes.h deleted file mode 100644 index 664a2547b0..0000000000 --- a/src/rdsn/include/dsn/tool-api/auto_codes.h +++ /dev/null @@ -1,41 +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. - */ - -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * xxxx-xx-xx, author, fix bug about xxx - */ - -#pragma once - -#include -#include -#include -#include diff --git a/src/rdsn/src/CMakeLists.txt b/src/rdsn/src/CMakeLists.txt index 7ef4c29d1b..35f9d30261 100644 --- a/src/rdsn/src/CMakeLists.txt +++ b/src/rdsn/src/CMakeLists.txt @@ -23,10 +23,6 @@ set(DSN_BUILD_RUNTIME TRUE) dsn_common_setup() -include_directories(${RDSN_PROJECT_ROOT}/include) -include_directories(${RDSN_PROJECT_ROOT}/include/dsn/cpp/serialization_helper) -include_directories(${RDSN_PROJECT_ROOT}/src) - if(UNIX) add_compile_options(-fPIC) endif() diff --git a/src/rdsn/src/aio/aio_provider.h b/src/rdsn/src/aio/aio_provider.h index d39f3a8596..12fd566568 100644 --- a/src/rdsn/src/aio/aio_provider.h +++ b/src/rdsn/src/aio/aio_provider.h @@ -26,9 +26,9 @@ #pragma once -#include -#include -#include +#include "aio/aio_task.h" +#include "utils/dlib.h" +#include "utils/factory_store.h" namespace dsn { diff --git a/src/rdsn/src/aio/aio_task.cpp b/src/rdsn/src/aio/aio_task.cpp index d4374ac1d8..2488999af9 100644 --- a/src/rdsn/src/aio/aio_task.cpp +++ b/src/rdsn/src/aio/aio_task.cpp @@ -16,9 +16,9 @@ // under the License. #include "runtime/task/task_engine.h" -#include -#include -#include +#include "aio/file_io.h" +#include "utils/error_code.h" +#include "utils/latency_tracer.h" namespace dsn { diff --git a/src/rdsn/include/dsn/tool-api/aio_task.h b/src/rdsn/src/aio/aio_task.h similarity index 99% rename from src/rdsn/include/dsn/tool-api/aio_task.h rename to src/rdsn/src/aio/aio_task.h index 354e0d9caf..1d278fd61a 100644 --- a/src/rdsn/include/dsn/tool-api/aio_task.h +++ b/src/rdsn/src/aio/aio_task.h @@ -26,7 +26,8 @@ #pragma once -#include +#include "runtime/task/task.h" + #include namespace dsn { diff --git a/src/rdsn/src/aio/disk_engine.cpp b/src/rdsn/src/aio/disk_engine.cpp index a83be95e28..48a7d4ca3e 100644 --- a/src/rdsn/src/aio/disk_engine.cpp +++ b/src/rdsn/src/aio/disk_engine.cpp @@ -24,9 +24,9 @@ * THE SOFTWARE. */ -#include -#include -#include +#include "utils/fmt_logging.h" +#include "aio/aio_task.h" +#include "utils/flags.h" #include "disk_engine.h" #include "runtime/service_engine.h" diff --git a/src/rdsn/src/aio/disk_engine.h b/src/rdsn/src/aio/disk_engine.h index e35c243209..4d821b6ea4 100644 --- a/src/rdsn/src/aio/disk_engine.h +++ b/src/rdsn/src/aio/disk_engine.h @@ -28,9 +28,9 @@ #include "aio_provider.h" -#include -#include -#include +#include "runtime/tool_api.h" +#include "utils/synchronize.h" +#include "utils/work_queue.h" namespace dsn { diff --git a/src/rdsn/src/aio/file_io.cpp b/src/rdsn/src/aio/file_io.cpp index ecd88efc58..e6e7c763fc 100644 --- a/src/rdsn/src/aio/file_io.cpp +++ b/src/rdsn/src/aio/file_io.cpp @@ -25,7 +25,7 @@ */ #include "disk_engine.h" -#include +#include "aio/file_io.h" namespace dsn { namespace file { diff --git a/src/rdsn/include/dsn/tool-api/file_io.h b/src/rdsn/src/aio/file_io.h similarity index 98% rename from src/rdsn/include/dsn/tool-api/file_io.h rename to src/rdsn/src/aio/file_io.h index 3a618ed95e..f7b98f4fea 100644 --- a/src/rdsn/include/dsn/tool-api/file_io.h +++ b/src/rdsn/src/aio/file_io.h @@ -28,7 +28,7 @@ #include -#include +#include "aio/aio_task.h" namespace dsn { diff --git a/src/rdsn/src/aio/native_linux_aio_provider.cpp b/src/rdsn/src/aio/native_linux_aio_provider.cpp index ee5c432a91..b51dbef88e 100644 --- a/src/rdsn/src/aio/native_linux_aio_provider.cpp +++ b/src/rdsn/src/aio/native_linux_aio_provider.cpp @@ -30,11 +30,11 @@ #include "runtime/service_engine.h" -#include -#include -#include -#include -#include +#include "runtime/task/async_calls.h" +#include "utils/api_utilities.h" +#include "utils/fmt_logging.h" +#include "utils/fail_point.h" +#include "utils/latency_tracer.h" namespace dsn { diff --git a/src/rdsn/src/aio/test/aio.cpp b/src/rdsn/src/aio/test/aio.cpp index c34b0f1245..b57c0a2039 100644 --- a/src/rdsn/src/aio/test/aio.cpp +++ b/src/rdsn/src/aio/test/aio.cpp @@ -24,10 +24,10 @@ * THE SOFTWARE. */ -#include -#include -#include -#include +#include "runtime/task/async_calls.h" +#include "utils/filesystem.h" +#include "utils/smart_pointers.h" +#include "utils/fail_point.h" #include diff --git a/src/rdsn/src/aio/test/main.cpp b/src/rdsn/src/aio/test/main.cpp index c2dbbd0a2e..a205138937 100644 --- a/src/rdsn/src/aio/test/main.cpp +++ b/src/rdsn/src/aio/test/main.cpp @@ -16,7 +16,20 @@ // under the License. #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" GTEST_API_ int main(int argc, char **argv) { diff --git a/src/rdsn/include/dsn/dist/block_service.h b/src/rdsn/src/block_service/block_service.h similarity index 95% rename from src/rdsn/include/dsn/dist/block_service.h rename to src/rdsn/src/block_service/block_service.h index 9ab2088906..cda20f575d 100644 --- a/src/rdsn/include/dsn/dist/block_service.h +++ b/src/rdsn/src/block_service/block_service.h @@ -19,9 +19,24 @@ #pragma once -#include -#include -#include +#include "runtime/task/task_code.h" +#include "runtime/task/task_tracker.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "common/replication_other_types.h" +#include "common/replication.codes.h" #include namespace dsn { diff --git a/src/rdsn/src/block_service/block_service_manager.cpp b/src/rdsn/src/block_service/block_service_manager.cpp index fb63e6b976..e9165cd40d 100644 --- a/src/rdsn/src/block_service/block_service_manager.cpp +++ b/src/rdsn/src/block_service/block_service_manager.cpp @@ -20,9 +20,9 @@ #include "block_service/hdfs/hdfs_service.h" #include "block_service/local/local_service.h" -#include -#include -#include +#include "utils/fmt_logging.h" +#include "utils/factory_store.h" +#include "utils/filesystem.h" namespace dsn { namespace dist { diff --git a/src/rdsn/src/block_service/block_service_manager.h b/src/rdsn/src/block_service/block_service_manager.h index 65b0b7294b..69877685fa 100644 --- a/src/rdsn/src/block_service/block_service_manager.h +++ b/src/rdsn/src/block_service/block_service_manager.h @@ -17,9 +17,9 @@ #pragma once -#include -#include -#include +#include "block_service/block_service.h" +#include "utils/singleton_store.h" +#include "utils/zlocks.h" namespace dsn { namespace dist { diff --git a/src/rdsn/src/block_service/directio_writable_file.cpp b/src/rdsn/src/block_service/directio_writable_file.cpp index 15544cc823..c2e9a165b0 100644 --- a/src/rdsn/src/block_service/directio_writable_file.cpp +++ b/src/rdsn/src/block_service/directio_writable_file.cpp @@ -24,8 +24,8 @@ #include #include // getpagesize -#include -#include +#include "utils/fmt_logging.h" +#include "utils/flags.h" #include "block_service/directio_writable_file.h" diff --git a/src/rdsn/src/block_service/fds/fds_service.cpp b/src/rdsn/src/block_service/fds/fds_service.cpp index cec07e4023..25c8a617c2 100644 --- a/src/rdsn/src/block_service/fds/fds_service.cpp +++ b/src/rdsn/src/block_service/fds/fds_service.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include "utils/error_code.h" #include #include @@ -34,12 +34,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include "utils/defer.h" +#include "utils/filesystem.h" +#include "utils/safe_strerror_posix.h" +#include "utils/TokenBucket.h" +#include "utils/fmt_logging.h" +#include "utils/flags.h" namespace dsn { namespace dist { diff --git a/src/rdsn/src/block_service/fds/fds_service.h b/src/rdsn/src/block_service/fds/fds_service.h index 70ba888051..56faa87f17 100644 --- a/src/rdsn/src/block_service/fds/fds_service.h +++ b/src/rdsn/src/block_service/fds/fds_service.h @@ -18,7 +18,7 @@ #ifndef FDS_SERVICE_H #define FDS_SERVICE_H -#include +#include "block_service/block_service.h" namespace folly { template diff --git a/src/rdsn/src/block_service/hdfs/hdfs_service.cpp b/src/rdsn/src/block_service/hdfs/hdfs_service.cpp index 6b51640f0a..62c9d68cc5 100644 --- a/src/rdsn/src/block_service/hdfs/hdfs_service.cpp +++ b/src/rdsn/src/block_service/hdfs/hdfs_service.cpp @@ -18,16 +18,16 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "runtime/task/async_calls.h" +#include "runtime/task/task.h" +#include "runtime/task/task_tracker.h" +#include "utils/error_code.h" +#include "utils/filesystem.h" +#include "utils/flags.h" +#include "utils/safe_strerror_posix.h" +#include "utils/TokenBucket.h" +#include "utils/utils.h" #include "hdfs_service.h" #include "block_service/directio_writable_file.h" diff --git a/src/rdsn/src/block_service/hdfs/hdfs_service.h b/src/rdsn/src/block_service/hdfs/hdfs_service.h index 8d5488ea4f..8a2f45c86b 100644 --- a/src/rdsn/src/block_service/hdfs/hdfs_service.h +++ b/src/rdsn/src/block_service/hdfs/hdfs_service.h @@ -17,7 +17,7 @@ #pragma once -#include +#include "block_service/block_service.h" #include namespace folly { diff --git a/src/rdsn/src/block_service/local/local_service.cpp b/src/rdsn/src/block_service/local/local_service.cpp index e91170e123..46dcff9e30 100644 --- a/src/rdsn/src/block_service/local/local_service.cpp +++ b/src/rdsn/src/block_service/local/local_service.cpp @@ -15,16 +15,16 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "common/json_helper.h" +#include "utils/fmt_logging.h" +#include "runtime/task/task_tracker.h" +#include "utils/defer.h" +#include "utils/error_code.h" +#include "utils/fail_point.h" +#include "utils/filesystem.h" +#include "utils/safe_strerror_posix.h" +#include "utils/strings.h" +#include "utils/utils.h" #include #include diff --git a/src/rdsn/src/block_service/local/local_service.h b/src/rdsn/src/block_service/local/local_service.h index 6d4cf14410..19b5fcf346 100644 --- a/src/rdsn/src/block_service/local/local_service.h +++ b/src/rdsn/src/block_service/local/local_service.h @@ -19,7 +19,7 @@ #include -#include +#include "block_service/block_service.h" namespace dsn { namespace dist { diff --git a/src/rdsn/src/block_service/test/block_service_manager_test.cpp b/src/rdsn/src/block_service/test/block_service_manager_test.cpp index e2269de6b7..f4c2d9c1b3 100644 --- a/src/rdsn/src/block_service/test/block_service_manager_test.cpp +++ b/src/rdsn/src/block_service/test/block_service_manager_test.cpp @@ -21,7 +21,7 @@ #include -#include +#include "utils/filesystem.h" #include namespace dsn { diff --git a/src/rdsn/src/block_service/test/block_service_mock.h b/src/rdsn/src/block_service/test/block_service_mock.h index 5c899a39db..c5b86d0cb1 100644 --- a/src/rdsn/src/block_service/test/block_service_mock.h +++ b/src/rdsn/src/block_service/test/block_service_mock.h @@ -19,8 +19,8 @@ #include "block_service/block_service_manager.h" -#include -#include +#include "block_service/block_service.h" +#include "utils/filesystem.h" namespace dsn { namespace dist { diff --git a/src/rdsn/src/block_service/test/fds_service_test.cpp b/src/rdsn/src/block_service/test/fds_service_test.cpp index 5ef41bcd26..03e5e64ab5 100644 --- a/src/rdsn/src/block_service/test/fds_service_test.cpp +++ b/src/rdsn/src/block_service/test/fds_service_test.cpp @@ -24,11 +24,11 @@ #include #include -#include "dsn/dist/block_service.h" -#include "dsn/dist/fmt_logging.h" -#include "dsn/utility/filesystem.h" -#include "dsn/utility/rand.h" -#include "dsn/utility/utils.h" +#include "block_service/block_service.h" +#include "utils/fmt_logging.h" +#include "utils/filesystem.h" +#include "utils/rand.h" +#include "utils/utils.h" using namespace dsn; using namespace dsn::dist::block_service; diff --git a/src/rdsn/src/block_service/test/hdfs_service_test.cpp b/src/rdsn/src/block_service/test/hdfs_service_test.cpp index e54ad9a476..f1bd5d559a 100644 --- a/src/rdsn/src/block_service/test/hdfs_service_test.cpp +++ b/src/rdsn/src/block_service/test/hdfs_service_test.cpp @@ -15,10 +15,10 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include -#include +#include "block_service/block_service.h" +#include "utils/filesystem.h" +#include "utils/flags.h" +#include "utils/rand.h" #include #include #include diff --git a/src/rdsn/src/block_service/test/main.cpp b/src/rdsn/src/block_service/test/main.cpp index ab7851b9a6..ca99692d0c 100644 --- a/src/rdsn/src/block_service/test/main.cpp +++ b/src/rdsn/src/block_service/test/main.cpp @@ -17,7 +17,20 @@ #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" int g_test_count = 0; int g_test_ret = 0; diff --git a/src/rdsn/src/client/partition_resolver.cpp b/src/rdsn/src/client/partition_resolver.cpp index 2c47573260..26b725ec23 100644 --- a/src/rdsn/src/client/partition_resolver.cpp +++ b/src/rdsn/src/client/partition_resolver.cpp @@ -24,9 +24,9 @@ * THE SOFTWARE. */ -#include -#include -#include +#include "utils/zlocks.h" +#include "runtime/rpc/group_address.h" +#include "client/partition_resolver.h" #include "partition_resolver_simple.h" #include "partition_resolver_manager.h" diff --git a/src/rdsn/include/dsn/dist/replication/partition_resolver.h b/src/rdsn/src/client/partition_resolver.h similarity index 95% rename from src/rdsn/include/dsn/dist/replication/partition_resolver.h rename to src/rdsn/src/client/partition_resolver.h index ff8b8a22aa..ecbecd5a98 100644 --- a/src/rdsn/include/dsn/dist/replication/partition_resolver.h +++ b/src/rdsn/src/client/partition_resolver.h @@ -26,12 +26,12 @@ #pragma once -#include -#include -#include -#include -#include -#include +#include "utils/autoref_ptr.h" +#include "utils/error_code.h" +#include "common/gpid.h" +#include "utils/rpc_address.h" +#include "runtime/rpc/rpc_message.h" +#include "runtime/task/async_calls.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/client/partition_resolver_manager.cpp b/src/rdsn/src/client/partition_resolver_manager.cpp index d6a7fd2516..3f27a69164 100644 --- a/src/rdsn/src/client/partition_resolver_manager.cpp +++ b/src/rdsn/src/client/partition_resolver_manager.cpp @@ -25,8 +25,8 @@ */ #include -#include -#include +#include "runtime/rpc/group_address.h" +#include "client/partition_resolver.h" #include "partition_resolver_manager.h" #include "partition_resolver_simple.h" diff --git a/src/rdsn/src/client/partition_resolver_manager.h b/src/rdsn/src/client/partition_resolver_manager.h index 0addbd1482..dea5068946 100644 --- a/src/rdsn/src/client/partition_resolver_manager.h +++ b/src/rdsn/src/client/partition_resolver_manager.h @@ -28,10 +28,10 @@ #include #include -#include -#include -#include -#include +#include "utils/singleton.h" +#include "utils/zlocks.h" +#include "utils/rpc_address.h" +#include "client/partition_resolver.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/client/partition_resolver_simple.cpp b/src/rdsn/src/client/partition_resolver_simple.cpp index c0011c94b3..8d6a5460c3 100644 --- a/src/rdsn/src/client/partition_resolver_simple.cpp +++ b/src/rdsn/src/client/partition_resolver_simple.cpp @@ -24,10 +24,10 @@ * THE SOFTWARE. */ -#include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "utils/utils.h" +#include "utils/rand.h" +#include "runtime/task/async_calls.h" #include "partition_resolver_simple.h" namespace dsn { diff --git a/src/rdsn/src/client/partition_resolver_simple.h b/src/rdsn/src/client/partition_resolver_simple.h index 0b5aaf0d0c..72e718dbdc 100644 --- a/src/rdsn/src/client/partition_resolver_simple.h +++ b/src/rdsn/src/client/partition_resolver_simple.h @@ -26,11 +26,15 @@ #pragma once -#include -#include -#include -#include -#include +#include "runtime/task/task_tracker.h" +#include "utils/zlocks.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "common/serialization_helper/dsn.layer2_types.h" +#include "client/partition_resolver.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/client/replication_ddl_client.cpp b/src/rdsn/src/client/replication_ddl_client.cpp index 85a71e610e..c94fd00cf1 100644 --- a/src/rdsn/src/client/replication_ddl_client.cpp +++ b/src/rdsn/src/client/replication_ddl_client.cpp @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include +#include "replication_ddl_client.h" #include #include @@ -35,14 +35,14 @@ #include #include -#include -#include -#include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "common//duplication_common.h" +#include "common/replication_other_types.h" +#include "runtime/rpc/group_address.h" +#include "utils/error_code.h" +#include "utils/output_utils.h" #include -#include +#include "utils/time_utils.h" #include "common/replication_common.h" #include "common/bulk_load_common.h" diff --git a/src/rdsn/include/dsn/dist/replication/replication_ddl_client.h b/src/rdsn/src/client/replication_ddl_client.h similarity index 95% rename from src/rdsn/include/dsn/dist/replication/replication_ddl_client.h rename to src/rdsn/src/client/replication_ddl_client.h index 805f4a9375..ab107dc8d4 100644 --- a/src/rdsn/include/dsn/dist/replication/replication_ddl_client.h +++ b/src/rdsn/src/client/replication_ddl_client.h @@ -24,26 +24,33 @@ * THE SOFTWARE. */ -/* - * Description: - * replication ddl client - * - * Revision history: - * 2015-12-30, xiaotz, first version - */ - #pragma once -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "common/replication_other_types.h" +#include "common/replication.codes.h" #include #include #include #include -#include -#include -#include +#include "runtime/task/task_tracker.h" +#include "runtime/task/async_calls.h" +#include "utils/errors.h" namespace dsn { namespace replication { diff --git a/src/rdsn/include/dsn/service_api_c.h b/src/rdsn/src/common/api_common.h similarity index 76% rename from src/rdsn/include/dsn/service_api_c.h rename to src/rdsn/src/common/api_common.h index 6dd216d8fe..441309d82b 100644 --- a/src/rdsn/include/dsn/service_api_c.h +++ b/src/rdsn/src/common/api_common.h @@ -60,35 +60,33 @@ * (7) PRINCIPLE: all non-determinims must be go through these system calls so that powerful * internal tools are possible - replay, model checking, replication, ..., * AND, it is still OK to call other DETERMINISTIC APIs for applications. - * - * ------------------------------------------------------------------------------ - * - * Revision history: - * Mar., 2015, @imzhenyu (Zhenyu Guo), first version in cpp - * July, 2015, @imzhenyu (Zhenyu Guo), refactor and refined in c - * Feb., 2016, @imzhenyu (Zhenyu Guo), decompose into several files for V1 release - * xxxx-xx-xx, author, fix bug about xxx */ -#pragma once - // common data structures and macros -#include -// rDSN uses event-driven programming model, and -// this file defines the task(i.e., event) abstraction and related -#include +#pragma once + +#include +#include +#include +#include "utils/dlib.h" -// service API for app/framework development, -// including threading/tasking, thread synchronization, -// RPC, asynchronous file IO, environment, etc. -#include +#ifdef __cplusplus +#define DEFAULT(value) = value +#define NORETURN [[noreturn]] +#else +#define DEFAULT(value) +#define NORETURN +#include +#endif -// application/framework model in rDSN -#include +#define DSN_MAX_TASK_CODE_NAME_LENGTH 48 +#define DSN_MAX_ERROR_CODE_NAME_LENGTH 48 +#define DSN_MAX_ADDRESS_NAME_LENGTH 48 +#define DSN_MAX_BUFFER_COUNT_IN_MESSAGE 64 +#define DSN_MAX_APP_TYPE_NAME_LENGTH 32 +#define DSN_MAX_CALLBAC_COUNT 32 +#define DSN_MAX_APP_COUNT_IN_SAME_PROCESS 256 +#define DSN_MAX_PATH 1024 -// some useful utility functions provided by rDSN, -// such as logging, performance counter, checksum, -// command line interface registration and invocation, -// etc. -#include +typedef void *dsn_handle_t; diff --git a/src/rdsn/src/common/backup_common.h b/src/rdsn/src/common/backup_common.h index 990a3fa89a..1d826ca11a 100644 --- a/src/rdsn/src/common/backup_common.h +++ b/src/rdsn/src/common/backup_common.h @@ -18,9 +18,9 @@ #pragma once #include -#include +#include "common/gpid.h" #include "backup_types.h" -#include +#include "runtime/rpc/rpc_holder.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/common/bulk_load_common.h b/src/rdsn/src/common/bulk_load_common.h index 949e2b0c32..616754bcc9 100644 --- a/src/rdsn/src/common/bulk_load_common.h +++ b/src/rdsn/src/common/bulk_load_common.h @@ -18,7 +18,7 @@ #pragma once #include "bulk_load_types.h" -#include +#include "runtime/rpc/rpc_holder.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/common/common.cpp b/src/rdsn/src/common/common.cpp index f8f3aaa325..c9f09ceded 100644 --- a/src/rdsn/src/common/common.cpp +++ b/src/rdsn/src/common/common.cpp @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "common/common.h" +#include "utils/flags.h" namespace dsn { DSN_DEFINE_string("replication", cluster_name, "", "name of this cluster"); diff --git a/src/rdsn/include/dsn/dist/common.h b/src/rdsn/src/common/common.h similarity index 100% rename from src/rdsn/include/dsn/dist/common.h rename to src/rdsn/src/common/common.h diff --git a/src/rdsn/src/common/duplication_common.cpp b/src/rdsn/src/common/duplication_common.cpp index 9184bcee16..759cb637a9 100644 --- a/src/rdsn/src/common/duplication_common.cpp +++ b/src/rdsn/src/common/duplication_common.cpp @@ -15,11 +15,18 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include -#include -#include +#include "duplication_common.h" + +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" +#include "utils/fmt_logging.h" +#include "utils/singleton.h" +#include "utils/time_utils.h" #include namespace dsn { diff --git a/src/rdsn/include/dsn/dist/replication/duplication_common.h b/src/rdsn/src/common/duplication_common.h similarity index 91% rename from src/rdsn/include/dsn/dist/replication/duplication_common.h rename to src/rdsn/src/common/duplication_common.h index ff84e13186..defe4b6d7c 100644 --- a/src/rdsn/include/dsn/dist/replication/duplication_common.h +++ b/src/rdsn/src/common/duplication_common.h @@ -19,10 +19,16 @@ #pragma once -#include -#include -#include -#include +#include "runtime/rpc/rpc_holder.h" +#include "utils/errors.h" +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" +#include "utils/flags.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/common/fs_manager.cpp b/src/rdsn/src/common/fs_manager.cpp index 1890db6f3a..7609e97569 100644 --- a/src/rdsn/src/common/fs_manager.cpp +++ b/src/rdsn/src/common/fs_manager.cpp @@ -33,11 +33,11 @@ */ #include "fs_manager.h" -#include -#include +#include "utils/utils.h" +#include "utils/filesystem.h" #include -#include -#include +#include "utils/fmt_logging.h" +#include "utils/fail_point.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/common/fs_manager.h b/src/rdsn/src/common/fs_manager.h index 7e106503c0..b6f4dd636d 100644 --- a/src/rdsn/src/common/fs_manager.h +++ b/src/rdsn/src/common/fs_manager.h @@ -19,10 +19,23 @@ #include -#include -#include -#include -#include +#include "perf_counter/perf_counter_wrapper.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "utils/zlocks.h" +#include "utils/flags.h" #include "replication_common.h" diff --git a/src/rdsn/include/dsn/tool-api/gpid.h b/src/rdsn/src/common/gpid.h similarity index 100% rename from src/rdsn/include/dsn/tool-api/gpid.h rename to src/rdsn/src/common/gpid.h diff --git a/src/rdsn/include/dsn/cpp/json_helper.h b/src/rdsn/src/common/json_helper.h similarity index 98% rename from src/rdsn/include/dsn/cpp/json_helper.h rename to src/rdsn/src/common/json_helper.h index 4953661f96..8706512d31 100644 --- a/src/rdsn/include/dsn/cpp/json_helper.h +++ b/src/rdsn/src/common/json_helper.h @@ -41,12 +41,22 @@ #include -#include -#include -#include -#include -#include -#include +#include "utils/api_utilities.h" +#include "utils/autoref_ptr.h" +#include "utils/utils.h" + +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" +#include "common/replication_enums.h" #define JSON_ENCODE_ENTRY(out, prefix, T) \ out.Key(#T); \ diff --git a/src/rdsn/src/common/manual_compact.h b/src/rdsn/src/common/manual_compact.h index 0ca9d67b65..c6e7ae3b67 100644 --- a/src/rdsn/src/common/manual_compact.h +++ b/src/rdsn/src/common/manual_compact.h @@ -18,7 +18,7 @@ #pragma once #include "meta_admin_types.h" -#include +#include "runtime/rpc/rpc_holder.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/common/partition_split_common.h b/src/rdsn/src/common/partition_split_common.h index f74773eb03..e9cc376c9b 100644 --- a/src/rdsn/src/common/partition_split_common.h +++ b/src/rdsn/src/common/partition_split_common.h @@ -18,7 +18,7 @@ #pragma once #include "partition_split_types.h" -#include +#include "runtime/rpc/rpc_holder.h" namespace dsn { namespace replication { diff --git a/src/rdsn/include/dsn/dist/replication/replica_envs.h b/src/rdsn/src/common/replica_envs.h similarity index 100% rename from src/rdsn/include/dsn/dist/replication/replica_envs.h rename to src/rdsn/src/common/replica_envs.h diff --git a/src/rdsn/include/dsn/dist/replication/replication.codes.h b/src/rdsn/src/common/replication.codes.h similarity index 98% rename from src/rdsn/include/dsn/dist/replication/replication.codes.h rename to src/rdsn/src/common/replication.codes.h index 2766d4a3a9..c39a969d41 100644 --- a/src/rdsn/include/dsn/dist/replication/replication.codes.h +++ b/src/rdsn/src/common/replication.codes.h @@ -26,7 +26,10 @@ #pragma once -#include +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" DEFINE_THREAD_POOL_CODE(THREAD_POOL_META_SERVER) DEFINE_THREAD_POOL_CODE(THREAD_POOL_META_STATE) diff --git a/src/rdsn/src/common/replication_common.cpp b/src/rdsn/src/common/replication_common.cpp index 9d42b6fba7..e4c0fa9301 100644 --- a/src/rdsn/src/common/replication_common.cpp +++ b/src/rdsn/src/common/replication_common.cpp @@ -26,10 +26,10 @@ #include -#include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "common/replica_envs.h" +#include "utils/flags.h" +#include "utils/filesystem.h" #include "replication_common.h" diff --git a/src/rdsn/src/common/replication_common.h b/src/rdsn/src/common/replication_common.h index 74684f67c5..f35763b79a 100644 --- a/src/rdsn/src/common/replication_common.h +++ b/src/rdsn/src/common/replication_common.h @@ -26,7 +26,22 @@ #pragma once -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "common/replication_other_types.h" +#include "common/replication.codes.h" #include namespace dsn { diff --git a/src/rdsn/include/dsn/dist/replication/replication_enums.h b/src/rdsn/src/common/replication_enums.h similarity index 99% rename from src/rdsn/include/dsn/dist/replication/replication_enums.h rename to src/rdsn/src/common/replication_enums.h index 0b01aed56f..9c8f1c7b47 100644 --- a/src/rdsn/include/dsn/dist/replication/replication_enums.h +++ b/src/rdsn/src/common/replication_enums.h @@ -26,7 +26,7 @@ #pragma once -#include +#include "utils/enum_helper.h" namespace dsn { ENUM_BEGIN2(app_status::type, app_status, app_status::AS_INVALID) diff --git a/src/rdsn/include/dsn/dist/replication/replication_other_types.h b/src/rdsn/src/common/replication_other_types.h similarity index 93% rename from src/rdsn/include/dsn/dist/replication/replication_other_types.h rename to src/rdsn/src/common/replication_other_types.h index 6f236b41db..557d97ecb4 100644 --- a/src/rdsn/include/dsn/dist/replication/replication_other_types.h +++ b/src/rdsn/src/common/replication_other_types.h @@ -36,8 +36,14 @@ #define replication_OTHER_TYPES_H #include -#include -#include +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" +#include "common/replication_enums.h" namespace dsn { namespace replication { diff --git a/src/rdsn/include/dsn/cpp/serialization_helper/dsn_types.h b/src/rdsn/src/common/serialization_helper/dsn_types.h similarity index 96% rename from src/rdsn/include/dsn/cpp/serialization_helper/dsn_types.h rename to src/rdsn/src/common/serialization_helper/dsn_types.h index dfc210d397..2224bd1507 100644 --- a/src/rdsn/include/dsn/cpp/serialization_helper/dsn_types.h +++ b/src/rdsn/src/common/serialization_helper/dsn_types.h @@ -26,4 +26,4 @@ #pragma once -#include \ No newline at end of file +#include "runtime/rpc/serialization.h" diff --git a/src/rdsn/include/dsn/cpp/serialization_helper/thrift_helper.h b/src/rdsn/src/common/serialization_helper/thrift_helper.h similarity index 92% rename from src/rdsn/include/dsn/cpp/serialization_helper/thrift_helper.h rename to src/rdsn/src/common/serialization_helper/thrift_helper.h index 0e446ce861..16b6ede83e 100644 --- a/src/rdsn/include/dsn/cpp/serialization_helper/thrift_helper.h +++ b/src/rdsn/src/common/serialization_helper/thrift_helper.h @@ -24,20 +24,10 @@ * THE SOFTWARE. */ -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * 2016-02-24, Weijie Sun(sunweijie[at]xiaomi.com), add support for serialization in thrift - * 2016-03-01, Weijie Sun(sunweijie[at]xiaomi.com), add support for rpc in thrift - */ - #pragma once -#include -#include +#include "runtime/tool_api.h" +#include "runtime/rpc/rpc_stream.h" #include #include @@ -191,32 +181,6 @@ inline uint32_t read_base(::apache::thrift::protocol::TProtocol *iprot, return xfer; } -class blob_string -{ -private: - blob &_buffer; - -public: - blob_string(blob &bb) : _buffer(bb) {} - - void clear() { _buffer.assign(std::shared_ptr(nullptr), 0, 0); } - void resize(std::size_t new_size) - { - std::shared_ptr b(dsn::utils::make_shared_array(new_size)); - _buffer.assign(b, 0, static_cast(new_size)); - } - void assign(const char *ptr, std::size_t size) - { - std::shared_ptr b(dsn::utils::make_shared_array(size)); - memcpy(b.get(), ptr, size); - _buffer.assign(b, 0, static_cast(size)); - } - const char *data() const { return _buffer.data(); } - size_t size() const { return _buffer.length(); } - - char &operator[](int pos) { return const_cast(_buffer.data())[pos]; } -}; - inline uint32_t rpc_address::read(apache::thrift::protocol::TProtocol *iprot) { apache::thrift::protocol::TBinaryProtocol *binary_proto = @@ -449,22 +413,6 @@ inline uint32_t task_code::write(apache::thrift::protocol::TProtocol *oprot) con } } -inline uint32_t blob::read(apache::thrift::protocol::TProtocol *iprot) -{ - // for optimization, it is dangerous if the oprot is not a binary proto - apache::thrift::protocol::TBinaryProtocol *binary_proto = - static_cast(iprot); - blob_string str(*this); - return binary_proto->readString(str); -} - -inline uint32_t blob::write(apache::thrift::protocol::TProtocol *oprot) const -{ - apache::thrift::protocol::TBinaryProtocol *binary_proto = - static_cast(oprot); - return binary_proto->writeString(blob_string(const_cast(*this))); -} - inline uint32_t error_code::read(apache::thrift::protocol::TProtocol *iprot) { std::string ec_string; diff --git a/src/rdsn/include/dsn/dist/replication/storage_serverlet.h b/src/rdsn/src/common/storage_serverlet.h similarity index 91% rename from src/rdsn/include/dsn/dist/replication/storage_serverlet.h rename to src/rdsn/src/common/storage_serverlet.h index b35e1adf86..4c73d6aabb 100644 --- a/src/rdsn/include/dsn/dist/replication/storage_serverlet.h +++ b/src/rdsn/src/common/storage_serverlet.h @@ -30,7 +30,20 @@ #include #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/common/test/common_test.cpp b/src/rdsn/src/common/test/common_test.cpp index fe44d1d1f1..3ca9b55086 100644 --- a/src/rdsn/src/common/test/common_test.cpp +++ b/src/rdsn/src/common/test/common_test.cpp @@ -17,7 +17,7 @@ * under the License. */ -#include +#include "common/common.h" #include namespace dsn { diff --git a/src/rdsn/src/common/test/duplication_common_test.cpp b/src/rdsn/src/common/test/duplication_common_test.cpp index c8e9de5391..63ef2547ee 100644 --- a/src/rdsn/src/common/test/duplication_common_test.cpp +++ b/src/rdsn/src/common/test/duplication_common_test.cpp @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include +#include "common//duplication_common.h" #include namespace dsn { diff --git a/src/rdsn/src/common/test/fs_manager_test.cpp b/src/rdsn/src/common/test/fs_manager_test.cpp index ab6dd1d355..89de9d1b51 100644 --- a/src/rdsn/src/common/test/fs_manager_test.cpp +++ b/src/rdsn/src/common/test/fs_manager_test.cpp @@ -18,7 +18,7 @@ */ #include -#include +#include "utils/fail_point.h" #include "common/fs_manager.h" diff --git a/src/rdsn/src/common/test/main.cpp b/src/rdsn/src/common/test/main.cpp index ff2215b9d5..02fb61c115 100644 --- a/src/rdsn/src/common/test/main.cpp +++ b/src/rdsn/src/common/test/main.cpp @@ -26,7 +26,20 @@ #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" int g_test_count = 0; int g_test_ret = 0; diff --git a/src/rdsn/src/common/test/replication_common_test.cpp b/src/rdsn/src/common/test/replication_common_test.cpp index 17db2795c9..9a3a05ea24 100644 --- a/src/rdsn/src/common/test/replication_common_test.cpp +++ b/src/rdsn/src/common/test/replication_common_test.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include "utils/filesystem.h" #include "common/replication_common.h" diff --git a/src/rdsn/src/failure_detector/failure_detector.cpp b/src/rdsn/src/failure_detector/failure_detector.cpp index 3b26d1b620..66e027af3e 100644 --- a/src/rdsn/src/failure_detector/failure_detector.cpp +++ b/src/rdsn/src/failure_detector/failure_detector.cpp @@ -33,8 +33,8 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include -#include +#include "failure_detector/failure_detector.h" +#include "utils/command_manager.h" #include #include diff --git a/src/rdsn/include/dsn/dist/failure_detector/failure_detector.h b/src/rdsn/src/failure_detector/failure_detector.h similarity index 97% rename from src/rdsn/include/dsn/dist/failure_detector/failure_detector.h rename to src/rdsn/src/failure_detector/failure_detector.h index 3e83a664fa..ee572d52c0 100644 --- a/src/rdsn/include/dsn/dist/failure_detector/failure_detector.h +++ b/src/rdsn/src/failure_detector/failure_detector.h @@ -61,10 +61,10 @@ */ #pragma once -#include -#include -#include -#include +#include "failure_detector/fd.client.h" +#include "failure_detector/fd.server.h" +#include "perf_counter/perf_counter_wrapper.h" +#include "utils/zlocks.h" namespace dsn { namespace fd { diff --git a/src/rdsn/src/failure_detector/failure_detector_multimaster.cpp b/src/rdsn/src/failure_detector/failure_detector_multimaster.cpp index 5c04a91c28..b834fa064f 100644 --- a/src/rdsn/src/failure_detector/failure_detector_multimaster.cpp +++ b/src/rdsn/src/failure_detector/failure_detector_multimaster.cpp @@ -34,10 +34,10 @@ */ #include -#include -#include -#include -#include +#include "utils/rpc_address.h" +#include "runtime/rpc/group_address.h" +#include "failure_detector/failure_detector_multimaster.h" +#include "utils/rand.h" namespace dsn { namespace dist { diff --git a/src/rdsn/include/dsn/dist/failure_detector_multimaster.h b/src/rdsn/src/failure_detector/failure_detector_multimaster.h similarity index 91% rename from src/rdsn/include/dsn/dist/failure_detector_multimaster.h rename to src/rdsn/src/failure_detector/failure_detector_multimaster.h index 2859396c0a..d384e153ac 100644 --- a/src/rdsn/include/dsn/dist/failure_detector_multimaster.h +++ b/src/rdsn/src/failure_detector/failure_detector_multimaster.h @@ -24,20 +24,11 @@ * THE SOFTWARE. */ -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * xxxx-xx-xx, author, fix bug about xxx - */ - #pragma once -#include -#include -#include +#include "runtime/rpc/group_address.h" +#include "utils/zlocks.h" +#include "failure_detector/failure_detector.h" #include namespace dsn { diff --git a/src/rdsn/include/dsn/dist/failure_detector/fd.client.h b/src/rdsn/src/failure_detector/fd.client.h similarity index 98% rename from src/rdsn/include/dsn/dist/failure_detector/fd.client.h rename to src/rdsn/src/failure_detector/fd.client.h index 6255e58b9d..586a9dc72b 100644 --- a/src/rdsn/include/dsn/dist/failure_detector/fd.client.h +++ b/src/rdsn/src/failure_detector/fd.client.h @@ -36,8 +36,8 @@ #pragma once #include "fd.code.definition.h" #include -#include -#include +#include "utils/optional.h" +#include "runtime/task/async_calls.h" namespace dsn { namespace fd { diff --git a/src/rdsn/include/dsn/dist/failure_detector/fd.code.definition.h b/src/rdsn/src/failure_detector/fd.code.definition.h similarity index 78% rename from src/rdsn/include/dsn/dist/failure_detector/fd.code.definition.h rename to src/rdsn/src/failure_detector/fd.code.definition.h index 3d9a0fec58..eab6da9907 100644 --- a/src/rdsn/include/dsn/dist/failure_detector/fd.code.definition.h +++ b/src/rdsn/src/failure_detector/fd.code.definition.h @@ -24,19 +24,23 @@ * THE SOFTWARE. */ -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * xxxx-xx-xx, author, fix bug about xxx - */ - #pragma once -#include -#include +#include "runtime/task/task_code.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" #include "fd_types.h" namespace dsn { diff --git a/src/rdsn/include/dsn/dist/failure_detector/fd.server.h b/src/rdsn/src/failure_detector/fd.server.h similarity index 100% rename from src/rdsn/include/dsn/dist/failure_detector/fd.server.h rename to src/rdsn/src/failure_detector/fd.server.h diff --git a/src/rdsn/src/failure_detector/test/failure_detector.cpp b/src/rdsn/src/failure_detector/test/failure_detector.cpp index 1d92778b44..f111d304c2 100644 --- a/src/rdsn/src/failure_detector/test/failure_detector.cpp +++ b/src/rdsn/src/failure_detector/test/failure_detector.cpp @@ -29,7 +29,20 @@ #include "replica/replica_stub.h" #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" #include using namespace dsn; diff --git a/src/rdsn/src/failure_detector/test/main.cpp b/src/rdsn/src/failure_detector/test/main.cpp index 96823456ec..d6722c699b 100644 --- a/src/rdsn/src/failure_detector/test/main.cpp +++ b/src/rdsn/src/failure_detector/test/main.cpp @@ -32,7 +32,20 @@ #endif #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" int g_test_count = 0; int g_test_ret = 0; diff --git a/src/rdsn/src/http/builtin_http_calls.cpp b/src/rdsn/src/http/builtin_http_calls.cpp index d1b2620bf1..6089e70712 100644 --- a/src/rdsn/src/http/builtin_http_calls.cpp +++ b/src/rdsn/src/http/builtin_http_calls.cpp @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "utils/output_utils.h" +#include "utils/time_utils.h" #include "builtin_http_calls.h" #include "http_call_registry.h" diff --git a/src/rdsn/src/http/builtin_http_calls.h b/src/rdsn/src/http/builtin_http_calls.h index 89e961f268..b8f6f3a819 100644 --- a/src/rdsn/src/http/builtin_http_calls.h +++ b/src/rdsn/src/http/builtin_http_calls.h @@ -17,9 +17,9 @@ #pragma once -#include -#include -#include +#include "runtime/serverlet.h" +#include "http_server.h" +#include "utils/errors.h" namespace dsn { diff --git a/src/rdsn/src/http/config_http_service.cpp b/src/rdsn/src/http/config_http_service.cpp index 127e9b1d20..b32cde3cd4 100644 --- a/src/rdsn/src/http/config_http_service.cpp +++ b/src/rdsn/src/http/config_http_service.cpp @@ -15,9 +15,9 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include +#include "http_server.h" +#include "utils/flags.h" +#include "utils/output_utils.h" namespace dsn { void update_config(const http_request &req, http_response &resp) diff --git a/src/rdsn/src/http/http_call_registry.h b/src/rdsn/src/http/http_call_registry.h index 6e15140e35..dca1df6532 100644 --- a/src/rdsn/src/http/http_call_registry.h +++ b/src/rdsn/src/http/http_call_registry.h @@ -17,9 +17,9 @@ #pragma once -#include -#include -#include +#include "utils/fmt_logging.h" +#include "http_server.h" +#include "utils/errors.h" namespace dsn { diff --git a/src/rdsn/src/http/http_message_parser.cpp b/src/rdsn/src/http/http_message_parser.cpp index 36866fce5a..6c4871ad93 100644 --- a/src/rdsn/src/http/http_message_parser.cpp +++ b/src/rdsn/src/http/http_message_parser.cpp @@ -26,13 +26,13 @@ #include "http_message_parser.h" -#include -#include -#include -#include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "utils/ports.h" +#include "utils/crc.h" +#include "runtime/rpc/rpc_message.h" +#include "runtime/rpc/serialization.h" +#include "runtime/api_layer1.h" +#include "http_server.h" #include namespace dsn { diff --git a/src/rdsn/src/http/http_message_parser.h b/src/rdsn/src/http/http_message_parser.h index 9b4550d7b9..96b518b575 100644 --- a/src/rdsn/src/http/http_message_parser.h +++ b/src/rdsn/src/http/http_message_parser.h @@ -26,9 +26,9 @@ #pragma once -#include -#include -#include +#include "utils/ports.h" +#include "runtime/rpc/rpc_message.h" +#include "runtime/rpc/message_parser.h" #include #include diff --git a/src/rdsn/src/http/http_server.cpp b/src/rdsn/src/http/http_server.cpp index ed457c5a12..9619bd1bcd 100644 --- a/src/rdsn/src/http/http_server.cpp +++ b/src/rdsn/src/http/http_server.cpp @@ -15,9 +15,9 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include +#include "http_server.h" +#include "runtime/tool_api.h" +#include "utils/time_utils.h" #include #include diff --git a/src/rdsn/include/dsn/http/http_server.h b/src/rdsn/src/http/http_server.h similarity index 96% rename from src/rdsn/include/dsn/http/http_server.h rename to src/rdsn/src/http/http_server.h index ff5faf7ca6..3b60829a8c 100644 --- a/src/rdsn/include/dsn/http/http_server.h +++ b/src/rdsn/src/http/http_server.h @@ -19,9 +19,10 @@ #pragma once -#include -#include -#include +#include "runtime/task/task_code.h" +#include "utils/blob.h" +#include "utils/errors.h" +#include "utils/flags.h" namespace dsn { diff --git a/src/rdsn/src/http/http_server_impl.h b/src/rdsn/src/http/http_server_impl.h index 790c688675..f78226a1cd 100644 --- a/src/rdsn/src/http/http_server_impl.h +++ b/src/rdsn/src/http/http_server_impl.h @@ -17,9 +17,9 @@ #pragma once -#include -#include -#include +#include "runtime/rpc/rpc_message.h" +#include "runtime/serverlet.h" +#include "http_server.h" namespace dsn { diff --git a/src/rdsn/src/http/perf_counter_http_service.cpp b/src/rdsn/src/http/perf_counter_http_service.cpp index 79fde42e21..7ab89e1146 100644 --- a/src/rdsn/src/http/perf_counter_http_service.cpp +++ b/src/rdsn/src/http/perf_counter_http_service.cpp @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include +#include "utils/output_utils.h" #include "builtin_http_calls.h" namespace dsn { diff --git a/src/rdsn/src/http/pprof_http_service.cpp b/src/rdsn/src/http/pprof_http_service.cpp index 68fc349e2c..d5ab2ddc19 100644 --- a/src/rdsn/src/http/pprof_http_service.cpp +++ b/src/rdsn/src/http/pprof_http_service.cpp @@ -26,13 +26,13 @@ #include "pprof_http_service.h" -#include -#include -#include -#include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "runtime/api_layer1.h" +#include "utils/process_utils.h" +#include "utils/string_conv.h" +#include "utils/defer.h" +#include "utils/timer.h" +#include "utils/string_splitter.h" #include #include #include diff --git a/src/rdsn/src/http/pprof_http_service.h b/src/rdsn/src/http/pprof_http_service.h index 389c705a80..2b0403cfa5 100644 --- a/src/rdsn/src/http/pprof_http_service.h +++ b/src/rdsn/src/http/pprof_http_service.h @@ -19,7 +19,7 @@ #ifdef DSN_ENABLE_GPERF -#include +#include "http_server.h" namespace dsn { diff --git a/src/rdsn/src/http/test/http_server_test.cpp b/src/rdsn/src/http/test/http_server_test.cpp index a76549e45a..da81bcb896 100644 --- a/src/rdsn/src/http/test/http_server_test.cpp +++ b/src/rdsn/src/http/test/http_server_test.cpp @@ -15,9 +15,9 @@ // specific language governing permissions and limitations // under the License. -#include #include +#include "http/http_server.h" #include "http/http_message_parser.h" #include "http/builtin_http_calls.h" #include "http/http_call_registry.h" diff --git a/src/rdsn/src/http/test/perf_counter_http_service_test.cpp b/src/rdsn/src/http/test/perf_counter_http_service_test.cpp index 03a428cf79..ba9f14200a 100644 --- a/src/rdsn/src/http/test/perf_counter_http_service_test.cpp +++ b/src/rdsn/src/http/test/perf_counter_http_service_test.cpp @@ -16,9 +16,9 @@ // under the License. #include -#include -#include +#include "perf_counter/perf_counters.h" +#include "http/http_server.h" #include "http/builtin_http_calls.h" namespace dsn { diff --git a/src/rdsn/src/http/test/uri_decoder_test.cpp b/src/rdsn/src/http/test/uri_decoder_test.cpp index 6e0660d935..e39ed529cc 100644 --- a/src/rdsn/src/http/test/uri_decoder_test.cpp +++ b/src/rdsn/src/http/test/uri_decoder_test.cpp @@ -16,7 +16,7 @@ // under the License. #include -#include +#include "utils/error_code.h" #include namespace dsn { diff --git a/src/rdsn/src/http/uri_decoder.cpp b/src/rdsn/src/http/uri_decoder.cpp index 2e1ec13870..1eeeed0638 100644 --- a/src/rdsn/src/http/uri_decoder.cpp +++ b/src/rdsn/src/http/uri_decoder.cpp @@ -19,7 +19,7 @@ #include -#include +#include "utils/fmt_logging.h" namespace dsn { namespace uri { diff --git a/src/rdsn/src/http/uri_decoder.h b/src/rdsn/src/http/uri_decoder.h index 452fca63f0..1367c5c4ce 100644 --- a/src/rdsn/src/http/uri_decoder.h +++ b/src/rdsn/src/http/uri_decoder.h @@ -18,7 +18,7 @@ #pragma once #include -#include +#include "utils/errors.h" namespace dsn { namespace uri { diff --git a/src/rdsn/src/meta/app_balance_policy.cpp b/src/rdsn/src/meta/app_balance_policy.cpp index e0bcdcbcad..49db0b8df9 100644 --- a/src/rdsn/src/meta/app_balance_policy.cpp +++ b/src/rdsn/src/meta/app_balance_policy.cpp @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "utils/command_manager.h" +#include "utils/fmt_logging.h" #include "app_balance_policy.h" #include "meta_service.h" diff --git a/src/rdsn/src/meta/app_env_validator.cpp b/src/rdsn/src/meta/app_env_validator.cpp index 8441fb3043..ed112683ba 100644 --- a/src/rdsn/src/meta/app_env_validator.cpp +++ b/src/rdsn/src/meta/app_env_validator.cpp @@ -19,10 +19,10 @@ #include "common/replication_common.h" #include -#include -#include -#include -#include +#include "utils/string_conv.h" +#include "utils/fmt_logging.h" +#include "common/replica_envs.h" +#include "utils/token_bucket_throttling_controller.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/meta/app_env_validator.h b/src/rdsn/src/meta/app_env_validator.h index 717a406dec..c401c39598 100644 --- a/src/rdsn/src/meta/app_env_validator.h +++ b/src/rdsn/src/meta/app_env_validator.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include "utils/singleton.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/meta/backup_engine.cpp b/src/rdsn/src/meta/backup_engine.cpp index 47af195257..69c316016e 100644 --- a/src/rdsn/src/meta/backup_engine.cpp +++ b/src/rdsn/src/meta/backup_engine.cpp @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "utils/fmt_logging.h" +#include "utils/filesystem.h" #include "common/backup_common.h" #include "common/replication_common.h" diff --git a/src/rdsn/src/meta/backup_engine.h b/src/rdsn/src/meta/backup_engine.h index 75a84b7935..122d57ab48 100644 --- a/src/rdsn/src/meta/backup_engine.h +++ b/src/rdsn/src/meta/backup_engine.h @@ -17,9 +17,9 @@ #pragma once -#include -#include -#include +#include "common/json_helper.h" +#include "block_service/block_service.h" +#include "utils/zlocks.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/meta/cluster_balance_policy.cpp b/src/rdsn/src/meta/cluster_balance_policy.cpp index 1048074e3f..f8a5e5d70f 100644 --- a/src/rdsn/src/meta/cluster_balance_policy.cpp +++ b/src/rdsn/src/meta/cluster_balance_policy.cpp @@ -17,8 +17,8 @@ #include "cluster_balance_policy.h" -#include -#include +#include "utils/fmt_logging.h" +#include "utils/flags.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/meta/distributed_lock_service_simple.cpp b/src/rdsn/src/meta/distributed_lock_service_simple.cpp index 90be489d31..da281176c0 100644 --- a/src/rdsn/src/meta/distributed_lock_service_simple.cpp +++ b/src/rdsn/src/meta/distributed_lock_service_simple.cpp @@ -33,7 +33,7 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include +#include "runtime/task/async_calls.h" #include "common/replication_common.h" #include "distributed_lock_service_simple.h" diff --git a/src/rdsn/src/meta/distributed_lock_service_simple.h b/src/rdsn/src/meta/distributed_lock_service_simple.h index ec68f830c9..90faf34500 100644 --- a/src/rdsn/src/meta/distributed_lock_service_simple.h +++ b/src/rdsn/src/meta/distributed_lock_service_simple.h @@ -35,8 +35,8 @@ #pragma once -#include -#include +#include "utils/zlocks.h" +#include "utils/distributed_lock_service.h" namespace dsn { namespace dist { diff --git a/src/rdsn/src/meta/dump_file.h b/src/rdsn/src/meta/dump_file.h index 953f1b329f..f888ef2d11 100644 --- a/src/rdsn/src/meta/dump_file.h +++ b/src/rdsn/src/meta/dump_file.h @@ -35,10 +35,27 @@ */ #pragma once -#include -#include -#include -#include +#include "utils/safe_strerror_posix.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "utils/crc.h" #include #include #include diff --git a/src/rdsn/src/meta/duplication/duplication_info.cpp b/src/rdsn/src/meta/duplication/duplication_info.cpp index 8ce8126ede..373aea2c6c 100644 --- a/src/rdsn/src/meta/duplication/duplication_info.cpp +++ b/src/rdsn/src/meta/duplication/duplication_info.cpp @@ -19,7 +19,7 @@ #include "meta/meta_data.h" #include -#include +#include "utils/fmt_logging.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/meta/duplication/duplication_info.h b/src/rdsn/src/meta/duplication/duplication_info.h index 97f236d6ec..b4d08704f1 100644 --- a/src/rdsn/src/meta/duplication/duplication_info.h +++ b/src/rdsn/src/meta/duplication/duplication_info.h @@ -17,12 +17,18 @@ #pragma once -#include -#include -#include -#include -#include -#include +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" +#include "common/replication_other_types.h" +#include "common//duplication_common.h" +#include "common/json_helper.h" +#include "utils/zlocks.h" +#include "utils/fmt_logging.h" #include #include diff --git a/src/rdsn/src/meta/duplication/meta_duplication_service.cpp b/src/rdsn/src/meta/duplication/meta_duplication_service.cpp index 7064615941..fe36975c9c 100644 --- a/src/rdsn/src/meta/duplication/meta_duplication_service.cpp +++ b/src/rdsn/src/meta/duplication/meta_duplication_service.cpp @@ -15,16 +15,16 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include -#include -#include -#include +#include "common//duplication_common.h" +#include "utils/fmt_logging.h" +#include "common/common.h" +#include "utils/chrono_literals.h" +#include "utils/string_conv.h" +#include "runtime/rpc/group_address.h" #include "meta/meta_service.h" #include "meta_duplication_service.h" -#include "dsn/utility/fail_point.h" +#include "utils/fail_point.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/meta/greedy_load_balancer.cpp b/src/rdsn/src/meta/greedy_load_balancer.cpp index bda9c00a5a..3e4d571b94 100644 --- a/src/rdsn/src/meta/greedy_load_balancer.cpp +++ b/src/rdsn/src/meta/greedy_load_balancer.cpp @@ -26,11 +26,11 @@ #include #include -#include -#include -#include -#include -#include +#include "utils/command_manager.h" +#include "utils/math.h" +#include "utils/utils.h" +#include "utils/fmt_logging.h" +#include "utils/fail_point.h" #include "greedy_load_balancer.h" #include "meta_data.h" #include "meta_admin_types.h" diff --git a/src/rdsn/src/meta/load_balance_policy.cpp b/src/rdsn/src/meta/load_balance_policy.cpp index c54bc38488..123ce96121 100644 --- a/src/rdsn/src/meta/load_balance_policy.cpp +++ b/src/rdsn/src/meta/load_balance_policy.cpp @@ -18,9 +18,9 @@ #include "load_balance_policy.h" #include "greedy_load_balancer.h" -#include -#include -#include +#include "utils/command_manager.h" +#include "utils/fmt_logging.h" +#include "utils/fail_point.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/meta/meta_backup_service.cpp b/src/rdsn/src/meta/meta_backup_service.cpp index 2b602a2ee7..e5b2647941 100644 --- a/src/rdsn/src/meta/meta_backup_service.cpp +++ b/src/rdsn/src/meta/meta_backup_service.cpp @@ -15,11 +15,11 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "http/http_server.h" +#include "utils/filesystem.h" +#include "utils/output_utils.h" +#include "utils/time_utils.h" #include "block_service/block_service_manager.h" #include "common/backup_common.h" diff --git a/src/rdsn/src/meta/meta_backup_service.h b/src/rdsn/src/meta/meta_backup_service.h index 7a38b1bb9d..bf4b98e192 100644 --- a/src/rdsn/src/meta/meta_backup_service.h +++ b/src/rdsn/src/meta/meta_backup_service.h @@ -22,9 +22,9 @@ #include // std::setfill, std::setw #include -#include -#include -#include +#include "block_service/block_service.h" +#include "http/http_server.h" +#include "perf_counter/perf_counter_wrapper.h" #include #include "backup_engine.h" diff --git a/src/rdsn/src/meta/meta_bulk_load_ingestion_context.cpp b/src/rdsn/src/meta/meta_bulk_load_ingestion_context.cpp index 4522ee12f8..bfeda7685f 100644 --- a/src/rdsn/src/meta/meta_bulk_load_ingestion_context.cpp +++ b/src/rdsn/src/meta/meta_bulk_load_ingestion_context.cpp @@ -17,8 +17,8 @@ #include "meta_bulk_load_ingestion_context.h" -#include -#include +#include "utils/fmt_logging.h" +#include "utils/fail_point.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/meta/meta_bulk_load_service.cpp b/src/rdsn/src/meta/meta_bulk_load_service.cpp index 740a1205f2..9ae19679e1 100644 --- a/src/rdsn/src/meta/meta_bulk_load_service.cpp +++ b/src/rdsn/src/meta/meta_bulk_load_service.cpp @@ -15,9 +15,9 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include +#include "utils/fmt_logging.h" +#include "common/replica_envs.h" +#include "utils/fail_point.h" #include "meta_bulk_load_service.h" diff --git a/src/rdsn/src/meta/meta_data.cpp b/src/rdsn/src/meta/meta_data.cpp index e78ce0fb65..9c10a56f3d 100644 --- a/src/rdsn/src/meta/meta_data.cpp +++ b/src/rdsn/src/meta/meta_data.cpp @@ -34,9 +34,22 @@ */ #include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "utils/flags.h" #include "meta_data.h" diff --git a/src/rdsn/src/meta/meta_data.h b/src/rdsn/src/meta/meta_data.h index 6c70b8e39b..cae4a344e0 100644 --- a/src/rdsn/src/meta/meta_data.h +++ b/src/rdsn/src/meta/meta_data.h @@ -41,13 +41,19 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include "utils/utils.h" +#include "utils/extensible_object.h" +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" +#include "common/replication_other_types.h" +#include "common/json_helper.h" +#include "utils/zlocks.h" +#include "block_service/block_service.h" #include "meta/duplication/duplication_info.h" diff --git a/src/rdsn/src/meta/meta_http_service.cpp b/src/rdsn/src/meta/meta_http_service.cpp index 5c0ddd656c..276f6ffedb 100644 --- a/src/rdsn/src/meta/meta_http_service.cpp +++ b/src/rdsn/src/meta/meta_http_service.cpp @@ -17,14 +17,20 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include "runtime/api_layer1.h" +#include "common/serialization_helper/dsn.layer2_types.h" +#include "common/replica_envs.h" +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" +#include "common//duplication_common.h" +#include "utils/config_api.h" +#include "utils/output_utils.h" +#include "utils/time_utils.h" #include "meta_http_service.h" #include "meta_server_failure_detector.h" diff --git a/src/rdsn/src/meta/meta_http_service.h b/src/rdsn/src/meta/meta_http_service.h index 03dbeae1e5..dbd497880c 100644 --- a/src/rdsn/src/meta/meta_http_service.h +++ b/src/rdsn/src/meta/meta_http_service.h @@ -19,8 +19,8 @@ #include -#include -#include +#include "common/json_helper.h" +#include "http/http_server.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/meta/meta_options.cpp b/src/rdsn/src/meta/meta_options.cpp index 6ddc7c39e4..c97d156904 100644 --- a/src/rdsn/src/meta/meta_options.cpp +++ b/src/rdsn/src/meta/meta_options.cpp @@ -34,7 +34,7 @@ */ #include "meta_options.h" -#include +#include "utils/flags.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/meta/meta_options.h b/src/rdsn/src/meta/meta_options.h index b65736542f..835177682c 100644 --- a/src/rdsn/src/meta/meta_options.h +++ b/src/rdsn/src/meta/meta_options.h @@ -35,7 +35,22 @@ #pragma once #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "common/replication_other_types.h" +#include "common/replication.codes.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/meta/meta_rpc_types.h b/src/rdsn/src/meta/meta_rpc_types.h index cd419088c6..746158915e 100644 --- a/src/rdsn/src/meta/meta_rpc_types.h +++ b/src/rdsn/src/meta/meta_rpc_types.h @@ -17,8 +17,14 @@ #pragma once -#include -#include +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" +#include "runtime/rpc/rpc_holder.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/meta/meta_server_failure_detector.cpp b/src/rdsn/src/meta/meta_server_failure_detector.cpp index 4e56e0575c..bc19e4a30f 100644 --- a/src/rdsn/src/meta/meta_server_failure_detector.cpp +++ b/src/rdsn/src/meta/meta_server_failure_detector.cpp @@ -33,9 +33,9 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include -#include -#include +#include "utils/factory_store.h" +#include "utils/fail_point.h" +#include "utils/fmt_logging.h" #include "meta_server_failure_detector.h" #include "server_state.h" #include "meta_service.h" diff --git a/src/rdsn/src/meta/meta_server_failure_detector.h b/src/rdsn/src/meta/meta_server_failure_detector.h index 0e0571afd5..6dea2dec4c 100644 --- a/src/rdsn/src/meta/meta_server_failure_detector.h +++ b/src/rdsn/src/meta/meta_server_failure_detector.h @@ -35,8 +35,8 @@ #pragma once -#include -#include +#include "failure_detector/failure_detector.h" +#include "utils/distributed_lock_service.h" #include "common/replication_common.h" #include "meta_options.h" diff --git a/src/rdsn/src/meta/meta_service.cpp b/src/rdsn/src/meta/meta_service.cpp index 39712eb6a5..9aece6b076 100644 --- a/src/rdsn/src/meta/meta_service.cpp +++ b/src/rdsn/src/meta/meta_service.cpp @@ -29,16 +29,16 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include "utils/factory_store.h" +#include "utils/extensible_object.h" +#include "utils/string_conv.h" +#include "meta/meta_state_service.h" +#include "common/common.h" +#include "remote_cmd/remote_command.h" +#include "utils/command_manager.h" #include // for std::remove_if #include // for ::isspace -#include +#include "utils/fmt_logging.h" #include "meta_service.h" #include "server_state.h" diff --git a/src/rdsn/src/meta/meta_service.h b/src/rdsn/src/meta/meta_service.h index b8b50967e1..0a040257b1 100644 --- a/src/rdsn/src/meta/meta_service.h +++ b/src/rdsn/src/meta/meta_service.h @@ -37,9 +37,9 @@ #include -#include -#include -#include +#include "runtime/serverlet.h" +#include "meta/meta_state_service.h" +#include "perf_counter/perf_counter_wrapper.h" #include "common/replication_common.h" #include "common/bulk_load_common.h" diff --git a/src/rdsn/src/meta/meta_service_app.cpp b/src/rdsn/src/meta/meta_service_app.cpp index bffbdcb95a..af7c2b95a0 100644 --- a/src/rdsn/src/meta/meta_service_app.cpp +++ b/src/rdsn/src/meta/meta_service_app.cpp @@ -24,10 +24,25 @@ * THE SOFTWARE. */ -#include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "common/replication_other_types.h" +#include "common/replication.codes.h" +#include "utils/factory_store.h" +#include "meta/meta_service_app.h" +#include "http/http_server.h" #include "distributed_lock_service_simple.h" #include "meta_state_service_simple.h" diff --git a/src/rdsn/include/dsn/dist/replication/meta_service_app.h b/src/rdsn/src/meta/meta_service_app.h similarity index 98% rename from src/rdsn/include/dsn/dist/replication/meta_service_app.h rename to src/rdsn/src/meta/meta_service_app.h index 0777f31965..87fc62b359 100644 --- a/src/rdsn/include/dsn/dist/replication/meta_service_app.h +++ b/src/rdsn/src/meta/meta_service_app.h @@ -25,7 +25,7 @@ */ #pragma once -#include +#include "runtime/service_app.h" namespace dsn { class version_http_service; diff --git a/src/rdsn/src/meta/meta_split_service.cpp b/src/rdsn/src/meta/meta_split_service.cpp index 6516ecdc62..1d62654871 100644 --- a/src/rdsn/src/meta/meta_split_service.cpp +++ b/src/rdsn/src/meta/meta_split_service.cpp @@ -15,9 +15,9 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include +#include "utils/fmt_logging.h" +#include "common/replica_envs.h" +#include "utils/fail_point.h" #include "meta_split_service.h" #include "meta_state_service_utils.h" diff --git a/src/rdsn/include/dsn/dist/meta_state_service.h b/src/rdsn/src/meta/meta_state_service.h similarity index 93% rename from src/rdsn/include/dsn/dist/meta_state_service.h rename to src/rdsn/src/meta/meta_state_service.h index 9d9fdcd446..d158a8f7be 100644 --- a/src/rdsn/include/dsn/dist/meta_state_service.h +++ b/src/rdsn/src/meta/meta_state_service.h @@ -43,9 +43,22 @@ #pragma once -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "utils/error_code.h" +#include "runtime/task/future_types.h" #include #include diff --git a/src/rdsn/src/meta/meta_state_service_simple.cpp b/src/rdsn/src/meta/meta_state_service_simple.cpp index 09ac08e0c3..ec08058d93 100644 --- a/src/rdsn/src/meta/meta_state_service_simple.cpp +++ b/src/rdsn/src/meta/meta_state_service_simple.cpp @@ -31,9 +31,9 @@ #include #include -#include -#include -#include +#include "runtime/task/task.h" +#include "runtime/task/async_calls.h" +#include "utils/filesystem.h" namespace dsn { namespace dist { diff --git a/src/rdsn/src/meta/meta_state_service_simple.h b/src/rdsn/src/meta/meta_state_service_simple.h index 7130b149d1..3855e4b2d7 100644 --- a/src/rdsn/src/meta/meta_state_service_simple.h +++ b/src/rdsn/src/meta/meta_state_service_simple.h @@ -34,8 +34,8 @@ */ #include -#include -#include +#include "utils/zlocks.h" +#include "meta/meta_state_service.h" #include "common/replication_common.h" namespace dsn { diff --git a/src/rdsn/src/meta/meta_state_service_utils.cpp b/src/rdsn/src/meta/meta_state_service_utils.cpp index 206a13ec9d..c6e56acaa4 100644 --- a/src/rdsn/src/meta/meta_state_service_utils.cpp +++ b/src/rdsn/src/meta/meta_state_service_utils.cpp @@ -15,9 +15,24 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include +#include "runtime/pipeline.h" +#include "utils/fmt_logging.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "common/replication_other_types.h" +#include "common/replication.codes.h" #include "meta_state_service_utils.h" #include "meta_state_service_utils_impl.h" diff --git a/src/rdsn/src/meta/meta_state_service_utils.h b/src/rdsn/src/meta/meta_state_service_utils.h index bcc4e9fa09..6ebd4437e7 100644 --- a/src/rdsn/src/meta/meta_state_service_utils.h +++ b/src/rdsn/src/meta/meta_state_service_utils.h @@ -17,7 +17,7 @@ #pragma once -#include +#include "meta/meta_state_service.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/meta/meta_state_service_utils_impl.h b/src/rdsn/src/meta/meta_state_service_utils_impl.h index 8ae863be52..c1d355bbdf 100644 --- a/src/rdsn/src/meta/meta_state_service_utils_impl.h +++ b/src/rdsn/src/meta/meta_state_service_utils_impl.h @@ -17,8 +17,8 @@ #pragma once -#include -#include +#include "runtime/pipeline.h" +#include "utils/fmt_logging.h" #include "meta_state_service_utils.h" diff --git a/src/rdsn/src/meta/meta_state_service_zookeeper.cpp b/src/rdsn/src/meta/meta_state_service_zookeeper.cpp index 5090a709e4..44360e4427 100644 --- a/src/rdsn/src/meta/meta_state_service_zookeeper.cpp +++ b/src/rdsn/src/meta/meta_state_service_zookeeper.cpp @@ -31,8 +31,8 @@ * Revision history: * 2015-12-04, @shengofsun (sunweijie@xiaomi.com) */ -#include -#include +#include "runtime/task/async_calls.h" +#include "common/replication.codes.h" #include #include diff --git a/src/rdsn/src/meta/meta_state_service_zookeeper.h b/src/rdsn/src/meta/meta_state_service_zookeeper.h index 45b5155988..28bea9cd22 100644 --- a/src/rdsn/src/meta/meta_state_service_zookeeper.h +++ b/src/rdsn/src/meta/meta_state_service_zookeeper.h @@ -34,11 +34,11 @@ #pragma once -#include -#include -#include -#include -#include +#include "utils/synchronize.h" +#include "utils/autoref_ptr.h" +#include "runtime/task/task_tracker.h" +#include "meta/meta_state_service.h" +#include "utils/distributed_lock_service.h" namespace dsn { namespace dist { diff --git a/src/rdsn/src/meta/partition_guardian.cpp b/src/rdsn/src/meta/partition_guardian.cpp index f2eb22e3e7..c2775b898d 100644 --- a/src/rdsn/src/meta/partition_guardian.cpp +++ b/src/rdsn/src/meta/partition_guardian.cpp @@ -17,7 +17,7 @@ #include "partition_guardian.h" #include "server_load_balancer.h" -#include +#include "utils/time_utils.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/meta/server_load_balancer.cpp b/src/rdsn/src/meta/server_load_balancer.cpp index 89f9cbec2d..c5f21b84b1 100644 --- a/src/rdsn/src/meta/server_load_balancer.cpp +++ b/src/rdsn/src/meta/server_load_balancer.cpp @@ -25,11 +25,11 @@ */ #include "server_load_balancer.h" -#include -#include -#include +#include "utils/extensible_object.h" +#include "utils/string_conv.h" +#include "utils/command_manager.h" #include -#include +#include "utils/time_utils.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/meta/server_load_balancer.h b/src/rdsn/src/meta/server_load_balancer.h index e265542980..91f270644e 100644 --- a/src/rdsn/src/meta/server_load_balancer.h +++ b/src/rdsn/src/meta/server_load_balancer.h @@ -36,10 +36,23 @@ #pragma once -#include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "utils/zlocks.h" +#include "utils/command_manager.h" +#include "utils/error_code.h" #include #include #include diff --git a/src/rdsn/src/meta/server_state.cpp b/src/rdsn/src/meta/server_state.cpp index e557046053..d3da7a43b9 100644 --- a/src/rdsn/src/meta/server_state.cpp +++ b/src/rdsn/src/meta/server_state.cpp @@ -34,14 +34,14 @@ * 2016-04-25, Weijie Sun(sunweijie at xiaomi.com), refactor */ -#include -#include -#include -#include -#include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "common/replica_envs.h" +#include "utils/factory_store.h" +#include "utils/string_conv.h" +#include "utils/strings.h" +#include "runtime/task/task.h" +#include "utils/command_manager.h" +#include "runtime/task/async_calls.h" #include #include #include diff --git a/src/rdsn/src/meta/server_state.h b/src/rdsn/src/meta/server_state.h index b8459e7530..256154d7ca 100644 --- a/src/rdsn/src/meta/server_state.h +++ b/src/rdsn/src/meta/server_state.h @@ -36,10 +36,10 @@ #pragma once #include -#include -#include -#include -#include +#include "common/replication_other_types.h" +#include "block_service/block_service.h" +#include "perf_counter/perf_counter_wrapper.h" +#include "runtime/task/task_tracker.h" #include #include diff --git a/src/rdsn/src/meta/server_state_restore.cpp b/src/rdsn/src/meta/server_state_restore.cpp index 77d4a4bd73..d4c6f1205c 100644 --- a/src/rdsn/src/meta/server_state_restore.cpp +++ b/src/rdsn/src/meta/server_state_restore.cpp @@ -16,9 +16,9 @@ // under the License. #include -#include -#include -#include +#include "block_service/block_service.h" +#include "utils/fmt_logging.h" +#include "utils/filesystem.h" #include "block_service/block_service_manager.h" #include "common/backup_common.h" diff --git a/src/rdsn/src/meta/test/backup_test.cpp b/src/rdsn/src/meta/test/backup_test.cpp index a0790fcc70..6bca5956df 100644 --- a/src/rdsn/src/meta/test/backup_test.cpp +++ b/src/rdsn/src/meta/test/backup_test.cpp @@ -15,9 +15,22 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "utils/fail_point.h" +#include "utils/time_utils.h" #include #include "meta/meta_backup_service.h" diff --git a/src/rdsn/src/meta/test/balancer_validator.cpp b/src/rdsn/src/meta/test/balancer_validator.cpp index 1e6c963fde..aaa4dbfa3a 100644 --- a/src/rdsn/src/meta/test/balancer_validator.cpp +++ b/src/rdsn/src/meta/test/balancer_validator.cpp @@ -26,10 +26,33 @@ #include -#include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" +#include "common/serialization_helper/dsn.layer2_types.h" #include diff --git a/src/rdsn/src/meta/test/cluster_balance_policy_test.cpp b/src/rdsn/src/meta/test/cluster_balance_policy_test.cpp index cdfc31a914..c6708ff8f4 100644 --- a/src/rdsn/src/meta/test/cluster_balance_policy_test.cpp +++ b/src/rdsn/src/meta/test/cluster_balance_policy_test.cpp @@ -16,8 +16,8 @@ // under the License. #include -#include -#include +#include "utils/defer.h" +#include "utils/fail_point.h" #include "meta/cluster_balance_policy.h" namespace dsn { diff --git a/src/rdsn/src/meta/test/copy_replica_operation_test.cpp b/src/rdsn/src/meta/test/copy_replica_operation_test.cpp index 8564786515..81f5ef0719 100644 --- a/src/rdsn/src/meta/test/copy_replica_operation_test.cpp +++ b/src/rdsn/src/meta/test/copy_replica_operation_test.cpp @@ -16,7 +16,7 @@ // under the License. #include -#include +#include "utils/fail_point.h" #include "meta/app_balance_policy.h" namespace dsn { diff --git a/src/rdsn/src/meta/test/json_compacity.cpp b/src/rdsn/src/meta/test/json_compacity.cpp index 107eca640c..12e986007f 100644 --- a/src/rdsn/src/meta/test/json_compacity.cpp +++ b/src/rdsn/src/meta/test/json_compacity.cpp @@ -26,8 +26,25 @@ #include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" #include "meta/meta_service.h" #include "meta/server_state.h" diff --git a/src/rdsn/src/meta/test/main.cpp b/src/rdsn/src/meta/test/main.cpp index 1db033c224..fc85a7d75a 100644 --- a/src/rdsn/src/meta/test/main.cpp +++ b/src/rdsn/src/meta/test/main.cpp @@ -16,7 +16,20 @@ // under the License. #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" #include #include #include diff --git a/src/rdsn/src/meta/test/meta_app_envs_test.cpp b/src/rdsn/src/meta/test/meta_app_envs_test.cpp index 6c6de33a3a..ec651ae0d1 100644 --- a/src/rdsn/src/meta/test/meta_app_envs_test.cpp +++ b/src/rdsn/src/meta/test/meta_app_envs_test.cpp @@ -24,8 +24,14 @@ * THE SOFTWARE. */ -#include -#include +#include "common/replica_envs.h" +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" #include "meta_test_base.h" #include "meta/meta_service.h" diff --git a/src/rdsn/src/meta/test/meta_app_operation_test.cpp b/src/rdsn/src/meta/test/meta_app_operation_test.cpp index 190a341249..aca217e671 100644 --- a/src/rdsn/src/meta/test/meta_app_operation_test.cpp +++ b/src/rdsn/src/meta/test/meta_app_operation_test.cpp @@ -16,10 +16,14 @@ // under the License. #include -#include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "common/replica_envs.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/defer.h" #include "meta_service_test_app.h" #include "meta_test_base.h" diff --git a/src/rdsn/src/meta/test/meta_backup_test.cpp b/src/rdsn/src/meta/test/meta_backup_test.cpp index ce7cbfa7c2..5f8a31323f 100644 --- a/src/rdsn/src/meta/test/meta_backup_test.cpp +++ b/src/rdsn/src/meta/test/meta_backup_test.cpp @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "utils/fail_point.h" +#include "utils/filesystem.h" #include #include "common/backup_common.h" diff --git a/src/rdsn/src/meta/test/meta_bulk_load_ingestion_test.cpp b/src/rdsn/src/meta/test/meta_bulk_load_ingestion_test.cpp index 783a97bfb3..cc3969aa46 100644 --- a/src/rdsn/src/meta/test/meta_bulk_load_ingestion_test.cpp +++ b/src/rdsn/src/meta/test/meta_bulk_load_ingestion_test.cpp @@ -16,8 +16,8 @@ // under the License. #include -#include -#include +#include "utils/fmt_logging.h" +#include "utils/fail_point.h" #include "meta_test_base.h" #include "meta_service_test_app.h" diff --git a/src/rdsn/src/meta/test/meta_bulk_load_service_test.cpp b/src/rdsn/src/meta/test/meta_bulk_load_service_test.cpp index 2d5e0620d0..047e272edf 100644 --- a/src/rdsn/src/meta/test/meta_bulk_load_service_test.cpp +++ b/src/rdsn/src/meta/test/meta_bulk_load_service_test.cpp @@ -16,9 +16,9 @@ // under the License. #include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "common/replica_envs.h" +#include "utils/fail_point.h" #include "meta_test_base.h" #include "meta_service_test_app.h" diff --git a/src/rdsn/src/meta/test/meta_duplication_service_test.cpp b/src/rdsn/src/meta/test/meta_duplication_service_test.cpp index 0fadc50f6c..abb98907b1 100644 --- a/src/rdsn/src/meta/test/meta_duplication_service_test.cpp +++ b/src/rdsn/src/meta/test/meta_duplication_service_test.cpp @@ -25,9 +25,9 @@ */ #include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "common/common.h" +#include "utils/time_utils.h" #include "meta/server_load_balancer.h" #include "meta/meta_server_failure_detector.h" @@ -37,7 +37,7 @@ #include "meta_service_test_app.h" #include "meta_test_base.h" -#include "dsn/utility/fail_point.h" +#include "utils/fail_point.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/meta/test/meta_http_service_test.cpp b/src/rdsn/src/meta/test/meta_http_service_test.cpp index 4e362fe00e..5c7efb8c77 100644 --- a/src/rdsn/src/meta/test/meta_http_service_test.cpp +++ b/src/rdsn/src/meta/test/meta_http_service_test.cpp @@ -17,9 +17,9 @@ #include #include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "http/http_server.h" +#include "utils/fail_point.h" #include "meta/meta_http_service.h" #include "meta/meta_service.h" diff --git a/src/rdsn/src/meta/test/meta_mauanl_compaction_test.cpp b/src/rdsn/src/meta/test/meta_mauanl_compaction_test.cpp index 4188d7af0d..c35fd7b8d2 100644 --- a/src/rdsn/src/meta/test/meta_mauanl_compaction_test.cpp +++ b/src/rdsn/src/meta/test/meta_mauanl_compaction_test.cpp @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include +#include "common/replica_envs.h" #include "meta_service_test_app.h" #include "meta_test_base.h" diff --git a/src/rdsn/src/meta/test/meta_partition_guardian_test.cpp b/src/rdsn/src/meta/test/meta_partition_guardian_test.cpp index 9e0de940fa..50346b225d 100644 --- a/src/rdsn/src/meta/test/meta_partition_guardian_test.cpp +++ b/src/rdsn/src/meta/test/meta_partition_guardian_test.cpp @@ -27,9 +27,41 @@ #include #include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "common/replication_other_types.h" +#include "common/replication.codes.h" #include "meta/meta_data.h" #include "meta/meta_service.h" diff --git a/src/rdsn/src/meta/test/meta_service_test.cpp b/src/rdsn/src/meta/test/meta_service_test.cpp index fd34ba9094..aa820f845b 100644 --- a/src/rdsn/src/meta/test/meta_service_test.cpp +++ b/src/rdsn/src/meta/test/meta_service_test.cpp @@ -18,8 +18,8 @@ #include "meta_test_base.h" #include "meta/meta_service.h" -#include -#include +#include "utils/fail_point.h" +#include "runtime/rpc/network.sim.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/meta/test/meta_service_test_app.h b/src/rdsn/src/meta/test/meta_service_test_app.h index 9cc0832e90..0307579d43 100644 --- a/src/rdsn/src/meta/test/meta_service_test_app.h +++ b/src/rdsn/src/meta/test/meta_service_test_app.h @@ -26,10 +26,29 @@ #pragma once -#include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "runtime/task/async_calls.h" +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" +#include "meta/meta_service_app.h" #include "meta/server_state.h" #include "meta/meta_service.h" diff --git a/src/rdsn/src/meta/test/meta_split_service_test.cpp b/src/rdsn/src/meta/test/meta_split_service_test.cpp index e72560d239..e6a6f955ff 100644 --- a/src/rdsn/src/meta/test/meta_split_service_test.cpp +++ b/src/rdsn/src/meta/test/meta_split_service_test.cpp @@ -25,9 +25,13 @@ */ #include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/fmt_logging.h" +#include "common/replica_envs.h" #include "meta_service_test_app.h" #include "meta_test_base.h" diff --git a/src/rdsn/src/meta/test/meta_state/main.cpp b/src/rdsn/src/meta/test/meta_state/main.cpp index 0c6995c5a5..01d32c33f9 100644 --- a/src/rdsn/src/meta/test/meta_state/main.cpp +++ b/src/rdsn/src/meta/test/meta_state/main.cpp @@ -41,7 +41,20 @@ #endif #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" int g_test_count = 0; int g_test_ret = 0; diff --git a/src/rdsn/src/meta/test/meta_state/meta_state_service.cpp b/src/rdsn/src/meta/test/meta_state/meta_state_service.cpp index d3488c9946..4b9e3ed37a 100644 --- a/src/rdsn/src/meta/test/meta_state/meta_state_service.cpp +++ b/src/rdsn/src/meta/test/meta_state/meta_state_service.cpp @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include +#include "meta/meta_state_service.h" #include #include diff --git a/src/rdsn/src/meta/test/meta_state_service_utils_test.cpp b/src/rdsn/src/meta/test/meta_state_service_utils_test.cpp index 5c50745bde..200467afa8 100644 --- a/src/rdsn/src/meta/test/meta_state_service_utils_test.cpp +++ b/src/rdsn/src/meta/test/meta_state_service_utils_test.cpp @@ -25,9 +25,24 @@ */ #include -#include +#include "meta/meta_state_service.h" #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "common/replication_other_types.h" +#include "common/replication.codes.h" #include "meta/meta_state_service_utils.h" diff --git a/src/rdsn/src/meta/test/meta_test_base.cpp b/src/rdsn/src/meta/test/meta_test_base.cpp index eded6df16a..b70e649b47 100644 --- a/src/rdsn/src/meta/test/meta_test_base.cpp +++ b/src/rdsn/src/meta/test/meta_test_base.cpp @@ -17,7 +17,7 @@ #include "meta_test_base.h" -#include +#include "utils/fmt_logging.h" #include "meta/server_load_balancer.h" #include "meta/meta_server_failure_detector.h" diff --git a/src/rdsn/src/meta/test/meta_test_base.h b/src/rdsn/src/meta/test/meta_test_base.h index c84d064ce2..566170c745 100644 --- a/src/rdsn/src/meta/test/meta_test_base.h +++ b/src/rdsn/src/meta/test/meta_test_base.h @@ -17,7 +17,13 @@ #include -#include +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" #include "meta/meta_data.h" diff --git a/src/rdsn/src/meta/test/misc/misc.cpp b/src/rdsn/src/meta/test/misc/misc.cpp index ea1e9120fe..b9c4eafdc5 100644 --- a/src/rdsn/src/meta/test/misc/misc.cpp +++ b/src/rdsn/src/meta/test/misc/misc.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include "utils/rand.h" #include "common/replication_common.h" #include "misc.h" diff --git a/src/rdsn/src/meta/test/misc/misc.h b/src/rdsn/src/meta/test/misc/misc.h index bb3328ad0b..af5d916391 100644 --- a/src/rdsn/src/meta/test/misc/misc.h +++ b/src/rdsn/src/meta/test/misc/misc.h @@ -27,8 +27,25 @@ #pragma once #include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" #include "meta/meta_data.h" #include "common/fs_manager.h" diff --git a/src/rdsn/src/meta/test/server_state_restore_test.cpp b/src/rdsn/src/meta/test/server_state_restore_test.cpp index 7dcffd9041..43afcb6483 100644 --- a/src/rdsn/src/meta/test/server_state_restore_test.cpp +++ b/src/rdsn/src/meta/test/server_state_restore_test.cpp @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "common/json_helper.h" +#include "utils/filesystem.h" #include #include "common/backup_common.h" diff --git a/src/rdsn/src/meta/test/server_state_test.cpp b/src/rdsn/src/meta/test/server_state_test.cpp index 384235d79f..256dc2d7da 100644 --- a/src/rdsn/src/meta/test/server_state_test.cpp +++ b/src/rdsn/src/meta/test/server_state_test.cpp @@ -25,7 +25,11 @@ */ #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" #include "meta/meta_service.h" #include "meta/server_state.h" diff --git a/src/rdsn/src/meta/test/state_sync_test.cpp b/src/rdsn/src/meta/test/state_sync_test.cpp index 393fe06d7b..86033ec685 100644 --- a/src/rdsn/src/meta/test/state_sync_test.cpp +++ b/src/rdsn/src/meta/test/state_sync_test.cpp @@ -30,7 +30,20 @@ #include #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" #include "meta/meta_service.h" #include "meta/server_state.h" diff --git a/src/rdsn/src/meta/test/update_configuration_test.cpp b/src/rdsn/src/meta/test/update_configuration_test.cpp index cb27fd023a..b627a32fef 100644 --- a/src/rdsn/src/meta/test/update_configuration_test.cpp +++ b/src/rdsn/src/meta/test/update_configuration_test.cpp @@ -26,9 +26,26 @@ #include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "utils/zlocks.h" #include "meta/meta_service.h" #include "meta/server_state.h" diff --git a/src/rdsn/src/nfs/nfs_client_impl.cpp b/src/rdsn/src/nfs/nfs_client_impl.cpp index 84896423db..a9a14cf862 100644 --- a/src/rdsn/src/nfs/nfs_client_impl.cpp +++ b/src/rdsn/src/nfs/nfs_client_impl.cpp @@ -30,8 +30,8 @@ #include -#include -#include +#include "utils/filesystem.h" +#include "utils/command_manager.h" namespace dsn { namespace service { diff --git a/src/rdsn/src/nfs/nfs_client_impl.h b/src/rdsn/src/nfs/nfs_client_impl.h index 5c80a46a32..6d26b4e20d 100644 --- a/src/rdsn/src/nfs/nfs_client_impl.h +++ b/src/rdsn/src/nfs/nfs_client_impl.h @@ -29,15 +29,15 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "runtime/task/task_tracker.h" +#include "utils/zlocks.h" +#include "perf_counter/perf_counter_wrapper.h" +#include "nfs/nfs_node.h" +#include "utils/defer.h" +#include "utils/TokenBucket.h" +#include "utils/flags.h" +#include "runtime/task/async_calls.h" +#include "utils/token_buckets.h" #include "nfs_types.h" #include "nfs_code_definition.h" diff --git a/src/rdsn/src/nfs/nfs_node.cpp b/src/rdsn/src/nfs/nfs_node.cpp index a7931e0f29..3455ba003b 100644 --- a/src/rdsn/src/nfs/nfs_node.cpp +++ b/src/rdsn/src/nfs/nfs_node.cpp @@ -24,9 +24,9 @@ * THE SOFTWARE. */ -#include -#include -#include +#include "utils/smart_pointers.h" +#include "runtime/task/async_calls.h" +#include "nfs/nfs_node.h" #include "nfs_node_simple.h" diff --git a/src/rdsn/include/dsn/dist/nfs_node.h b/src/rdsn/src/nfs/nfs_node.h similarity index 96% rename from src/rdsn/include/dsn/dist/nfs_node.h rename to src/rdsn/src/nfs/nfs_node.h index 76cf29c168..134c5d5c10 100644 --- a/src/rdsn/include/dsn/dist/nfs_node.h +++ b/src/rdsn/src/nfs/nfs_node.h @@ -28,10 +28,10 @@ #include #include -#include -#include -#include -#include +#include "utils/utils.h" +#include "utils/binary_reader.h" +#include "utils/binary_writer.h" +#include "aio/aio_task.h" namespace dsn { diff --git a/src/rdsn/src/nfs/nfs_node_simple.h b/src/rdsn/src/nfs/nfs_node_simple.h index 90aab9f56c..2f078eab34 100644 --- a/src/rdsn/src/nfs/nfs_node_simple.h +++ b/src/rdsn/src/nfs/nfs_node_simple.h @@ -34,8 +34,8 @@ */ #pragma once -#include -#include +#include "runtime/tool_api.h" +#include "nfs/nfs_node.h" namespace dsn { namespace service { diff --git a/src/rdsn/src/nfs/nfs_server_impl.cpp b/src/rdsn/src/nfs/nfs_server_impl.cpp index b7ea4cd45d..ae41d7f2f3 100644 --- a/src/rdsn/src/nfs/nfs_server_impl.cpp +++ b/src/rdsn/src/nfs/nfs_server_impl.cpp @@ -31,8 +31,8 @@ #include -#include -#include +#include "utils/filesystem.h" +#include "runtime/task/async_calls.h" namespace dsn { namespace service { diff --git a/src/rdsn/src/nfs/nfs_server_impl.h b/src/rdsn/src/nfs/nfs_server_impl.h index 9f0c0bda03..49d8f91b5a 100644 --- a/src/rdsn/src/nfs/nfs_server_impl.h +++ b/src/rdsn/src/nfs/nfs_server_impl.h @@ -25,13 +25,13 @@ */ #pragma once -#include -#include +#include "runtime/task/task_tracker.h" +#include "perf_counter/perf_counter_wrapper.h" #include -#include -#include -#include -#include +#include "runtime/serverlet.h" +#include "utils/flags.h" +#include "utils/command_manager.h" +#include "utils/token_buckets.h" #include "nfs_code_definition.h" #include "nfs_types.h" diff --git a/src/rdsn/src/nfs/test/main.cpp b/src/rdsn/src/nfs/test/main.cpp index 177b6a3e84..68fc10b5bd 100644 --- a/src/rdsn/src/nfs/test/main.cpp +++ b/src/rdsn/src/nfs/test/main.cpp @@ -26,11 +26,15 @@ #include -#include -#include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/filesystem.h" +#include "runtime/task/task.h" +#include "runtime/task/async_calls.h" +#include "nfs/nfs_node.h" using namespace dsn; diff --git a/src/rdsn/src/perf_counter/builtin_counters.cpp b/src/rdsn/src/perf_counter/builtin_counters.cpp index 2ed859119c..0855b1a796 100644 --- a/src/rdsn/src/perf_counter/builtin_counters.cpp +++ b/src/rdsn/src/perf_counter/builtin_counters.cpp @@ -15,10 +15,11 @@ // specific language governing permissions and limitations // under the License. -#include -#include #include "builtin_counters.h" +#include "utils/utils.h" +#include "utils/api_utilities.h" + namespace dsn { builtin_counters::builtin_counters() diff --git a/src/rdsn/src/perf_counter/builtin_counters.h b/src/rdsn/src/perf_counter/builtin_counters.h index 59822716a9..cc49e3af63 100644 --- a/src/rdsn/src/perf_counter/builtin_counters.h +++ b/src/rdsn/src/perf_counter/builtin_counters.h @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include +#include "perf_counter_wrapper.h" namespace dsn { class builtin_counters : public dsn::utils::singleton diff --git a/src/rdsn/src/perf_counter/perf_counter.cpp b/src/rdsn/src/perf_counter/perf_counter.cpp index 7ee5100fe3..302383bb42 100644 --- a/src/rdsn/src/perf_counter/perf_counter.cpp +++ b/src/rdsn/src/perf_counter/perf_counter.cpp @@ -25,7 +25,7 @@ */ #include -#include +#include "perf_counter/perf_counter.h" static const char *ctypes[] = { "NUMBER", "VOLATILE_NUMBER", "RATE", "PERCENTILE", "INVALID_COUNTER"}; diff --git a/src/rdsn/include/dsn/perf_counter/perf_counter.h b/src/rdsn/src/perf_counter/perf_counter.h similarity index 97% rename from src/rdsn/include/dsn/perf_counter/perf_counter.h rename to src/rdsn/src/perf_counter/perf_counter.h index 4c8e8c8c4b..fec74f240f 100644 --- a/src/rdsn/include/dsn/perf_counter/perf_counter.h +++ b/src/rdsn/src/perf_counter/perf_counter.h @@ -26,13 +26,14 @@ #pragma once -#include -#include -#include #include #include #include +#include "utils/enum_helper.h" +#include "utils/autoref_ptr.h" +#include "utils/dlib.h" + typedef enum dsn_perf_counter_type_t { COUNTER_TYPE_NUMBER, COUNTER_TYPE_VOLATILE_NUMBER, // special kind of NUMBER which will be reset on get diff --git a/src/rdsn/src/perf_counter/perf_counter_atomic.h b/src/rdsn/src/perf_counter/perf_counter_atomic.h index d7a820fc44..a21cce8b45 100644 --- a/src/rdsn/src/perf_counter/perf_counter_atomic.h +++ b/src/rdsn/src/perf_counter/perf_counter_atomic.h @@ -17,11 +17,11 @@ #include #include -#include -#include -#include -#include -#include +#include "utils/utils.h" +#include "utils/config_api.h" +#include "utils/api_utilities.h" +#include "perf_counter/perf_counter.h" +#include "utils/time_utils.h" #include "utils/shared_io_service.h" namespace dsn { diff --git a/src/rdsn/include/dsn/perf_counter/perf_counter_utils.h b/src/rdsn/src/perf_counter/perf_counter_utils.h similarity index 95% rename from src/rdsn/include/dsn/perf_counter/perf_counter_utils.h rename to src/rdsn/src/perf_counter/perf_counter_utils.h index 15ce27a6d9..33c2ba6481 100644 --- a/src/rdsn/include/dsn/perf_counter/perf_counter_utils.h +++ b/src/rdsn/src/perf_counter/perf_counter_utils.h @@ -18,8 +18,8 @@ #pragma once #include -#include -#include +#include "common/json_helper.h" +#include "perf_counter/perf_counter.h" namespace dsn { diff --git a/src/rdsn/include/dsn/perf_counter/perf_counter_wrapper.h b/src/rdsn/src/perf_counter/perf_counter_wrapper.h similarity index 97% rename from src/rdsn/include/dsn/perf_counter/perf_counter_wrapper.h rename to src/rdsn/src/perf_counter/perf_counter_wrapper.h index e834995887..26d25e551d 100644 --- a/src/rdsn/include/dsn/perf_counter/perf_counter_wrapper.h +++ b/src/rdsn/src/perf_counter/perf_counter_wrapper.h @@ -26,8 +26,8 @@ #pragma once -#include -#include +#include "perf_counter.h" +#include "perf_counters.h" namespace dsn { diff --git a/src/rdsn/src/perf_counter/perf_counters.cpp b/src/rdsn/src/perf_counter/perf_counters.cpp index 9d47b6542f..f184106d89 100644 --- a/src/rdsn/src/perf_counter/perf_counters.cpp +++ b/src/rdsn/src/perf_counter/perf_counters.cpp @@ -26,21 +26,19 @@ #include -#include -#include -#include +#include "perf_counter.h" -#include -#include - -#include -#include -#include -#include - -#include "perf_counter_atomic.h" #include "builtin_counters.h" +#include "common/json_helper.h" +#include "perf_counter_atomic.h" +#include "perf_counter_utils.h" +#include "perf_counters.h" +#include "runtime/service_app.h" #include "runtime/service_engine.h" +#include "runtime/task/task.h" +#include "utils/command_manager.h" +#include "utils/string_view.h" +#include "utils/time_utils.h" namespace dsn { diff --git a/src/rdsn/include/dsn/perf_counter/perf_counters.h b/src/rdsn/src/perf_counter/perf_counters.h similarity index 97% rename from src/rdsn/include/dsn/perf_counter/perf_counters.h rename to src/rdsn/src/perf_counter/perf_counters.h index c1725d26c9..4ae09d891e 100644 --- a/src/rdsn/include/dsn/perf_counter/perf_counters.h +++ b/src/rdsn/src/perf_counter/perf_counters.h @@ -26,16 +26,17 @@ #pragma once -#include -#include -#include -#include +#include #include -#include #include -#include +#include #include +#include "common/api_common.h" +#include "perf_counter.h" +#include "utils/singleton.h" +#include "utils/synchronize.h" + namespace dsn { /// Registry of all perf counters, users can get/create a specific perf counter diff --git a/src/rdsn/src/perf_counter/test/main.cpp b/src/rdsn/src/perf_counter/test/main.cpp index 1ade1695e4..1e60de841d 100644 --- a/src/rdsn/src/perf_counter/test/main.cpp +++ b/src/rdsn/src/perf_counter/test/main.cpp @@ -16,7 +16,20 @@ // under the License. #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" GTEST_API_ int main(int argc, char **argv) { diff --git a/src/rdsn/src/perf_counter/test/perf_counter_test.cpp b/src/rdsn/src/perf_counter/test/perf_counter_test.cpp index ff9e10486a..81f7246d08 100644 --- a/src/rdsn/src/perf_counter/test/perf_counter_test.cpp +++ b/src/rdsn/src/perf_counter/test/perf_counter_test.cpp @@ -33,7 +33,7 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include +#include "runtime/tool_api.h" #include #include #include diff --git a/src/rdsn/src/perf_counter/test/perf_counters_test.cpp b/src/rdsn/src/perf_counter/test/perf_counters_test.cpp index 9356f597da..f1755f8e0c 100644 --- a/src/rdsn/src/perf_counter/test/perf_counters_test.cpp +++ b/src/rdsn/src/perf_counter/test/perf_counters_test.cpp @@ -33,9 +33,9 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include -#include -#include +#include "perf_counter/perf_counters.h" +#include "perf_counter/perf_counter_wrapper.h" +#include "perf_counter/perf_counter_utils.h" #include using namespace ::dsn; diff --git a/src/rdsn/src/remote_cmd/remote_command.cpp b/src/rdsn/src/remote_cmd/remote_command.cpp index 6c968ed350..30f45ede24 100644 --- a/src/rdsn/src/remote_cmd/remote_command.cpp +++ b/src/rdsn/src/remote_cmd/remote_command.cpp @@ -15,11 +15,11 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include -#include -#include +#include "remote_cmd/remote_command.h" +#include "utils/command_manager.h" +#include "runtime/rpc/rpc_holder.h" +#include "runtime/api_layer1.h" +#include "utils/smart_pointers.h" #include "command_types.h" diff --git a/src/rdsn/include/dsn/dist/remote_command.h b/src/rdsn/src/remote_cmd/remote_command.h similarity index 95% rename from src/rdsn/include/dsn/dist/remote_command.h rename to src/rdsn/src/remote_cmd/remote_command.h index 233e196536..027d5dce26 100644 --- a/src/rdsn/include/dsn/dist/remote_command.h +++ b/src/rdsn/src/remote_cmd/remote_command.h @@ -17,8 +17,8 @@ #pragma once -#include -#include +#include "utils/errors.h" +#include "runtime/task/task.h" namespace dsn { namespace dist { diff --git a/src/rdsn/src/replica/backup/cold_backup_context.cpp b/src/rdsn/src/replica/backup/cold_backup_context.cpp index 40df6afe94..7ed1507452 100644 --- a/src/rdsn/src/replica/backup/cold_backup_context.cpp +++ b/src/rdsn/src/replica/backup/cold_backup_context.cpp @@ -21,7 +21,7 @@ #include "replica/replica_stub.h" #include "block_service/block_service_manager.h" -#include +#include "utils/filesystem.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/backup/cold_backup_context.h b/src/rdsn/src/replica/backup/cold_backup_context.h index 2d1877102c..ae06d647b3 100644 --- a/src/rdsn/src/replica/backup/cold_backup_context.h +++ b/src/rdsn/src/replica/backup/cold_backup_context.h @@ -17,9 +17,9 @@ #pragma once -#include -#include -#include +#include "utils/zlocks.h" +#include "common/json_helper.h" +#include "block_service/block_service.h" #include "common/backup_common.h" diff --git a/src/rdsn/src/replica/backup/replica_backup_manager.cpp b/src/rdsn/src/replica/backup/replica_backup_manager.cpp index b1e81dc251..ebbf48cdd0 100644 --- a/src/rdsn/src/replica/backup/replica_backup_manager.cpp +++ b/src/rdsn/src/replica/backup/replica_backup_manager.cpp @@ -19,9 +19,9 @@ #include "cold_backup_context.h" #include "replica/replica.h" -#include -#include -#include +#include "utils/fmt_logging.h" +#include "utils/filesystem.h" +#include "replica/replication_app_base.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/backup/replica_backup_manager.h b/src/rdsn/src/replica/backup/replica_backup_manager.h index 6c4d26f602..3013b7450c 100644 --- a/src/rdsn/src/replica/backup/replica_backup_manager.h +++ b/src/rdsn/src/replica/backup/replica_backup_manager.h @@ -17,8 +17,14 @@ #pragma once -#include -#include +#include "replica/replica_base.h" +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/backup/replica_backup_server.h b/src/rdsn/src/replica/backup/replica_backup_server.h index abd8316cc5..214c816ef1 100644 --- a/src/rdsn/src/replica/backup/replica_backup_server.h +++ b/src/rdsn/src/replica/backup/replica_backup_server.h @@ -17,8 +17,14 @@ #pragma once -#include -#include +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" +#include "runtime/rpc/rpc_holder.h" #include "common/backup_common.h" diff --git a/src/rdsn/src/replica/backup/test/main.cpp b/src/rdsn/src/replica/backup/test/main.cpp index ab7851b9a6..ca99692d0c 100644 --- a/src/rdsn/src/replica/backup/test/main.cpp +++ b/src/rdsn/src/replica/backup/test/main.cpp @@ -17,7 +17,20 @@ #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" int g_test_count = 0; int g_test_ret = 0; diff --git a/src/rdsn/src/replica/bulk_load/replica_bulk_loader.cpp b/src/rdsn/src/replica/bulk_load/replica_bulk_loader.cpp index d63e79ca9e..9b16f54bf4 100644 --- a/src/rdsn/src/replica/bulk_load/replica_bulk_loader.cpp +++ b/src/rdsn/src/replica/bulk_load/replica_bulk_loader.cpp @@ -15,11 +15,11 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include -#include -#include +#include "block_service/block_service.h" +#include "utils/fmt_logging.h" +#include "replica/replication_app_base.h" +#include "utils/fail_point.h" +#include "utils/filesystem.h" #include "replica_bulk_loader.h" #include "replica/disk_cleaner.h" diff --git a/src/rdsn/src/replica/bulk_load/replica_bulk_loader.h b/src/rdsn/src/replica/bulk_load/replica_bulk_loader.h index e6ae2a9fe4..62e9e70064 100644 --- a/src/rdsn/src/replica/bulk_load/replica_bulk_loader.h +++ b/src/rdsn/src/replica/bulk_load/replica_bulk_loader.h @@ -17,7 +17,7 @@ #pragma once -#include +#include "utils/zlocks.h" #include "replica/replica.h" #include "replica/replica_context.h" diff --git a/src/rdsn/src/replica/bulk_load/test/main.cpp b/src/rdsn/src/replica/bulk_load/test/main.cpp index ab7851b9a6..ca99692d0c 100644 --- a/src/rdsn/src/replica/bulk_load/test/main.cpp +++ b/src/rdsn/src/replica/bulk_load/test/main.cpp @@ -17,7 +17,20 @@ #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" int g_test_count = 0; int g_test_ret = 0; diff --git a/src/rdsn/src/replica/bulk_load/test/replica_bulk_loader_test.cpp b/src/rdsn/src/replica/bulk_load/test/replica_bulk_loader_test.cpp index 9eef79c264..7775e3f988 100644 --- a/src/rdsn/src/replica/bulk_load/test/replica_bulk_loader_test.cpp +++ b/src/rdsn/src/replica/bulk_load/test/replica_bulk_loader_test.cpp @@ -20,8 +20,8 @@ #include -#include -#include +#include "utils/zlocks.h" +#include "utils/fail_point.h" #include namespace dsn { diff --git a/src/rdsn/src/replica/disk_cleaner.cpp b/src/rdsn/src/replica/disk_cleaner.cpp index 8858e9166c..f54b22f511 100644 --- a/src/rdsn/src/replica/disk_cleaner.cpp +++ b/src/rdsn/src/replica/disk_cleaner.cpp @@ -17,10 +17,10 @@ * under the License. */ -#include -#include -#include -#include +#include "utils/flags.h" +#include "utils/filesystem.h" +#include "utils/fmt_logging.h" +#include "runtime/api_layer1.h" #include "disk_cleaner.h" diff --git a/src/rdsn/src/replica/disk_cleaner.h b/src/rdsn/src/replica/disk_cleaner.h index cc9a38e1cf..86d3f82ccb 100644 --- a/src/rdsn/src/replica/disk_cleaner.h +++ b/src/rdsn/src/replica/disk_cleaner.h @@ -19,8 +19,8 @@ #pragma once #include -#include -#include +#include "utils/errors.h" +#include "perf_counter/perf_counter_wrapper.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/duplication/duplication_pipeline.cpp b/src/rdsn/src/replica/duplication/duplication_pipeline.cpp index 1597a61739..060d025d61 100644 --- a/src/rdsn/src/replica/duplication/duplication_pipeline.cpp +++ b/src/rdsn/src/replica/duplication/duplication_pipeline.cpp @@ -17,8 +17,8 @@ #include "duplication_pipeline.h" -#include -#include +#include "replica/replication_app_base.h" +#include "utils/fmt_logging.h" #include "replica/replica_stub.h" #include "load_from_private_log.h" diff --git a/src/rdsn/src/replica/duplication/duplication_pipeline.h b/src/rdsn/src/replica/duplication/duplication_pipeline.h index 8365086273..9d789b7b2b 100644 --- a/src/rdsn/src/replica/duplication/duplication_pipeline.h +++ b/src/rdsn/src/replica/duplication/duplication_pipeline.h @@ -17,12 +17,11 @@ #pragma once -#include -#include -#include - +#include "replica/replica_base.h" #include "replica/replica.h" #include "replica_duplicator.h" +#include "replica/duplication/mutation_duplicator.h" +#include "runtime/pipeline.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/duplication/duplication_sync_timer.cpp b/src/rdsn/src/replica/duplication/duplication_sync_timer.cpp index f70cc9141a..361bfb9874 100644 --- a/src/rdsn/src/replica/duplication/duplication_sync_timer.cpp +++ b/src/rdsn/src/replica/duplication/duplication_sync_timer.cpp @@ -21,10 +21,10 @@ #include "duplication_sync_timer.h" #include "replica_duplicator_manager.h" -#include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "utils/command_manager.h" +#include "utils/output_utils.h" +#include "utils/string_conv.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/duplication/duplication_sync_timer.h b/src/rdsn/src/replica/duplication/duplication_sync_timer.h index c782775cad..c30c7e01d6 100644 --- a/src/rdsn/src/replica/duplication/duplication_sync_timer.h +++ b/src/rdsn/src/replica/duplication/duplication_sync_timer.h @@ -21,8 +21,8 @@ #include "replica/replica_stub.h" -#include -#include +#include "common//duplication_common.h" +#include "utils/chrono_literals.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/duplication/load_from_private_log.cpp b/src/rdsn/src/replica/duplication/load_from_private_log.cpp index 9046591635..8af6145a16 100644 --- a/src/rdsn/src/replica/duplication/load_from_private_log.cpp +++ b/src/rdsn/src/replica/duplication/load_from_private_log.cpp @@ -15,14 +15,14 @@ // specific language governing permissions and limitations // under the License. -#include +#include "utils/fmt_logging.h" #include "replica/replica_stub.h" #include "replica/replica.h" #include "replica/mutation_log_utils.h" #include "load_from_private_log.h" #include "replica_duplicator.h" -#include +#include "utils/fail_point.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/duplication/load_from_private_log.h b/src/rdsn/src/replica/duplication/load_from_private_log.h index ada3c5d354..da679bbc60 100644 --- a/src/rdsn/src/replica/duplication/load_from_private_log.h +++ b/src/rdsn/src/replica/duplication/load_from_private_log.h @@ -17,13 +17,13 @@ #pragma once -#include -#include -#include #include -#include "replica/mutation_log.h" #include "mutation_batch.h" +#include "runtime/pipeline.h" +#include "replica/duplication/mutation_duplicator.h" +#include "replica/mutation_log.h" +#include "utils/errors.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/duplication/mutation_batch.cpp b/src/rdsn/src/replica/duplication/mutation_batch.cpp index 473ec7e1e6..415006f187 100644 --- a/src/rdsn/src/replica/duplication/mutation_batch.cpp +++ b/src/rdsn/src/replica/duplication/mutation_batch.cpp @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "utils/fmt_logging.h" +#include "runtime/message_utils.h" #include "replica_duplicator.h" #include "mutation_batch.h" diff --git a/src/rdsn/src/replica/duplication/mutation_batch.h b/src/rdsn/src/replica/duplication/mutation_batch.h index 5eaf700446..4e3fa088f2 100644 --- a/src/rdsn/src/replica/duplication/mutation_batch.h +++ b/src/rdsn/src/replica/duplication/mutation_batch.h @@ -17,8 +17,8 @@ #pragma once -#include -#include +#include "perf_counter/perf_counter_wrapper.h" +#include "replica/duplication/mutation_duplicator.h" #include "replica/mutation.h" #include "replica/prepare_list.h" diff --git a/src/rdsn/include/dsn/dist/replication/mutation_duplicator.h b/src/rdsn/src/replica/duplication/mutation_duplicator.h similarity index 90% rename from src/rdsn/include/dsn/dist/replication/mutation_duplicator.h rename to src/rdsn/src/replica/duplication/mutation_duplicator.h index 2b5d4b5d04..a5b3a4df67 100644 --- a/src/rdsn/include/dsn/dist/replication/mutation_duplicator.h +++ b/src/rdsn/src/replica/duplication/mutation_duplicator.h @@ -17,10 +17,16 @@ #pragma once -#include -#include -#include -#include +#include "utils/errors.h" +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" +#include "replica/replica_base.h" +#include "runtime/pipeline.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/duplication/replica_duplicator.cpp b/src/rdsn/src/replica/duplication/replica_duplicator.cpp index c6d7704491..d0b1eea67c 100644 --- a/src/rdsn/src/replica/duplication/replica_duplicator.cpp +++ b/src/rdsn/src/replica/duplication/replica_duplicator.cpp @@ -20,8 +20,8 @@ #include "duplication_pipeline.h" #include "replica/replica_stub.h" -#include -#include +#include "replica/replication_app_base.h" +#include "utils/fmt_logging.h" #include namespace dsn { diff --git a/src/rdsn/src/replica/duplication/replica_duplicator.h b/src/rdsn/src/replica/duplication/replica_duplicator.h index 2f5d20a3fb..a30e38a73f 100644 --- a/src/rdsn/src/replica/duplication/replica_duplicator.h +++ b/src/rdsn/src/replica/duplication/replica_duplicator.h @@ -17,11 +17,26 @@ #pragma once -#include -#include -#include -#include -#include +#include "common//duplication_common.h" +#include "runtime/pipeline.h" +#include "replica/replica_base.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "common/replication_other_types.h" +#include "common/replication.codes.h" +#include "utils/zlocks.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/duplication/replica_duplicator_manager.cpp b/src/rdsn/src/replica/duplication/replica_duplicator_manager.cpp index 95d89c38cf..5310dc7a72 100644 --- a/src/rdsn/src/replica/duplication/replica_duplicator_manager.cpp +++ b/src/rdsn/src/replica/duplication/replica_duplicator_manager.cpp @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "common//duplication_common.h" +#include "utils/fmt_logging.h" #include "replica_duplicator_manager.h" diff --git a/src/rdsn/src/replica/duplication/replica_duplicator_manager.h b/src/rdsn/src/replica/duplication/replica_duplicator_manager.h index 5cd00ba4b8..b47bf8f8e5 100644 --- a/src/rdsn/src/replica/duplication/replica_duplicator_manager.h +++ b/src/rdsn/src/replica/duplication/replica_duplicator_manager.h @@ -19,8 +19,14 @@ #include "replica_duplicator.h" -#include -#include +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" +#include "common//duplication_common.h" #include "replica/replica.h" #include "replica/mutation_log.h" diff --git a/src/rdsn/src/replica/duplication/replica_follower.cpp b/src/rdsn/src/replica/duplication/replica_follower.cpp index 26eda8a347..aa9c30738e 100644 --- a/src/rdsn/src/replica/duplication/replica_follower.cpp +++ b/src/rdsn/src/replica/duplication/replica_follower.cpp @@ -19,13 +19,13 @@ #include "replica_follower.h" #include "replica/replica_stub.h" -#include "dsn/utility/filesystem.h" -#include "dsn/dist/replication/duplication_common.h" +#include "utils/filesystem.h" +#include "common/duplication_common.h" #include -#include -#include -#include +#include "runtime/rpc/group_address.h" +#include "nfs/nfs_node.h" +#include "utils/fail_point.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/duplication/test/duplication_sync_timer_test.cpp b/src/rdsn/src/replica/duplication/test/duplication_sync_timer_test.cpp index a4265a28b3..0fffd82358 100644 --- a/src/rdsn/src/replica/duplication/test/duplication_sync_timer_test.cpp +++ b/src/rdsn/src/replica/duplication/test/duplication_sync_timer_test.cpp @@ -18,8 +18,8 @@ #include "replica/duplication/duplication_sync_timer.h" #include "duplication_test_base.h" -#include -#include +#include "utils/command_manager.h" +#include "runtime/rpc/rpc_message.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/duplication/test/load_from_private_log_test.cpp b/src/rdsn/src/replica/duplication/test/load_from_private_log_test.cpp index e6c471806a..788e979021 100644 --- a/src/rdsn/src/replica/duplication/test/load_from_private_log_test.cpp +++ b/src/rdsn/src/replica/duplication/test/load_from_private_log_test.cpp @@ -15,9 +15,9 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include +#include "utils/fmt_logging.h" +#include "utils/defer.h" +#include "utils/fail_point.h" #define BOOST_NO_CXX11_SCOPED_ENUMS #include diff --git a/src/rdsn/src/replica/duplication/test/main.cpp b/src/rdsn/src/replica/duplication/test/main.cpp index ab7851b9a6..ca99692d0c 100644 --- a/src/rdsn/src/replica/duplication/test/main.cpp +++ b/src/rdsn/src/replica/duplication/test/main.cpp @@ -17,7 +17,20 @@ #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" int g_test_count = 0; int g_test_ret = 0; diff --git a/src/rdsn/src/replica/duplication/test/replica_duplicator_test.cpp b/src/rdsn/src/replica/duplication/test/replica_duplicator_test.cpp index 171bf3c2c5..ddd8633f22 100644 --- a/src/rdsn/src/replica/duplication/test/replica_duplicator_test.cpp +++ b/src/rdsn/src/replica/duplication/test/replica_duplicator_test.cpp @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include +#include "utils/filesystem.h" #include "replica/mutation_log_utils.h" #include "replica/duplication/load_from_private_log.h" diff --git a/src/rdsn/src/replica/duplication/test/replica_follower_test.cpp b/src/rdsn/src/replica/duplication/test/replica_follower_test.cpp index 96de3f5a15..eca1c05d46 100644 --- a/src/rdsn/src/replica/duplication/test/replica_follower_test.cpp +++ b/src/rdsn/src/replica/duplication/test/replica_follower_test.cpp @@ -15,9 +15,9 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include +#include "utils/filesystem.h" +#include "utils/fmt_logging.h" +#include "utils/fail_point.h" #include "replica/duplication/replica_follower.h" #include "duplication_test_base.h" diff --git a/src/rdsn/src/replica/log_file.cpp b/src/rdsn/src/replica/log_file.cpp index 6b41a1d46c..d7ac51d297 100644 --- a/src/rdsn/src/replica/log_file.cpp +++ b/src/rdsn/src/replica/log_file.cpp @@ -28,9 +28,9 @@ #include -#include -#include -#include +#include "utils/filesystem.h" +#include "utils/crc.h" +#include "utils/fmt_logging.h" #include "log_file_stream.h" diff --git a/src/rdsn/src/replica/log_file.h b/src/rdsn/src/replica/log_file.h index 6219b5dcc6..772522754c 100644 --- a/src/rdsn/src/replica/log_file.h +++ b/src/rdsn/src/replica/log_file.h @@ -28,7 +28,7 @@ #include "log_block.h" -#include +#include "utils/zlocks.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/mutation.cpp b/src/rdsn/src/replica/mutation.cpp index d66ed218ca..85e4c3e8aa 100644 --- a/src/rdsn/src/replica/mutation.cpp +++ b/src/rdsn/src/replica/mutation.cpp @@ -36,8 +36,8 @@ #include "mutation.h" #include "mutation_log.h" #include "replica.h" -#include -#include +#include "utils/fmt_logging.h" +#include "utils/flags.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/mutation.h b/src/rdsn/src/replica/mutation.h index dab299cd32..00ec7a722e 100644 --- a/src/rdsn/src/replica/mutation.h +++ b/src/rdsn/src/replica/mutation.h @@ -38,8 +38,8 @@ #include "common/replication_common.h" #include #include -#include -#include +#include "utils/link.h" +#include "utils/latency_tracer.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/mutation_log.cpp b/src/rdsn/src/replica/mutation_log.cpp index 675aa67220..bf26b4b7d0 100644 --- a/src/rdsn/src/replica/mutation_log.cpp +++ b/src/rdsn/src/replica/mutation_log.cpp @@ -28,13 +28,13 @@ #include "replica.h" #include "mutation_log_utils.h" -#include -#include -#include -#include -#include -#include -#include +#include "utils/latency_tracer.h" +#include "utils/filesystem.h" +#include "utils/crc.h" +#include "utils/defer.h" +#include "utils/fail_point.h" +#include "utils/fmt_logging.h" +#include "runtime/task/async_calls.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/mutation_log.h b/src/rdsn/src/replica/mutation_log.h index 829135e2c2..859d83ff64 100644 --- a/src/rdsn/src/replica/mutation_log.h +++ b/src/rdsn/src/replica/mutation_log.h @@ -32,10 +32,10 @@ #include "log_file.h" #include -#include -#include -#include -#include +#include "utils/zlocks.h" +#include "utils/errors.h" +#include "perf_counter/perf_counter_wrapper.h" +#include "replica/replica_base.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/mutation_log_replay.cpp b/src/rdsn/src/replica/mutation_log_replay.cpp index 548bc1bebd..edae4a248b 100644 --- a/src/rdsn/src/replica/mutation_log_replay.cpp +++ b/src/rdsn/src/replica/mutation_log_replay.cpp @@ -17,9 +17,9 @@ #include "mutation_log.h" #include "mutation_log_utils.h" -#include -#include -#include +#include "utils/fail_point.h" +#include "utils/errors.h" +#include "utils/fmt_logging.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/mutation_log_utils.cpp b/src/rdsn/src/replica/mutation_log_utils.cpp index 96a6134839..c1cc41e957 100644 --- a/src/rdsn/src/replica/mutation_log_utils.cpp +++ b/src/rdsn/src/replica/mutation_log_utils.cpp @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#include -#include +#include "utils/fmt_logging.h" +#include "utils/fail_point.h" #include "mutation_log_utils.h" diff --git a/src/rdsn/src/replica/mutation_log_utils.h b/src/rdsn/src/replica/mutation_log_utils.h index ca633e11cd..1088d7dc03 100644 --- a/src/rdsn/src/replica/mutation_log_utils.h +++ b/src/rdsn/src/replica/mutation_log_utils.h @@ -26,9 +26,9 @@ #pragma once -#include -#include -#include +#include "utils/errors.h" +#include "utils/filesystem.h" +#include "utils/fmt_logging.h" #include "mutation_log.h" diff --git a/src/rdsn/src/replica/prepare_list.cpp b/src/rdsn/src/replica/prepare_list.cpp index dd2fbd8fc4..01fd09c32c 100644 --- a/src/rdsn/src/replica/prepare_list.cpp +++ b/src/rdsn/src/replica/prepare_list.cpp @@ -26,8 +26,8 @@ #include "prepare_list.h" -#include -#include +#include "utils/latency_tracer.h" +#include "utils/fmt_logging.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/prepare_list.h b/src/rdsn/src/replica/prepare_list.h index 58ce547f90..9a573dfba2 100644 --- a/src/rdsn/src/replica/prepare_list.h +++ b/src/rdsn/src/replica/prepare_list.h @@ -28,7 +28,7 @@ #include "mutation_cache.h" -#include +#include "replica/replica_base.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/replica.cpp b/src/rdsn/src/replica/replica.cpp index 164c12b0e8..7babd81ade 100644 --- a/src/rdsn/src/replica/replica.cpp +++ b/src/rdsn/src/replica/replica.cpp @@ -37,16 +37,16 @@ #include "replica_disk_migrator.h" #include "runtime/security/access_controller.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "utils/latency_tracer.h" +#include "common/json_helper.h" +#include "replica/replication_app_base.h" +#include "common/replica_envs.h" +#include "utils/fmt_logging.h" +#include "utils/filesystem.h" +#include "utils/rand.h" +#include "utils/string_conv.h" +#include "utils/strings.h" +#include "runtime/rpc/rpc_message.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/replica.h b/src/rdsn/src/replica/replica.h index e17d1faa80..7c578f200f 100644 --- a/src/rdsn/src/replica/replica.h +++ b/src/rdsn/src/replica/replica.h @@ -42,12 +42,12 @@ // which is binded to this replication partition // -#include -#include -#include +#include "utils/uniq_timestamp_us.h" +#include "utils/thread_access_checker.h" +#include "runtime/serverlet.h" -#include -#include +#include "perf_counter/perf_counter_wrapper.h" +#include "replica/replica_base.h" #include "common/replication_common.h" #include "mutation.h" diff --git a/src/rdsn/src/replica/replica_2pc.cpp b/src/rdsn/src/replica/replica_2pc.cpp index 124bf5662f..e9bd848cee 100644 --- a/src/rdsn/src/replica/replica_2pc.cpp +++ b/src/rdsn/src/replica/replica_2pc.cpp @@ -31,9 +31,9 @@ #include "bulk_load/replica_bulk_loader.h" #include "split/replica_split_manager.h" #include "runtime/security/access_controller.h" -#include -#include -#include +#include "utils/latency_tracer.h" +#include "replica/replication_app_base.h" +#include "utils/fmt_logging.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/replica_backup.cpp b/src/rdsn/src/replica/replica_backup.cpp index 2268fe5936..8293af1887 100644 --- a/src/rdsn/src/replica/replica_backup.cpp +++ b/src/rdsn/src/replica/replica_backup.cpp @@ -17,11 +17,11 @@ #include -#include -#include -#include -#include -#include +#include "utils/filesystem.h" +#include "utils/time_utils.h" +#include "utils/fmt_logging.h" +#include "replica/replication_app_base.h" +#include "utils/flags.h" #include "block_service/block_service_manager.h" #include "backup/replica_backup_manager.h" diff --git a/src/rdsn/include/dsn/dist/replication/replica_base.h b/src/rdsn/src/replica/replica_base.h similarity index 96% rename from src/rdsn/include/dsn/dist/replication/replica_base.h rename to src/rdsn/src/replica/replica_base.h index 36fb87ddc5..07d1814855 100644 --- a/src/rdsn/include/dsn/dist/replication/replica_base.h +++ b/src/rdsn/src/replica/replica_base.h @@ -26,8 +26,8 @@ #pragma once -#include -#include +#include "common/gpid.h" +#include "utils/string_view.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/replica_check.cpp b/src/rdsn/src/replica/replica_check.cpp index 136ac933a2..e4c8d4715b 100644 --- a/src/rdsn/src/replica/replica_check.cpp +++ b/src/rdsn/src/replica/replica_check.cpp @@ -41,9 +41,9 @@ #include "duplication/replica_duplicator_manager.h" #include "split/replica_split_manager.h" -#include -#include -#include +#include "utils/fmt_logging.h" +#include "replica/replication_app_base.h" +#include "utils/fail_point.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/replica_chkpt.cpp b/src/rdsn/src/replica/replica_chkpt.cpp index 25543e506c..20ac35bac8 100644 --- a/src/rdsn/src/replica/replica_chkpt.cpp +++ b/src/rdsn/src/replica/replica_chkpt.cpp @@ -39,11 +39,11 @@ #include "replica_stub.h" #include "duplication/replica_duplicator_manager.h" #include "split/replica_split_manager.h" -#include "dsn/utility/fail_point.h" -#include -#include -#include -#include +#include "utils/fail_point.h" +#include "utils/filesystem.h" +#include "utils/chrono_literals.h" +#include "replica/replication_app_base.h" +#include "utils/fmt_logging.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/replica_config.cpp b/src/rdsn/src/replica/replica_config.cpp index 4ea4727d9d..a9f33ed793 100644 --- a/src/rdsn/src/replica/replica_config.cpp +++ b/src/rdsn/src/replica/replica_config.cpp @@ -41,11 +41,11 @@ #include "bulk_load/replica_bulk_loader.h" #include "runtime/security/access_controller.h" #include "split/replica_split_manager.h" -#include -#include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "replica/replication_app_base.h" +#include "utils/fail_point.h" +#include "utils/string_conv.h" +#include "common/replica_envs.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/replica_context.cpp b/src/rdsn/src/replica/replica_context.cpp index 080c923549..9d7cec2d05 100644 --- a/src/rdsn/src/replica/replica_context.cpp +++ b/src/rdsn/src/replica/replica_context.cpp @@ -33,8 +33,8 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include -#include +#include "utils/filesystem.h" +#include "utils/utils.h" #include "replica_context.h" #include "replica.h" diff --git a/src/rdsn/src/replica/replica_context.h b/src/rdsn/src/replica/replica_context.h index 6f4984d268..37b3760f76 100644 --- a/src/rdsn/src/replica/replica_context.h +++ b/src/rdsn/src/replica/replica_context.h @@ -26,9 +26,9 @@ #pragma once -#include -#include -#include +#include "utils/zlocks.h" +#include "block_service/block_service.h" +#include "common/json_helper.h" #include "mutation.h" diff --git a/src/rdsn/src/replica/replica_disk_migrator.cpp b/src/rdsn/src/replica/replica_disk_migrator.cpp index f2ecaf7ffc..21a5ba23bb 100644 --- a/src/rdsn/src/replica/replica_disk_migrator.cpp +++ b/src/rdsn/src/replica/replica_disk_migrator.cpp @@ -21,10 +21,10 @@ #include "replica_disk_migrator.h" #include -#include -#include -#include -#include +#include "utils/filesystem.h" +#include "utils/fmt_logging.h" +#include "replica/replication_app_base.h" +#include "utils/fail_point.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/replica_http_service.cpp b/src/rdsn/src/replica/replica_http_service.cpp index 1152cd62a2..5c1965781e 100644 --- a/src/rdsn/src/replica/replica_http_service.cpp +++ b/src/rdsn/src/replica/replica_http_service.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include "utils/output_utils.h" #include "replica_http_service.h" #include "duplication/duplication_sync_timer.h" diff --git a/src/rdsn/src/replica/replica_http_service.h b/src/rdsn/src/replica/replica_http_service.h index 6e01a35849..6e594062d4 100644 --- a/src/rdsn/src/replica/replica_http_service.h +++ b/src/rdsn/src/replica/replica_http_service.h @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include +#include "http/http_server.h" #include "replica_stub.h" diff --git a/src/rdsn/src/replica/replica_init.cpp b/src/rdsn/src/replica/replica_init.cpp index 56957e2136..2ee5a00f61 100644 --- a/src/rdsn/src/replica/replica_init.cpp +++ b/src/rdsn/src/replica/replica_init.cpp @@ -30,11 +30,11 @@ #include "replica_stub.h" #include "backup/replica_backup_manager.h" #include "duplication/replica_follower.h" -#include -#include -#include -#include -#include +#include "utils/factory_store.h" +#include "utils/filesystem.h" +#include "replica/replication_app_base.h" +#include "utils/fmt_logging.h" +#include "utils/fail_point.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/replica_learn.cpp b/src/rdsn/src/replica/replica_learn.cpp index 28571cb71d..f4e7a7d9cc 100644 --- a/src/rdsn/src/replica/replica_learn.cpp +++ b/src/rdsn/src/replica/replica_learn.cpp @@ -39,9 +39,9 @@ #include "replica_stub.h" #include "replica/duplication/replica_duplicator_manager.h" -#include -#include -#include +#include "utils/filesystem.h" +#include "replica/replication_app_base.h" +#include "utils/fmt_logging.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/replica_restore.cpp b/src/rdsn/src/replica/replica_restore.cpp index 0b473366e0..6d0b4773fc 100644 --- a/src/rdsn/src/replica/replica_restore.cpp +++ b/src/rdsn/src/replica/replica_restore.cpp @@ -18,13 +18,13 @@ #include #include -#include -#include -#include -#include +#include "utils/error_code.h" +#include "utils/factory_store.h" +#include "utils/filesystem.h" +#include "utils/utils.h" -#include -#include +#include "replica/replication_app_base.h" +#include "utils/fmt_logging.h" #include "replica.h" #include "mutation_log.h" diff --git a/src/rdsn/src/replica/replica_stub.cpp b/src/rdsn/src/replica/replica_stub.cpp index b85722c56a..60872628ba 100644 --- a/src/rdsn/src/replica/replica_stub.cpp +++ b/src/rdsn/src/replica/replica_stub.cpp @@ -45,23 +45,23 @@ #include "disk_cleaner.h" #include -#include -#include -#include -#include -#include -#include -#include +#include "common/json_helper.h" +#include "utils/filesystem.h" +#include "utils/rand.h" +#include "utils/string_conv.h" +#include "utils/command_manager.h" +#include "replica/replication_app_base.h" +#include "utils/enum_helper.h" #include #include -#include +#include "utils/fmt_logging.h" #ifdef DSN_ENABLE_GPERF #include #elif defined(DSN_USE_JEMALLOC) #include "utils/je_ctl.h" #endif -#include -#include +#include "utils/fail_point.h" +#include "remote_cmd/remote_command.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/replica_stub.h b/src/rdsn/src/replica/replica_stub.h index 0db8bc10ad..e0c4b38236 100644 --- a/src/rdsn/src/replica/replica_stub.h +++ b/src/rdsn/src/replica/replica_stub.h @@ -34,9 +34,9 @@ #include #include -#include -#include -#include +#include "perf_counter/perf_counter_wrapper.h" +#include "failure_detector/failure_detector_multimaster.h" +#include "nfs/nfs_node.h" #include "common/replication_common.h" #include "common/bulk_load_common.h" diff --git a/src/rdsn/src/replica/replica_test_utils.cpp b/src/rdsn/src/replica/replica_test_utils.cpp index 5d8f9a0b27..990dc857c7 100644 --- a/src/rdsn/src/replica/replica_test_utils.cpp +++ b/src/rdsn/src/replica/replica_test_utils.cpp @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include +#include "replica/replica_test_utils.h" #include "replica.h" #include "replica_stub.h" diff --git a/src/rdsn/include/dsn/dist/replication/replica_test_utils.h b/src/rdsn/src/replica/replica_test_utils.h similarity index 97% rename from src/rdsn/include/dsn/dist/replication/replica_test_utils.h rename to src/rdsn/src/replica/replica_test_utils.h index 0221a752f5..09447d804a 100644 --- a/src/rdsn/include/dsn/dist/replication/replica_test_utils.h +++ b/src/rdsn/src/replica/replica_test_utils.h @@ -27,7 +27,7 @@ /// This file contains utilities for upper level applications (pegasus) which /// needs the hidden abstraction of rDSN in order to make unit test. -#include +#include "common/serialization_helper/dsn.layer2_types.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/replica_throttle.cpp b/src/rdsn/src/replica/replica_throttle.cpp index b25a994924..301cba73f0 100644 --- a/src/rdsn/src/replica/replica_throttle.cpp +++ b/src/rdsn/src/replica/replica_throttle.cpp @@ -20,9 +20,9 @@ #include "mutation_log.h" #include "replica_stub.h" -#include -#include -#include +#include "replica/replication_app_base.h" +#include "utils/fmt_logging.h" +#include "common/replica_envs.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/replication_app_base.cpp b/src/rdsn/src/replica/replication_app_base.cpp index 0a717f498b..02dee9b745 100644 --- a/src/rdsn/src/replica/replication_app_base.cpp +++ b/src/rdsn/src/replica/replication_app_base.cpp @@ -27,20 +27,24 @@ #include "replica.h" #include "mutation.h" #include "common/bulk_load_common.h" -#include "dsn/dist/replication/duplication_common.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include "common/duplication_common.h" +#include "utils/latency_tracer.h" +#include "utils/fmt_logging.h" +#include "replica/replication_app_base.h" +#include "utils/defer.h" +#include "utils/factory_store.h" +#include "utils/filesystem.h" +#include "utils/crc.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" #include #include #include -#include -#include +#include "utils/fail_point.h" +#include "common/replica_envs.h" namespace dsn { namespace replication { diff --git a/src/rdsn/include/dsn/dist/replication/replication_app_base.h b/src/rdsn/src/replica/replication_app_base.h similarity index 96% rename from src/rdsn/include/dsn/dist/replication/replication_app_base.h rename to src/rdsn/src/replica/replication_app_base.h index 6392a30146..3b8cc2edb9 100644 --- a/src/rdsn/include/dsn/dist/replication/replication_app_base.h +++ b/src/rdsn/src/replica/replication_app_base.h @@ -26,12 +26,18 @@ #pragma once -#include -#include -#include -#include -#include -#include +#include "runtime/serverlet.h" +#include "common/json_helper.h" +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" +#include "common/replication_other_types.h" +#include "common/replication.codes.h" +#include "replica/replica_base.h" #include namespace dsn { diff --git a/src/rdsn/src/replica/replication_service_app.cpp b/src/rdsn/src/replica/replication_service_app.cpp index bef5b6e65e..36701f7234 100644 --- a/src/rdsn/src/replica/replication_service_app.cpp +++ b/src/rdsn/src/replica/replication_service_app.cpp @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#include -#include +#include "replica/replication_service_app.h" +#include "http/http_server.h" #include "common/replication_common.h" #include "replica_stub.h" diff --git a/src/rdsn/include/dsn/dist/replication/replication_service_app.h b/src/rdsn/src/replica/replication_service_app.h similarity index 89% rename from src/rdsn/include/dsn/dist/replication/replication_service_app.h rename to src/rdsn/src/replica/replication_service_app.h index e6e98eac7f..2174ccb2de 100644 --- a/src/rdsn/include/dsn/dist/replication/replication_service_app.h +++ b/src/rdsn/src/replica/replication_service_app.h @@ -24,19 +24,10 @@ * THE SOFTWARE. */ -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * xxxx-xx-xx, author, fix bug about xxx - */ - #pragma once -#include -#include +#include "utils/autoref_ptr.h" +#include "runtime/service_app.h" namespace dsn { diff --git a/src/rdsn/src/replica/split/replica_split_manager.cpp b/src/rdsn/src/replica/split/replica_split_manager.cpp index 506bf625cc..22d925d476 100644 --- a/src/rdsn/src/replica/split/replica_split_manager.cpp +++ b/src/rdsn/src/replica/split/replica_split_manager.cpp @@ -18,11 +18,11 @@ #include "replica_split_manager.h" #include "common/partition_split_common.h" -#include -#include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "replica/replication_app_base.h" +#include "utils/defer.h" +#include "utils/filesystem.h" +#include "utils/fail_point.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/split/test/main.cpp b/src/rdsn/src/replica/split/test/main.cpp index ab7851b9a6..ca99692d0c 100644 --- a/src/rdsn/src/replica/split/test/main.cpp +++ b/src/rdsn/src/replica/split/test/main.cpp @@ -17,7 +17,20 @@ #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" int g_test_count = 0; int g_test_ret = 0; diff --git a/src/rdsn/src/replica/split/test/replica_split_test.cpp b/src/rdsn/src/replica/split/test/replica_split_test.cpp index d449d76768..a544a3e42b 100644 --- a/src/rdsn/src/replica/split/test/replica_split_test.cpp +++ b/src/rdsn/src/replica/split/test/replica_split_test.cpp @@ -19,7 +19,7 @@ #include "replica/test/replica_test_base.h" #include -#include +#include "utils/fail_point.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/storage/simple_kv/simple_kv.client.h b/src/rdsn/src/replica/storage/simple_kv/simple_kv.client.h index ff951c0b32..0825f712f5 100644 --- a/src/rdsn/src/replica/storage/simple_kv/simple_kv.client.h +++ b/src/rdsn/src/replica/storage/simple_kv/simple_kv.client.h @@ -26,9 +26,9 @@ #pragma once #include -#include -#include -#include +#include "utils/optional.h" +#include "runtime/task/async_calls.h" +#include "client/partition_resolver.h" #include "simple_kv.code.definition.h" #include "simple_kv_types.h" diff --git a/src/rdsn/src/replica/storage/simple_kv/simple_kv.code.definition.h b/src/rdsn/src/replica/storage/simple_kv/simple_kv.code.definition.h index 41b624c8a4..ef56ab767c 100644 --- a/src/rdsn/src/replica/storage/simple_kv/simple_kv.code.definition.h +++ b/src/rdsn/src/replica/storage/simple_kv/simple_kv.code.definition.h @@ -34,7 +34,7 @@ */ #pragma once -#include +#include "common/replication.codes.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/storage/simple_kv/simple_kv.main.cpp b/src/rdsn/src/replica/storage/simple_kv/simple_kv.main.cpp index b5c2294de6..af22d71e9f 100644 --- a/src/rdsn/src/replica/storage/simple_kv/simple_kv.main.cpp +++ b/src/rdsn/src/replica/storage/simple_kv/simple_kv.main.cpp @@ -38,9 +38,9 @@ #include "simple_kv.server.impl.h" // framework specific tools -#include -#include -#include +#include "meta/meta_service_app.h" +#include "replica/replication_service_app.h" +#include "http/http_server.h" static void dsn_app_registration_simple_kv() { diff --git a/src/rdsn/src/replica/storage/simple_kv/simple_kv.server.h b/src/rdsn/src/replica/storage/simple_kv/simple_kv.server.h index a994db29f2..377d3d336f 100644 --- a/src/rdsn/src/replica/storage/simple_kv/simple_kv.server.h +++ b/src/rdsn/src/replica/storage/simple_kv/simple_kv.server.h @@ -36,8 +36,8 @@ #pragma once #include -#include -#include +#include "replica/replication_app_base.h" +#include "common/storage_serverlet.h" #include "simple_kv.code.definition.h" #include "simple_kv_types.h" diff --git a/src/rdsn/src/replica/storage/simple_kv/simple_kv.server.impl.cpp b/src/rdsn/src/replica/storage/simple_kv/simple_kv.server.impl.cpp index 69275c3110..703dbc15d1 100644 --- a/src/rdsn/src/replica/storage/simple_kv/simple_kv.server.impl.cpp +++ b/src/rdsn/src/replica/storage/simple_kv/simple_kv.server.impl.cpp @@ -36,7 +36,7 @@ #include "simple_kv.server.impl.h" #include #include -#include +#include "utils/filesystem.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/storage/simple_kv/test/case.cpp b/src/rdsn/src/replica/storage/simple_kv/test/case.cpp index 7d6512a5b6..50696cbc6b 100644 --- a/src/rdsn/src/replica/storage/simple_kv/test/case.cpp +++ b/src/rdsn/src/replica/storage/simple_kv/test/case.cpp @@ -39,8 +39,8 @@ #include -#include -#include +#include "runtime/task/task.h" +#include "runtime/rpc/rpc_message.h" #include "replica/replica_stub.h" #include "runtime/service_engine.h" #include "meta/server_load_balancer.h" diff --git a/src/rdsn/src/replica/storage/simple_kv/test/case.h b/src/rdsn/src/replica/storage/simple_kv/test/case.h index a6b2ea04aa..99b202a8cc 100644 --- a/src/rdsn/src/replica/storage/simple_kv/test/case.h +++ b/src/rdsn/src/replica/storage/simple_kv/test/case.h @@ -37,8 +37,8 @@ #include "common.h" -#include -#include +#include "utils/singleton.h" +#include "utils/zlocks.h" #include diff --git a/src/rdsn/src/replica/storage/simple_kv/test/checker.cpp b/src/rdsn/src/replica/storage/simple_kv/test/checker.cpp index 96978d8f73..99d6f7c261 100644 --- a/src/rdsn/src/replica/storage/simple_kv/test/checker.cpp +++ b/src/rdsn/src/replica/storage/simple_kv/test/checker.cpp @@ -35,8 +35,8 @@ #include #include -#include -#include +#include "utils/factory_store.h" +#include "runtime/tool_api.h" #include "checker.h" #include "case.h" diff --git a/src/rdsn/src/replica/storage/simple_kv/test/checker.h b/src/rdsn/src/replica/storage/simple_kv/test/checker.h index 063acfcc70..3c090d8974 100644 --- a/src/rdsn/src/replica/storage/simple_kv/test/checker.h +++ b/src/rdsn/src/replica/storage/simple_kv/test/checker.h @@ -37,10 +37,10 @@ #include "common.h" -#include -#include -#include -#include +#include "utils/singleton.h" +#include "runtime/simulator.h" +#include "meta/meta_service_app.h" +#include "replica/replication_service_app.h" #include "meta/server_state.h" diff --git a/src/rdsn/src/replica/storage/simple_kv/test/client.cpp b/src/rdsn/src/replica/storage/simple_kv/test/client.cpp index 3d04b6a1eb..a0dd96ef0c 100644 --- a/src/rdsn/src/replica/storage/simple_kv/test/client.cpp +++ b/src/rdsn/src/replica/storage/simple_kv/test/client.cpp @@ -35,8 +35,8 @@ #include "client.h" #include "case.h" -#include -#include +#include "runtime/rpc/group_address.h" +#include "common/replication_other_types.h" #include diff --git a/src/rdsn/src/replica/storage/simple_kv/test/client.h b/src/rdsn/src/replica/storage/simple_kv/test/client.h index 6d3e5c4eb6..c05f2ef867 100644 --- a/src/rdsn/src/replica/storage/simple_kv/test/client.h +++ b/src/rdsn/src/replica/storage/simple_kv/test/client.h @@ -35,8 +35,14 @@ #pragma once -#include -#include +#include "runtime/service_app.h" +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" #include "replica/storage/simple_kv/simple_kv.client.h" namespace dsn { diff --git a/src/rdsn/src/replica/storage/simple_kv/test/common.cpp b/src/rdsn/src/replica/storage/simple_kv/test/common.cpp index a204e4246a..94b804a7f5 100644 --- a/src/rdsn/src/replica/storage/simple_kv/test/common.cpp +++ b/src/rdsn/src/replica/storage/simple_kv/test/common.cpp @@ -36,7 +36,7 @@ #include "common.h" #include "checker.h" -#include +#include "utils/utils.h" #include #include diff --git a/src/rdsn/src/replica/storage/simple_kv/test/common.h b/src/rdsn/src/replica/storage/simple_kv/test/common.h index 05450900a0..06239c28c7 100644 --- a/src/rdsn/src/replica/storage/simple_kv/test/common.h +++ b/src/rdsn/src/replica/storage/simple_kv/test/common.h @@ -35,7 +35,22 @@ #pragma once -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "common/replication_other_types.h" +#include "common/replication.codes.h" #include "common/replication_common.h" namespace dsn { diff --git a/src/rdsn/src/replica/storage/simple_kv/test/injector.cpp b/src/rdsn/src/replica/storage/simple_kv/test/injector.cpp index 8c68206f27..130eef37a3 100644 --- a/src/rdsn/src/replica/storage/simple_kv/test/injector.cpp +++ b/src/rdsn/src/replica/storage/simple_kv/test/injector.cpp @@ -37,9 +37,13 @@ #include "checker.h" #include "case.h" -#include -#include -#include +#include "runtime/fault_injector.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/autoref_ptr.h" #include diff --git a/src/rdsn/src/replica/storage/simple_kv/test/injector.h b/src/rdsn/src/replica/storage/simple_kv/test/injector.h index 11fd26e94c..40aa15d6c7 100644 --- a/src/rdsn/src/replica/storage/simple_kv/test/injector.h +++ b/src/rdsn/src/replica/storage/simple_kv/test/injector.h @@ -35,7 +35,7 @@ #pragma once -#include +#include "runtime/tool_api.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/replica/storage/simple_kv/test/simple_kv.main.cpp b/src/rdsn/src/replica/storage/simple_kv/test/simple_kv.main.cpp index 4c562a8433..93cbcfc3e7 100644 --- a/src/rdsn/src/replica/storage/simple_kv/test/simple_kv.main.cpp +++ b/src/rdsn/src/replica/storage/simple_kv/test/simple_kv.main.cpp @@ -38,7 +38,7 @@ #include "case.h" #include "client.h" #include "simple_kv.server.impl.h" -#include +#include "http/http_server.h" void dsn_app_registration_simple_kv() { diff --git a/src/rdsn/src/replica/storage/simple_kv/test/simple_kv.server.impl.cpp b/src/rdsn/src/replica/storage/simple_kv/test/simple_kv.server.impl.cpp index 102cb46b36..ed8ec13bbe 100644 --- a/src/rdsn/src/replica/storage/simple_kv/test/simple_kv.server.impl.cpp +++ b/src/rdsn/src/replica/storage/simple_kv/test/simple_kv.server.impl.cpp @@ -26,7 +26,7 @@ #include "simple_kv.server.impl.h" #include #include -#include +#include "utils/filesystem.h" #define VALUE_NOT_EXIST "<>" diff --git a/src/rdsn/src/replica/storage/simple_kv/test/simple_kv.server.impl.h b/src/rdsn/src/replica/storage/simple_kv/test/simple_kv.server.impl.h index e4402b6cd6..1d04367d38 100644 --- a/src/rdsn/src/replica/storage/simple_kv/test/simple_kv.server.impl.h +++ b/src/rdsn/src/replica/storage/simple_kv/test/simple_kv.server.impl.h @@ -25,7 +25,7 @@ */ #pragma once -#include +#include "utils/zlocks.h" #include "replica/storage/simple_kv/simple_kv.server.h" namespace dsn { diff --git a/src/rdsn/src/replica/test/backup_block_service_mock.h b/src/rdsn/src/replica/test/backup_block_service_mock.h index 6160fc714d..4ac8bc95fe 100644 --- a/src/rdsn/src/replica/test/backup_block_service_mock.h +++ b/src/rdsn/src/replica/test/backup_block_service_mock.h @@ -18,10 +18,13 @@ #pragma once #include -#include -#include -#include -#include +#include "utils/filesystem.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/task/task_tracker.h" +#include "block_service/block_service.h" #include "replica/replica_context.h" #include "replication_service_test_app.h" #include "block_service/test/block_service_mock.h" diff --git a/src/rdsn/src/replica/test/main.cpp b/src/rdsn/src/replica/test/main.cpp index 2621f9c2b6..fe05848373 100644 --- a/src/rdsn/src/replica/test/main.cpp +++ b/src/rdsn/src/replica/test/main.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include "replica/replication_service_app.h" #include "replication_service_test_app.h" diff --git a/src/rdsn/src/replica/test/mock_utils.h b/src/rdsn/src/replica/test/mock_utils.h index e415785753..612641dd94 100644 --- a/src/rdsn/src/replica/test/mock_utils.h +++ b/src/rdsn/src/replica/test/mock_utils.h @@ -26,10 +26,10 @@ #pragma once -#include -#include -#include -#include +#include "replica/replication_app_base.h" +#include "replica/duplication/mutation_duplicator.h" +#include "utils/fmt_logging.h" +#include "utils/filesystem.h" #include "replica/replica.h" #include "replica/replica_stub.h" diff --git a/src/rdsn/src/replica/test/mutation_log_learn_test.cpp b/src/rdsn/src/replica/test/mutation_log_learn_test.cpp index b3267bcaf6..862e57a814 100644 --- a/src/rdsn/src/replica/test/mutation_log_learn_test.cpp +++ b/src/rdsn/src/replica/test/mutation_log_learn_test.cpp @@ -27,7 +27,7 @@ #include "replica/mutation_log.h" #include "replica_test_base.h" -#include +#include "utils/filesystem.h" #include #include #include diff --git a/src/rdsn/src/replica/test/mutation_log_test.cpp b/src/rdsn/src/replica/test/mutation_log_test.cpp index 2b04294b87..57dbea784c 100644 --- a/src/rdsn/src/replica/test/mutation_log_test.cpp +++ b/src/rdsn/src/replica/test/mutation_log_test.cpp @@ -27,7 +27,7 @@ #include "replica/mutation_log.h" #include "replica_test_base.h" -#include +#include "utils/filesystem.h" #include using namespace ::dsn; diff --git a/src/rdsn/src/replica/test/replica_disk_migrate_test.cpp b/src/rdsn/src/replica/test/replica_disk_migrate_test.cpp index cc7e3f0190..8785bea8a2 100644 --- a/src/rdsn/src/replica/test/replica_disk_migrate_test.cpp +++ b/src/rdsn/src/replica/test/replica_disk_migrate_test.cpp @@ -18,7 +18,7 @@ */ #include -#include +#include "utils/fail_point.h" #include "replica/test/replica_disk_test_base.h" #include "replica/replica_disk_migrator.h" diff --git a/src/rdsn/src/replica/test/replica_disk_test.cpp b/src/rdsn/src/replica/test/replica_disk_test.cpp index 8b4d50d45c..e97160a524 100644 --- a/src/rdsn/src/replica/test/replica_disk_test.cpp +++ b/src/rdsn/src/replica/test/replica_disk_test.cpp @@ -18,7 +18,7 @@ */ #include -#include +#include "utils/fail_point.h" #include "replica_disk_test_base.h" #include "replica/disk_cleaner.h" diff --git a/src/rdsn/src/replica/test/replica_disk_test_base.h b/src/rdsn/src/replica/test/replica_disk_test_base.h index 38c699f3b3..598c0f82c4 100644 --- a/src/rdsn/src/replica/test/replica_disk_test_base.h +++ b/src/rdsn/src/replica/test/replica_disk_test_base.h @@ -18,8 +18,8 @@ */ #include -#include -#include +#include "utils/fail_point.h" +#include "utils/fmt_logging.h" #include "replica/test/replica_test_base.h" diff --git a/src/rdsn/src/replica/test/replica_test.cpp b/src/rdsn/src/replica/test/replica_test.cpp index 5928128ccd..8a8fb439a3 100644 --- a/src/rdsn/src/replica/test/replica_test.cpp +++ b/src/rdsn/src/replica/test/replica_test.cpp @@ -15,10 +15,10 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "common/replica_envs.h" +#include "utils/defer.h" #include -#include +#include "utils/filesystem.h" #include "runtime/rpc/network.sim.h" #include "common/backup_common.h" diff --git a/src/rdsn/src/replica/test/replica_test_base.h b/src/rdsn/src/replica/test/replica_test_base.h index ca30a36782..e75c25386e 100644 --- a/src/rdsn/src/replica/test/replica_test_base.h +++ b/src/rdsn/src/replica/test/replica_test_base.h @@ -26,10 +26,10 @@ #pragma once -#include -#include -#include -#include +#include "utils/smart_pointers.h" +#include "replica/replication_app_base.h" +#include "utils/filesystem.h" +#include "utils/errors.h" #include #include "replica/replica_stub.h" diff --git a/src/rdsn/src/replica/test/replication_service_test_app.h b/src/rdsn/src/replica/test/replication_service_test_app.h index b6a5a93d19..9d3edc3c42 100644 --- a/src/rdsn/src/replica/test/replication_service_test_app.h +++ b/src/rdsn/src/replica/test/replication_service_test_app.h @@ -26,7 +26,7 @@ #pragma once -#include +#include "replica/replication_service_app.h" using ::dsn::replication::replication_service_app; using ::dsn::error_code; diff --git a/src/rdsn/include/dsn/c/api_layer1.h b/src/rdsn/src/runtime/api_layer1.h similarity index 96% rename from src/rdsn/include/dsn/c/api_layer1.h rename to src/rdsn/src/runtime/api_layer1.h index b78294050c..91cc5dd003 100644 --- a/src/rdsn/include/dsn/c/api_layer1.h +++ b/src/rdsn/src/runtime/api_layer1.h @@ -24,13 +24,17 @@ * THE SOFTWARE. */ +// service API for app/framework development, +// including threading/tasking, thread synchronization, +// RPC, asynchronous file IO, environment, etc. + #pragma once -#include -#include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "common/gpid.h" +#include "utils/rpc_address.h" +#include "runtime/task/task_tracker.h" /*! @defgroup service-api-c Core Service API diff --git a/src/rdsn/include/dsn/c/api_task.h b/src/rdsn/src/runtime/api_task.h similarity index 88% rename from src/rdsn/include/dsn/c/api_task.h rename to src/rdsn/src/runtime/api_task.h index d2fa5b6082..e9f3e1c514 100644 --- a/src/rdsn/include/dsn/c/api_task.h +++ b/src/rdsn/src/runtime/api_task.h @@ -24,21 +24,15 @@ * THE SOFTWARE. */ -/* - * Description: - * task and execution model - * - * Revision history: - * Feb., 2016, @imzhenyu (Zhenyu Guo), first version - * xxxx-xx-xx, author, fix bug about xxx - */ +// rDSN uses event-driven programming model, and +// this file defines the task(i.e., event) abstraction and related #pragma once -#include -#include -#include -#include +#include "common/api_common.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" /*! @addtogroup task-common diff --git a/src/rdsn/include/dsn/c/app_model.h b/src/rdsn/src/runtime/app_model.h similarity index 94% rename from src/rdsn/include/dsn/c/app_model.h rename to src/rdsn/src/runtime/app_model.h index ff0435a75f..75810199d2 100644 --- a/src/rdsn/include/dsn/c/app_model.h +++ b/src/rdsn/src/runtime/app_model.h @@ -24,18 +24,11 @@ * THE SOFTWARE. */ -/* - * Description: - * application model in rDSN - * - * Revision history: - * Mar., 2015, @imzhenyu (Zhenyu Guo), first version - * xxxx-xx-xx, author, fix bug about xxx - */ +// application/framework model in rDSN #pragma once -#include +#include "common/api_common.h" /*! mimic an app as if the following execution in the current thread are diff --git a/src/rdsn/src/runtime/core_main.cpp b/src/rdsn/src/runtime/core_main.cpp index 47d0ed525a..526bfaff61 100644 --- a/src/rdsn/src/runtime/core_main.cpp +++ b/src/rdsn/src/runtime/core_main.cpp @@ -24,13 +24,13 @@ * THE SOFTWARE. */ -#include -#include -#include -#include -#include +#include "runtime/simulator.h" +#include "runtime/nativerun.h" +#include "runtime/tracer.h" +#include "runtime/profiler.h" +#include "runtime/fault_injector.h" -#include +#include "runtime/providers.common.h" void dsn_core_init() { diff --git a/src/rdsn/src/runtime/env.sim.cpp b/src/rdsn/src/runtime/env.sim.cpp index 1a9e973d2b..1f91e92ceb 100644 --- a/src/rdsn/src/runtime/env.sim.cpp +++ b/src/rdsn/src/runtime/env.sim.cpp @@ -36,7 +36,7 @@ #include "env.sim.h" #include "scheduler.h" -#include +#include "utils/rand.h" namespace dsn { namespace tools { diff --git a/src/rdsn/src/runtime/env.sim.h b/src/rdsn/src/runtime/env.sim.h index ecab6d512f..c0ca2abf84 100644 --- a/src/rdsn/src/runtime/env.sim.h +++ b/src/rdsn/src/runtime/env.sim.h @@ -35,7 +35,7 @@ #pragma once -#include +#include "runtime/tool_api.h" namespace dsn { namespace tools { diff --git a/src/rdsn/include/dsn/tool-api/env_provider.h b/src/rdsn/src/runtime/env_provider.h similarity index 84% rename from src/rdsn/include/dsn/tool-api/env_provider.h rename to src/rdsn/src/runtime/env_provider.h index 0389c8e533..0cb0c01e53 100644 --- a/src/rdsn/include/dsn/tool-api/env_provider.h +++ b/src/rdsn/src/runtime/env_provider.h @@ -24,20 +24,11 @@ * THE SOFTWARE. */ -/* - * Description: - * interface of the environment in Zion - * - * Revision history: - * Mar., 2015, @imzhenyu (Zhenyu Guo), first version - * xxxx-xx-xx, author, fix bug about xxx - */ - #pragma once -#include -#include -#include +#include "utils/ports.h" +#include "utils/utils.h" +#include "utils/dlib.h" #include namespace dsn { diff --git a/src/rdsn/src/runtime/fault_injector.cpp b/src/rdsn/src/runtime/fault_injector.cpp index 831c7d2485..5900c7d684 100644 --- a/src/rdsn/src/runtime/fault_injector.cpp +++ b/src/rdsn/src/runtime/fault_injector.cpp @@ -33,10 +33,14 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include -#include -#include -#include +#include "runtime/fault_injector.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/rand.h" +#include "aio/aio_task.h" namespace dsn { namespace tools { diff --git a/src/rdsn/include/dsn/toollet/fault_injector.h b/src/rdsn/src/runtime/fault_injector.h similarity index 91% rename from src/rdsn/include/dsn/toollet/fault_injector.h rename to src/rdsn/src/runtime/fault_injector.h index d3ab805b27..8cca241280 100644 --- a/src/rdsn/include/dsn/toollet/fault_injector.h +++ b/src/rdsn/src/runtime/fault_injector.h @@ -24,18 +24,9 @@ * THE SOFTWARE. */ -/* - * Description: - * fault inject toolet interface definition - * - * Revision history: - * Mar., 2015, @imzhenyu (Zhenyu Guo), first version - * xxxx-xx-xx, author, fix bug about xxx - */ - #pragma once -#include +#include "runtime/tool_api.h" /*! @defgroup fault-injector Fault Injector diff --git a/src/rdsn/src/runtime/global_config.cpp b/src/rdsn/src/runtime/global_config.cpp index 1749f40f0a..213529cb3a 100644 --- a/src/rdsn/src/runtime/global_config.cpp +++ b/src/rdsn/src/runtime/global_config.cpp @@ -35,15 +35,15 @@ #include -#include -#include -#include -#include - -#include -#include -#include -#include +#include "utils/singleton_store.h" +#include "utils/filesystem.h" +#include "utils/config_api.h" +#include "utils/flags.h" + +#include "runtime/global_config.h" +#include "runtime/task/task_spec.h" +#include "runtime/rpc/network.h" +#include "runtime/service_app.h" namespace dsn { diff --git a/src/rdsn/include/dsn/tool-api/global_config.h b/src/rdsn/src/runtime/global_config.h similarity index 98% rename from src/rdsn/include/dsn/tool-api/global_config.h rename to src/rdsn/src/runtime/global_config.h index 8bb9406019..73150ec240 100644 --- a/src/rdsn/include/dsn/tool-api/global_config.h +++ b/src/rdsn/src/runtime/global_config.h @@ -39,9 +39,9 @@ #pragma once -#include -#include -#include +#include "runtime/task/task_spec.h" +#include "utils/threadpool_spec.h" +#include "utils/dlib.h" #include #include diff --git a/src/rdsn/src/runtime/message_utils.cpp b/src/rdsn/src/runtime/message_utils.cpp index 62b5ad18d7..2e29a0340b 100644 --- a/src/rdsn/src/runtime/message_utils.cpp +++ b/src/rdsn/src/runtime/message_utils.cpp @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include +#include "runtime/message_utils.h" namespace dsn { diff --git a/src/rdsn/include/dsn/cpp/message_utils.h b/src/rdsn/src/runtime/message_utils.h similarity index 90% rename from src/rdsn/include/dsn/cpp/message_utils.h rename to src/rdsn/src/runtime/message_utils.h index e5ff40d32b..34bda3ce07 100644 --- a/src/rdsn/include/dsn/cpp/message_utils.h +++ b/src/rdsn/src/runtime/message_utils.h @@ -17,13 +17,13 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include +#include "utils/string_view.h" +#include "utils/binary_writer.h" +#include "utils/binary_reader.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_message.h" +#include "common/serialization_helper/dsn.layer2_types.h" namespace dsn { diff --git a/src/rdsn/src/runtime/nativerun.cpp b/src/rdsn/src/runtime/nativerun.cpp index b7ce3ad8a4..e398dd762a 100644 --- a/src/rdsn/src/runtime/nativerun.cpp +++ b/src/rdsn/src/runtime/nativerun.cpp @@ -33,7 +33,7 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include +#include "runtime/nativerun.h" namespace dsn { namespace tools { diff --git a/src/rdsn/include/dsn/tool/nativerun.h b/src/rdsn/src/runtime/nativerun.h similarity index 98% rename from src/rdsn/include/dsn/tool/nativerun.h rename to src/rdsn/src/runtime/nativerun.h index 8e9ac67cd6..acf23bba1b 100644 --- a/src/rdsn/include/dsn/tool/nativerun.h +++ b/src/rdsn/src/runtime/nativerun.h @@ -35,7 +35,7 @@ #pragma once -#include +#include "runtime/tool_api.h" namespace dsn { namespace tools { diff --git a/src/rdsn/include/dsn/tool/node_scoper.h b/src/rdsn/src/runtime/node_scoper.h similarity index 89% rename from src/rdsn/include/dsn/tool/node_scoper.h rename to src/rdsn/src/runtime/node_scoper.h index 47c0b10dba..5b43e2ca5b 100644 --- a/src/rdsn/include/dsn/tool/node_scoper.h +++ b/src/rdsn/src/runtime/node_scoper.h @@ -24,18 +24,9 @@ * THE SOFTWARE. */ -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * xxxx-xx-xx, author, fix bug about xxx - */ - #pragma once -#include +#include "runtime/tool_api.h" namespace dsn { namespace tools { diff --git a/src/rdsn/include/dsn/cpp/pipeline.h b/src/rdsn/src/runtime/pipeline.h similarity index 98% rename from src/rdsn/include/dsn/cpp/pipeline.h rename to src/rdsn/src/runtime/pipeline.h index 2cab032cb5..5c65020062 100644 --- a/src/rdsn/include/dsn/cpp/pipeline.h +++ b/src/rdsn/src/runtime/pipeline.h @@ -19,11 +19,11 @@ #pragma once -#include -#include -#include -#include -#include +#include "runtime/task/task_code.h" +#include "runtime/task/task_tracker.h" +#include "runtime/task/async_calls.h" +#include "utils/chrono_literals.h" +#include "utils/apply.h" namespace dsn { namespace pipeline { diff --git a/src/rdsn/src/runtime/profiler.cpp b/src/rdsn/src/runtime/profiler.cpp index 6c4fe3148a..c2b5b006f1 100644 --- a/src/rdsn/src/runtime/profiler.cpp +++ b/src/rdsn/src/runtime/profiler.cpp @@ -47,13 +47,17 @@ START<== queue(server) == ENQUEUE <===== net(reply) ======= REPLY <============= \/ END */ -#include -#include -#include +#include "runtime/profiler.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "aio/aio_task.h" #include "utils/shared_io_service.h" #include "profiler_header.h" -#include -#include +#include "utils/command_manager.h" +#include "perf_counter/perf_counter_wrapper.h" namespace dsn { namespace tools { diff --git a/src/rdsn/include/dsn/toollet/profiler.h b/src/rdsn/src/runtime/profiler.h similarity index 98% rename from src/rdsn/include/dsn/toollet/profiler.h rename to src/rdsn/src/runtime/profiler.h index f8487f8265..80db4baa94 100644 --- a/src/rdsn/include/dsn/toollet/profiler.h +++ b/src/rdsn/src/runtime/profiler.h @@ -26,7 +26,7 @@ #pragma once -#include +#include "runtime/tool_api.h" /*! @defgroup profiler Profiler diff --git a/src/rdsn/src/runtime/profiler_header.h b/src/rdsn/src/runtime/profiler_header.h index 9db6148db2..bba38a7b40 100644 --- a/src/rdsn/src/runtime/profiler_header.h +++ b/src/rdsn/src/runtime/profiler_header.h @@ -26,7 +26,7 @@ #pragma once #include -#include +#include "perf_counter/perf_counter_wrapper.h" namespace dsn { namespace tools { diff --git a/src/rdsn/src/runtime/providers.common.cpp b/src/rdsn/src/runtime/providers.common.cpp index 41dbb19485..db50173369 100644 --- a/src/rdsn/src/runtime/providers.common.cpp +++ b/src/rdsn/src/runtime/providers.common.cpp @@ -34,7 +34,7 @@ */ #include "runtime/rpc/asio_net_provider.h" -#include +#include "runtime/providers.common.h" #include "utils/lockp.std.h" #include "runtime/task/simple_task_queue.h" #include "runtime/task/hpc_task_queue.h" diff --git a/src/rdsn/include/dsn/tool/providers.common.h b/src/rdsn/src/runtime/providers.common.h similarity index 87% rename from src/rdsn/include/dsn/tool/providers.common.h rename to src/rdsn/src/runtime/providers.common.h index 6890a90f6d..68232bb0ae 100644 --- a/src/rdsn/include/dsn/tool/providers.common.h +++ b/src/rdsn/src/runtime/providers.common.h @@ -24,18 +24,9 @@ * THE SOFTWARE. */ -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * xxxx-xx-xx, author, fix bug about xxx - */ - #pragma once -#include +#include "runtime/tool_api.h" namespace dsn { namespace tools { diff --git a/src/rdsn/src/runtime/rpc/asio_net_provider.cpp b/src/rdsn/src/runtime/rpc/asio_net_provider.cpp index 7d0f02ad8c..e440c085ef 100644 --- a/src/rdsn/src/runtime/rpc/asio_net_provider.cpp +++ b/src/rdsn/src/runtime/rpc/asio_net_provider.cpp @@ -24,12 +24,12 @@ * THE SOFTWARE. */ -#include +#include "utils/rand.h" #include #include "asio_net_provider.h" #include "asio_rpc_session.h" -#include +#include "utils/flags.h" namespace dsn { namespace tools { diff --git a/src/rdsn/src/runtime/rpc/asio_net_provider.h b/src/rdsn/src/runtime/rpc/asio_net_provider.h index 4adc37d495..dc4566d677 100644 --- a/src/rdsn/src/runtime/rpc/asio_net_provider.h +++ b/src/rdsn/src/runtime/rpc/asio_net_provider.h @@ -26,7 +26,7 @@ #pragma once -#include +#include "runtime/tool_api.h" #include namespace dsn { diff --git a/src/rdsn/src/runtime/rpc/asio_rpc_session.h b/src/rdsn/src/runtime/rpc/asio_rpc_session.h index de736f3a8c..7c305bd497 100644 --- a/src/rdsn/src/runtime/rpc/asio_rpc_session.h +++ b/src/rdsn/src/runtime/rpc/asio_rpc_session.h @@ -26,9 +26,9 @@ #pragma once -#include -#include -#include +#include "runtime/rpc/rpc_message.h" +#include "utils/priority_queue.h" +#include "runtime/rpc/message_parser.h" #include #include "asio_net_provider.h" diff --git a/src/rdsn/src/runtime/rpc/dsn_message_parser.cpp b/src/rdsn/src/runtime/rpc/dsn_message_parser.cpp index 646656f089..ba21c38108 100644 --- a/src/rdsn/src/runtime/rpc/dsn_message_parser.cpp +++ b/src/rdsn/src/runtime/rpc/dsn_message_parser.cpp @@ -34,8 +34,12 @@ */ #include "dsn_message_parser.h" -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/crc.h" namespace dsn { void dsn_message_parser::reset() { _header_checked = false; } diff --git a/src/rdsn/src/runtime/rpc/dsn_message_parser.h b/src/rdsn/src/runtime/rpc/dsn_message_parser.h index 6edf83012b..3b50898976 100644 --- a/src/rdsn/src/runtime/rpc/dsn_message_parser.h +++ b/src/rdsn/src/runtime/rpc/dsn_message_parser.h @@ -35,9 +35,9 @@ #pragma once -#include -#include -#include +#include "runtime/rpc/message_parser.h" +#include "runtime/rpc/rpc_message.h" +#include "utils/ports.h" namespace dsn { class dsn_message_parser : public message_parser diff --git a/src/rdsn/include/dsn/tool-api/group_address.h b/src/rdsn/src/runtime/rpc/group_address.h similarity index 96% rename from src/rdsn/include/dsn/tool-api/group_address.h rename to src/rdsn/src/runtime/rpc/group_address.h index b164882833..aa5b2ff774 100644 --- a/src/rdsn/include/dsn/tool-api/group_address.h +++ b/src/rdsn/src/runtime/rpc/group_address.h @@ -36,12 +36,12 @@ #pragma once #include -#include -#include -#include -#include -#include -#include +#include "utils/api_utilities.h" +#include "runtime/api_layer1.h" +#include "utils/synchronize.h" +#include "utils/autoref_ptr.h" +#include "utils/rand.h" +#include "utils/rpc_address.h" namespace dsn { class rpc_group_address : public dsn::ref_counter diff --git a/src/rdsn/src/runtime/rpc/message_parser.cpp b/src/rdsn/src/runtime/rpc/message_parser.cpp index 81877df69c..93a95b0891 100644 --- a/src/rdsn/src/runtime/rpc/message_parser.cpp +++ b/src/rdsn/src/runtime/rpc/message_parser.cpp @@ -34,7 +34,11 @@ */ #include "message_parser_manager.h" -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" namespace dsn { diff --git a/src/rdsn/include/dsn/tool-api/message_parser.h b/src/rdsn/src/runtime/rpc/message_parser.h similarity index 93% rename from src/rdsn/include/dsn/tool-api/message_parser.h rename to src/rdsn/src/runtime/rpc/message_parser.h index 1c5bf97f5a..215af83260 100644 --- a/src/rdsn/include/dsn/tool-api/message_parser.h +++ b/src/rdsn/src/runtime/rpc/message_parser.h @@ -26,14 +26,14 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include -#include +#include "utils/ports.h" +#include "utils/singleton.h" +#include "runtime/task/task_spec.h" +#include "runtime/rpc/rpc_message.h" +#include "utils/autoref_ptr.h" +#include "utils/utils.h" +#include "utils/blob.h" +#include "utils/dlib.h" #include namespace dsn { diff --git a/src/rdsn/src/runtime/rpc/message_parser_manager.h b/src/rdsn/src/runtime/rpc/message_parser_manager.h index 17b66f49c1..31d16818b1 100644 --- a/src/rdsn/src/runtime/rpc/message_parser_manager.h +++ b/src/rdsn/src/runtime/rpc/message_parser_manager.h @@ -35,7 +35,7 @@ #pragma once -#include +#include "runtime/rpc/message_parser.h" namespace dsn { class message_parser_manager : public utils::singleton diff --git a/src/rdsn/src/runtime/rpc/network.cpp b/src/rdsn/src/runtime/rpc/network.cpp index 283f730155..422cfee702 100644 --- a/src/rdsn/src/runtime/rpc/network.cpp +++ b/src/rdsn/src/runtime/rpc/network.cpp @@ -24,13 +24,14 @@ * THE SOFTWARE. */ +#include "network.h" + #include "message_parser_manager.h" #include "runtime/rpc/rpc_engine.h" -#include -#include -#include -#include +#include "utils/factory_store.h" +#include "utils/flags.h" +#include "utils/fmt_logging.h" namespace dsn { /*static*/ join_point diff --git a/src/rdsn/include/dsn/tool-api/network.h b/src/rdsn/src/runtime/rpc/network.h similarity index 97% rename from src/rdsn/include/dsn/tool-api/network.h rename to src/rdsn/src/runtime/rpc/network.h index e46bd9bd42..cb14f801a7 100644 --- a/src/rdsn/include/dsn/tool-api/network.h +++ b/src/rdsn/src/runtime/rpc/network.h @@ -26,13 +26,14 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include +#include "runtime/task/task.h" + +#include "utils/synchronize.h" +#include "runtime/rpc/message_parser.h" +#include "utils/rpc_address.h" +#include "utils/exp_delay.h" +#include "utils/dlib.h" +#include "perf_counter/perf_counter_wrapper.h" #include namespace dsn { diff --git a/src/rdsn/src/runtime/rpc/network.sim.cpp b/src/rdsn/src/runtime/rpc/network.sim.cpp index 1771003bc3..b5e8051874 100644 --- a/src/rdsn/src/runtime/rpc/network.sim.cpp +++ b/src/rdsn/src/runtime/rpc/network.sim.cpp @@ -34,10 +34,14 @@ */ #include -#include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/singleton_store.h" +#include "utils/rand.h" +#include "runtime/node_scoper.h" #include "network.sim.h" namespace dsn { diff --git a/src/rdsn/src/runtime/rpc/network.sim.h b/src/rdsn/src/runtime/rpc/network.sim.h index 824718232c..42a915bc46 100644 --- a/src/rdsn/src/runtime/rpc/network.sim.h +++ b/src/rdsn/src/runtime/rpc/network.sim.h @@ -24,18 +24,9 @@ * THE SOFTWARE. */ -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * xxxx-xx-xx, author, fix bug about xxx - */ - #pragma once -#include +#include "runtime/tool_api.h" namespace dsn { namespace tools { diff --git a/src/rdsn/src/runtime/rpc/raw_message_parser.cpp b/src/rdsn/src/runtime/rpc/raw_message_parser.cpp index 5d796d4bbc..5526cd2f7a 100644 --- a/src/rdsn/src/runtime/rpc/raw_message_parser.cpp +++ b/src/rdsn/src/runtime/rpc/raw_message_parser.cpp @@ -32,9 +32,13 @@ * xxxx-xx-xx, author, fix bug about xxx */ #include "raw_message_parser.h" -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "runtime/task/task_spec.h" +#include "network.h" namespace dsn { diff --git a/src/rdsn/src/runtime/rpc/raw_message_parser.h b/src/rdsn/src/runtime/rpc/raw_message_parser.h index 4ab9699483..fd9f18f1ff 100644 --- a/src/rdsn/src/runtime/rpc/raw_message_parser.h +++ b/src/rdsn/src/runtime/rpc/raw_message_parser.h @@ -35,9 +35,9 @@ #ifndef RAW_MESSAGE_PARSER_H #define RAW_MESSAGE_PARSER_H -#include -#include -#include +#include "runtime/rpc/message_parser.h" +#include "runtime/rpc/rpc_message.h" +#include "utils/ports.h" namespace dsn { diff --git a/src/rdsn/src/runtime/rpc/rpc_engine.cpp b/src/rdsn/src/runtime/rpc/rpc_engine.cpp index 2bf70dec71..9a1de2965b 100644 --- a/src/rdsn/src/runtime/rpc/rpc_engine.cpp +++ b/src/rdsn/src/runtime/rpc/rpc_engine.cpp @@ -32,12 +32,12 @@ #include "rpc_engine.h" #include "runtime/service_engine.h" -#include -#include -#include -#include -#include -#include +#include "utils/factory_store.h" +#include "runtime/rpc/group_address.h" +#include "runtime/task/task_queue.h" +#include "runtime/task/async_calls.h" +#include "runtime/rpc/serialization.h" +#include "utils/rand.h" #include namespace dsn { diff --git a/src/rdsn/src/runtime/rpc/rpc_engine.h b/src/rdsn/src/runtime/rpc/rpc_engine.h index 1a3dce947a..6bae6e863b 100644 --- a/src/rdsn/src/runtime/rpc/rpc_engine.h +++ b/src/rdsn/src/runtime/rpc/rpc_engine.h @@ -26,10 +26,10 @@ #pragma once -#include -#include -#include -#include +#include "utils/synchronize.h" +#include "runtime/task/task.h" +#include "network.h" +#include "runtime/global_config.h" namespace dsn { diff --git a/src/rdsn/include/dsn/cpp/rpc_holder.h b/src/rdsn/src/runtime/rpc/rpc_holder.h similarity index 94% rename from src/rdsn/include/dsn/cpp/rpc_holder.h rename to src/rdsn/src/runtime/rpc/rpc_holder.h index 52a5321ba0..ac888947cf 100644 --- a/src/rdsn/include/dsn/cpp/rpc_holder.h +++ b/src/rdsn/src/runtime/rpc/rpc_holder.h @@ -17,15 +17,28 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_layer1.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "runtime/rpc/rpc_message.h" +#include "runtime/task/async_calls.h" +#include "runtime/task/task_tracker.h" +#include "utils/smart_pointers.h" +#include "utils/chrono_literals.h" +#include "client/partition_resolver.h" namespace dsn { diff --git a/src/rdsn/src/runtime/rpc/rpc_message.cpp b/src/rdsn/src/runtime/rpc/rpc_message.cpp index 8425c60c32..cf7beb77d6 100644 --- a/src/rdsn/src/runtime/rpc/rpc_message.cpp +++ b/src/rdsn/src/runtime/rpc/rpc_message.cpp @@ -24,11 +24,11 @@ * THE SOFTWARE. */ -#include -#include -#include -#include -#include +#include "utils/ports.h" +#include "utils/crc.h" +#include "runtime/rpc/rpc_message.h" +#include "network.h" +#include "runtime/rpc/message_parser.h" #include #include "runtime/task/task_engine.h" diff --git a/src/rdsn/include/dsn/tool-api/rpc_message.h b/src/rdsn/src/runtime/rpc/rpc_message.h similarity index 96% rename from src/rdsn/include/dsn/tool-api/rpc_message.h rename to src/rdsn/src/runtime/rpc/rpc_message.h index a375aad282..c2b6329d23 100644 --- a/src/rdsn/include/dsn/tool-api/rpc_message.h +++ b/src/rdsn/src/runtime/rpc/rpc_message.h @@ -36,14 +36,17 @@ #pragma once #include -#include -#include -#include -#include -#include -#include -#include -#include +#include "utils/ports.h" +#include "utils/extensible_object.h" +#include "utils/dlib.h" +#include "utils/blob.h" +#include "utils/link.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "utils/rpc_address.h" +#include "runtime/global_config.h" namespace dsn { class rpc_session; diff --git a/src/rdsn/include/dsn/cpp/rpc_stream.h b/src/rdsn/src/runtime/rpc/rpc_stream.h similarity index 90% rename from src/rdsn/include/dsn/cpp/rpc_stream.h rename to src/rdsn/src/runtime/rpc/rpc_stream.h index 5d0e25ea16..4a0dd412fc 100644 --- a/src/rdsn/include/dsn/cpp/rpc_stream.h +++ b/src/rdsn/src/runtime/rpc/rpc_stream.h @@ -26,13 +26,19 @@ #pragma once -#include -#include -#include - -#include -#include -#include +#include "utils/utils.h" +#include "utils/binary_reader.h" +#include "utils/binary_writer.h" +#include "runtime/rpc/rpc_message.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" namespace dsn { diff --git a/src/rdsn/src/runtime/rpc/rpc_task.cpp b/src/rdsn/src/runtime/rpc/rpc_task.cpp index 7b1dbee3d6..58085e6d85 100644 --- a/src/rdsn/src/runtime/rpc/rpc_task.cpp +++ b/src/rdsn/src/runtime/rpc/rpc_task.cpp @@ -25,7 +25,7 @@ */ #include "runtime/task/task_engine.h" -#include +#include "runtime/task/task.h" namespace dsn { diff --git a/src/rdsn/include/dsn/cpp/serialization.h b/src/rdsn/src/runtime/rpc/serialization.h similarity index 95% rename from src/rdsn/include/dsn/cpp/serialization.h rename to src/rdsn/src/runtime/rpc/serialization.h index 7aaa04322e..ab00dfbbae 100644 --- a/src/rdsn/include/dsn/cpp/serialization.h +++ b/src/rdsn/src/runtime/rpc/serialization.h @@ -26,10 +26,10 @@ #pragma once -#include -#include -#include -#include +#include "utils/utils.h" +#include "utils/rpc_address.h" +#include "runtime/rpc/rpc_stream.h" +#include "common/serialization_helper/thrift_helper.h" namespace dsn { namespace serialization { diff --git a/src/rdsn/src/runtime/rpc/thrift_message_parser.cpp b/src/rdsn/src/runtime/rpc/thrift_message_parser.cpp index 93254ab6ae..647533db0d 100644 --- a/src/rdsn/src/runtime/rpc/thrift_message_parser.cpp +++ b/src/rdsn/src/runtime/rpc/thrift_message_parser.cpp @@ -26,15 +26,19 @@ #include "thrift_message_parser.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "common/serialization_helper/thrift_helper.h" +#include "common/serialization_helper/dsn.layer2_types.h" +#include "runtime/message_utils.h" +#include "utils/fmt_logging.h" +#include "utils/ports.h" +#include "utils/crc.h" +#include "utils/endians.h" +#include "runtime/rpc/rpc_message.h" namespace dsn { diff --git a/src/rdsn/src/runtime/rpc/thrift_message_parser.h b/src/rdsn/src/runtime/rpc/thrift_message_parser.h index 8bf2682060..734bb57e4f 100644 --- a/src/rdsn/src/runtime/rpc/thrift_message_parser.h +++ b/src/rdsn/src/runtime/rpc/thrift_message_parser.h @@ -26,12 +26,12 @@ #pragma once -#include -#include -#include -#include +#include "runtime/rpc/message_parser.h" +#include "runtime/rpc/rpc_message.h" +#include "utils/ports.h" +#include "utils/endians.h" #include -#include +#include "common/serialization_helper/dsn.layer2_types.h" #include "request_meta_types.h" diff --git a/src/rdsn/src/runtime/scheduler.cpp b/src/rdsn/src/runtime/scheduler.cpp index 2142955603..b96d6d8176 100644 --- a/src/rdsn/src/runtime/scheduler.cpp +++ b/src/rdsn/src/runtime/scheduler.cpp @@ -33,10 +33,14 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include -#include -#include -#include +#include "utils/rand.h" +#include "runtime/simulator.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "runtime/node_scoper.h" #include "scheduler.h" #include "env.sim.h" #include diff --git a/src/rdsn/src/runtime/scheduler.h b/src/rdsn/src/runtime/scheduler.h index a1af395b76..ab9bfe69a3 100644 --- a/src/rdsn/src/runtime/scheduler.h +++ b/src/rdsn/src/runtime/scheduler.h @@ -35,9 +35,9 @@ #pragma once -#include -#include -#include +#include "runtime/tool_api.h" +#include "runtime/simulator.h" +#include "utils/synchronize.h" namespace dsn { namespace tools { diff --git a/src/rdsn/src/runtime/security/access_controller.cpp b/src/rdsn/src/runtime/security/access_controller.cpp index 454e95f52f..f7f55d2923 100644 --- a/src/rdsn/src/runtime/security/access_controller.cpp +++ b/src/rdsn/src/runtime/security/access_controller.cpp @@ -17,9 +17,9 @@ #include "access_controller.h" -#include -#include -#include +#include "utils/flags.h" +#include "utils/strings.h" +#include "utils/smart_pointers.h" #include "meta_access_controller.h" #include "replica_access_controller.h" diff --git a/src/rdsn/src/runtime/security/client_negotiation.cpp b/src/rdsn/src/runtime/security/client_negotiation.cpp index e6f073f1e7..6a6b4e73b9 100644 --- a/src/rdsn/src/runtime/security/client_negotiation.cpp +++ b/src/rdsn/src/runtime/security/client_negotiation.cpp @@ -20,10 +20,10 @@ #include "negotiation_manager.h" #include -#include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "runtime/task/async_calls.h" +#include "utils/smart_pointers.h" +#include "utils/flags.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/security/init.cpp b/src/rdsn/src/runtime/security/init.cpp index 1b42e313ef..b31e452b46 100644 --- a/src/rdsn/src/runtime/security/init.cpp +++ b/src/rdsn/src/runtime/security/init.cpp @@ -19,8 +19,8 @@ #include "sasl_init.h" #include "negotiation_manager.h" -#include -#include +#include "utils/fmt_logging.h" +#include "utils/flags.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/security/init.h b/src/rdsn/src/runtime/security/init.h index f17c53f47f..8eef86487a 100644 --- a/src/rdsn/src/runtime/security/init.h +++ b/src/rdsn/src/runtime/security/init.h @@ -17,7 +17,7 @@ #pragma once -#include +#include "utils/errors.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/security/kinit_context.cpp b/src/rdsn/src/runtime/security/kinit_context.cpp index 79492f899e..6787318a3f 100644 --- a/src/rdsn/src/runtime/security/kinit_context.cpp +++ b/src/rdsn/src/runtime/security/kinit_context.cpp @@ -22,13 +22,13 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include "utils/defer.h" +#include "utils/time_utils.h" +#include "utils/fmt_logging.h" +#include "utils/flags.h" +#include "utils/filesystem.h" +#include "utils/smart_pointers.h" +#include "utils/rand.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/security/kinit_context.h b/src/rdsn/src/runtime/security/kinit_context.h index 6ea6f56a08..e73b651911 100644 --- a/src/rdsn/src/runtime/security/kinit_context.h +++ b/src/rdsn/src/runtime/security/kinit_context.h @@ -17,7 +17,7 @@ #pragma once -#include +#include "utils/errors.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/security/meta_access_controller.cpp b/src/rdsn/src/runtime/security/meta_access_controller.cpp index 7c8c03b077..d06bc8cf08 100644 --- a/src/rdsn/src/runtime/security/meta_access_controller.cpp +++ b/src/rdsn/src/runtime/security/meta_access_controller.cpp @@ -17,10 +17,10 @@ #include "meta_access_controller.h" -#include -#include -#include -#include +#include "runtime/rpc/rpc_message.h" +#include "utils/flags.h" +#include "runtime/rpc/network.h" +#include "utils/fmt_logging.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/security/negotiation.cpp b/src/rdsn/src/runtime/security/negotiation.cpp index f2819e87fc..f5b7ee2911 100644 --- a/src/rdsn/src/runtime/security/negotiation.cpp +++ b/src/rdsn/src/runtime/security/negotiation.cpp @@ -20,9 +20,9 @@ #include "server_negotiation.h" #include "negotiation_utils.h" -#include -#include -#include +#include "utils/flags.h" +#include "utils/smart_pointers.h" +#include "utils/fmt_logging.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/security/negotiation.h b/src/rdsn/src/runtime/security/negotiation.h index adac0121ba..9bc63355c5 100644 --- a/src/rdsn/src/runtime/security/negotiation.h +++ b/src/rdsn/src/runtime/security/negotiation.h @@ -21,7 +21,7 @@ #include "sasl_wrapper.h" #include -#include +#include "runtime/rpc/rpc_holder.h" namespace dsn { class rpc_session; diff --git a/src/rdsn/src/runtime/security/negotiation_manager.cpp b/src/rdsn/src/runtime/security/negotiation_manager.cpp index d00b866008..52589afc01 100644 --- a/src/rdsn/src/runtime/security/negotiation_manager.cpp +++ b/src/rdsn/src/runtime/security/negotiation_manager.cpp @@ -20,11 +20,11 @@ #include "server_negotiation.h" #include "client_negotiation.h" -#include -#include -#include -#include -#include +#include "utils/flags.h" +#include "utils/zlocks.h" +#include "failure_detector/fd.code.definition.h" +#include "utils/fmt_logging.h" +#include "http/http_server.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/security/negotiation_manager.h b/src/rdsn/src/runtime/security/negotiation_manager.h index 10a8eceeed..f36adcbd12 100644 --- a/src/rdsn/src/runtime/security/negotiation_manager.h +++ b/src/rdsn/src/runtime/security/negotiation_manager.h @@ -19,7 +19,7 @@ #include "server_negotiation.h" -#include +#include "runtime/serverlet.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/security/replica_access_controller.cpp b/src/rdsn/src/runtime/security/replica_access_controller.cpp index 36c93bc021..30767a46fe 100644 --- a/src/rdsn/src/runtime/security/replica_access_controller.cpp +++ b/src/rdsn/src/runtime/security/replica_access_controller.cpp @@ -17,9 +17,9 @@ #include "replica_access_controller.h" -#include -#include -#include +#include "runtime/rpc/rpc_message.h" +#include "utils/fmt_logging.h" +#include "runtime/rpc/network.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/security/replica_access_controller.h b/src/rdsn/src/runtime/security/replica_access_controller.h index 427b279d0f..47ffd46b11 100644 --- a/src/rdsn/src/runtime/security/replica_access_controller.h +++ b/src/rdsn/src/runtime/security/replica_access_controller.h @@ -17,7 +17,7 @@ #pragma once -#include +#include "utils/synchronize.h" #include "access_controller.h" namespace dsn { diff --git a/src/rdsn/src/runtime/security/sasl_client_wrapper.cpp b/src/rdsn/src/runtime/security/sasl_client_wrapper.cpp index 766234e8e6..e2c498a778 100644 --- a/src/rdsn/src/runtime/security/sasl_client_wrapper.cpp +++ b/src/rdsn/src/runtime/security/sasl_client_wrapper.cpp @@ -18,8 +18,10 @@ #include "sasl_client_wrapper.h" #include -#include -#include + +#include "utils/blob.h" +#include "utils/fail_point.h" +#include "utils/flags.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/security/sasl_init.cpp b/src/rdsn/src/runtime/security/sasl_init.cpp index 35a6d72116..f7adf6443a 100644 --- a/src/rdsn/src/runtime/security/sasl_init.cpp +++ b/src/rdsn/src/runtime/security/sasl_init.cpp @@ -22,10 +22,10 @@ #include #include -#include -#include -#include -#include +#include "utils/api_utilities.h" +#include "utils/fmt_logging.h" +#include "utils/flags.h" +#include "utils/synchronize.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/security/sasl_init.h b/src/rdsn/src/runtime/security/sasl_init.h index 2baeb47cef..a15cda06b4 100644 --- a/src/rdsn/src/runtime/security/sasl_init.h +++ b/src/rdsn/src/runtime/security/sasl_init.h @@ -17,7 +17,7 @@ #pragma once -#include +#include "utils/errors.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/security/sasl_server_wrapper.cpp b/src/rdsn/src/runtime/security/sasl_server_wrapper.cpp index 7489f7b5c3..9fb108e507 100644 --- a/src/rdsn/src/runtime/security/sasl_server_wrapper.cpp +++ b/src/rdsn/src/runtime/security/sasl_server_wrapper.cpp @@ -18,8 +18,10 @@ #include "sasl_server_wrapper.h" #include -#include -#include + +#include "utils/blob.h" +#include "utils/flags.h" +#include "utils/fail_point.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/security/sasl_wrapper.cpp b/src/rdsn/src/runtime/security/sasl_wrapper.cpp index a2fdf9f724..0a243572ef 100644 --- a/src/rdsn/src/runtime/security/sasl_wrapper.cpp +++ b/src/rdsn/src/runtime/security/sasl_wrapper.cpp @@ -20,7 +20,7 @@ #include "sasl_client_wrapper.h" #include -#include +#include "utils/fail_point.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/security/sasl_wrapper.h b/src/rdsn/src/runtime/security/sasl_wrapper.h index e22320e023..e835c08440 100644 --- a/src/rdsn/src/runtime/security/sasl_wrapper.h +++ b/src/rdsn/src/runtime/security/sasl_wrapper.h @@ -17,7 +17,7 @@ #pragma once -#include +#include "utils/errors.h" typedef struct sasl_conn sasl_conn_t; diff --git a/src/rdsn/src/runtime/security/server_negotiation.cpp b/src/rdsn/src/runtime/security/server_negotiation.cpp index 62dc929a2b..467421f6c2 100644 --- a/src/rdsn/src/runtime/security/server_negotiation.cpp +++ b/src/rdsn/src/runtime/security/server_negotiation.cpp @@ -20,9 +20,9 @@ #include "sasl_init.h" #include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "utils/flags.h" +#include "utils/fail_point.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/security/server_negotiation.h b/src/rdsn/src/runtime/security/server_negotiation.h index ada7aad99f..aeb6e02665 100644 --- a/src/rdsn/src/runtime/security/server_negotiation.h +++ b/src/rdsn/src/runtime/security/server_negotiation.h @@ -19,7 +19,7 @@ #include "negotiation.h" -#include +#include "utils/errors.h" namespace dsn { namespace security { diff --git a/src/rdsn/include/dsn/cpp/serverlet.h b/src/rdsn/src/runtime/serverlet.h similarity index 98% rename from src/rdsn/include/dsn/cpp/serverlet.h rename to src/rdsn/src/runtime/serverlet.h index f446cdf2e7..8aeeebefa9 100644 --- a/src/rdsn/include/dsn/cpp/serverlet.h +++ b/src/rdsn/src/runtime/serverlet.h @@ -25,9 +25,9 @@ */ #pragma once -#include -#include -#include +#include "runtime/service_app.h" +#include "runtime/rpc/rpc_holder.h" +#include "runtime/rpc/serialization.h" namespace dsn { /*! diff --git a/src/rdsn/src/runtime/service_api_c.cpp b/src/rdsn/src/runtime/service_api_c.cpp index d43b71a250..bd36bf04fc 100644 --- a/src/rdsn/src/runtime/service_api_c.cpp +++ b/src/rdsn/src/runtime/service_api_c.cpp @@ -32,16 +32,20 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "runtime/tool_api.h" +#include "utils/command_manager.h" +#include "runtime/rpc/serialization.h" +#include "utils/filesystem.h" +#include "utils/process_utils.h" +#include "utils/flags.h" +#include "utils/time_utils.h" +#include "utils/errors.h" +#include "utils/fmt_logging.h" #ifdef DSN_ENABLE_GPERF #include diff --git a/src/rdsn/include/dsn/cpp/service_app.h b/src/rdsn/src/runtime/service_app.h similarity index 89% rename from src/rdsn/include/dsn/cpp/service_app.h rename to src/rdsn/src/runtime/service_app.h index 53bcd92367..c4713c7451 100644 --- a/src/rdsn/include/dsn/cpp/service_app.h +++ b/src/rdsn/src/runtime/service_app.h @@ -35,11 +35,19 @@ #pragma once -#include -#include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" + +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "utils/rpc_address.h" +#include "common/gpid.h" +#include "utils/factory_store.h" #include #include diff --git a/src/rdsn/src/runtime/service_engine.cpp b/src/rdsn/src/runtime/service_engine.cpp index dc7eb315a0..6e0dac2bc4 100644 --- a/src/rdsn/src/runtime/service_engine.cpp +++ b/src/rdsn/src/runtime/service_engine.cpp @@ -28,13 +28,13 @@ #include "runtime/task/task_engine.h" #include "runtime/rpc/rpc_engine.h" -#include -#include -#include -#include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "utils/filesystem.h" +#include "utils/smart_pointers.h" +#include "runtime/env_provider.h" +#include "utils/command_manager.h" +#include "runtime/tool_api.h" +#include "runtime/node_scoper.h" using namespace dsn::utils; diff --git a/src/rdsn/src/runtime/service_engine.h b/src/rdsn/src/runtime/service_engine.h index 8587ac56b8..404c793a50 100644 --- a/src/rdsn/src/runtime/service_engine.h +++ b/src/rdsn/src/runtime/service_engine.h @@ -37,13 +37,16 @@ #include -#include -#include -#include -#include -#include -#include -#include +#include "utils/ports.h" +#include "utils/singleton.h" +#include "utils/synchronize.h" +#include "runtime/global_config.h" +#include "runtime/task/task.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/service_app.h" namespace dsn { diff --git a/src/rdsn/src/runtime/sim_clock.h b/src/rdsn/src/runtime/sim_clock.h index ae6220efbe..df2c7ac947 100644 --- a/src/rdsn/src/runtime/sim_clock.h +++ b/src/rdsn/src/runtime/sim_clock.h @@ -17,7 +17,7 @@ #pragma once -#include +#include "utils/clock.h" #include "scheduler.h" namespace dsn { diff --git a/src/rdsn/src/runtime/simulator.cpp b/src/rdsn/src/runtime/simulator.cpp index 12753f3173..b81d7e7358 100644 --- a/src/rdsn/src/runtime/simulator.cpp +++ b/src/rdsn/src/runtime/simulator.cpp @@ -33,7 +33,7 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include +#include "runtime/simulator.h" #include "scheduler.h" #include "service_engine.h" diff --git a/src/rdsn/include/dsn/tool/simulator.h b/src/rdsn/src/runtime/simulator.h similarity index 88% rename from src/rdsn/include/dsn/tool/simulator.h rename to src/rdsn/src/runtime/simulator.h index dfea0166cd..3d37392dbf 100644 --- a/src/rdsn/include/dsn/tool/simulator.h +++ b/src/rdsn/src/runtime/simulator.h @@ -24,19 +24,10 @@ * THE SOFTWARE. */ -/* - * Description: - * the simulation tool (include simulation, replay, model-checking, ...) - * - * Revision history: - * Mar., 2015, @imzhenyu (Zhenyu Guo), first version - * xxxx-xx-xx, author, fix bug about xxx - */ - #pragma once -#include -#include +#include "runtime/tool_api.h" +#include "runtime/service_app.h" namespace dsn { namespace tools { diff --git a/src/rdsn/include/dsn/tool-api/async_calls.h b/src/rdsn/src/runtime/task/async_calls.h similarity index 96% rename from src/rdsn/include/dsn/tool-api/async_calls.h rename to src/rdsn/src/runtime/task/async_calls.h index dbbafd944c..6ab3f3028f 100644 --- a/src/rdsn/include/dsn/tool-api/async_calls.h +++ b/src/rdsn/src/runtime/task/async_calls.h @@ -26,11 +26,15 @@ #pragma once -#include -#include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/function_traits.h" +#include "aio/file_io.h" +#include "runtime/task/task_tracker.h" +#include "runtime/rpc/serialization.h" namespace dsn { diff --git a/src/rdsn/include/dsn/tool-api/future_types.h b/src/rdsn/src/runtime/task/future_types.h similarity index 95% rename from src/rdsn/include/dsn/tool-api/future_types.h rename to src/rdsn/src/runtime/task/future_types.h index ef5da018ea..e1eea51f48 100644 --- a/src/rdsn/include/dsn/tool-api/future_types.h +++ b/src/rdsn/src/runtime/task/future_types.h @@ -26,8 +26,8 @@ #pragma once #include -#include -#include +#include "utils/error_code.h" +#include "task.h" namespace dsn { typedef std::function err_callback; diff --git a/src/rdsn/src/runtime/task/hpc_task_queue.cpp b/src/rdsn/src/runtime/task/hpc_task_queue.cpp index d1aa6f13ca..840a88ef5f 100644 --- a/src/rdsn/src/runtime/task/hpc_task_queue.cpp +++ b/src/rdsn/src/runtime/task/hpc_task_queue.cpp @@ -24,15 +24,6 @@ * THE SOFTWARE. */ -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * xxxx-xx-xx, author, fix bug about xxx - */ - #include "hpc_task_queue.h" #include diff --git a/src/rdsn/src/runtime/task/hpc_task_queue.h b/src/rdsn/src/runtime/task/hpc_task_queue.h index e0a5225928..4625bad5d3 100644 --- a/src/rdsn/src/runtime/task/hpc_task_queue.h +++ b/src/rdsn/src/runtime/task/hpc_task_queue.h @@ -24,21 +24,12 @@ * THE SOFTWARE. */ -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * xxxx-xx-xx, author, fix bug about xxx - */ - #pragma once #include #include -#include +#include "task_queue.h" namespace dsn { namespace tools { diff --git a/src/rdsn/src/runtime/task/simple_task_queue.h b/src/rdsn/src/runtime/task/simple_task_queue.h index 94e15421d0..2922086bfd 100644 --- a/src/rdsn/src/runtime/task/simple_task_queue.h +++ b/src/rdsn/src/runtime/task/simple_task_queue.h @@ -26,8 +26,8 @@ #pragma once -#include -#include +#include "runtime/tool_api.h" +#include "utils/priority_queue.h" #include namespace dsn { diff --git a/src/rdsn/src/runtime/task/task.cpp b/src/rdsn/src/runtime/task/task.cpp index 792201b006..49f95d150d 100644 --- a/src/rdsn/src/runtime/task/task.cpp +++ b/src/rdsn/src/runtime/task/task.cpp @@ -24,24 +24,19 @@ * THE SOFTWARE. */ -/* - * Description: - * task is the execution of a piece of sequence code, which completes - * a meaningful application level task. - * - * Revision history: - * Mar., 2015, @imzhenyu (Zhenyu Guo), first version - * xxxx-xx-xx, author, fix bug about xxx - */ - -#include -#include -#include -#include -#include -#include -#include -#include +#include "task.h" + +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/zlocks.h" +#include "utils/utils.h" +#include "utils/synchronize.h" +#include "utils/rand.h" +#include "runtime/node_scoper.h" +#include "utils/fmt_logging.h" #include "task_engine.h" #include "runtime/service_engine.h" diff --git a/src/rdsn/include/dsn/tool-api/task.h b/src/rdsn/src/runtime/task/task.h similarity index 96% rename from src/rdsn/include/dsn/tool-api/task.h rename to src/rdsn/src/runtime/task/task.h index 8ceb71e49b..bbe960d514 100644 --- a/src/rdsn/include/dsn/tool-api/task.h +++ b/src/rdsn/src/runtime/task/task.h @@ -24,31 +24,24 @@ * THE SOFTWARE. */ -/* - * Description: - * the task abstraction in zion, as well as the derived various types of - * tasks in our system - * - * Revision history: - * Mar., 2015, @imzhenyu (Zhenyu Guo), first version - * xxxx-xx-xx, author, fix bug about xxx - */ - #pragma once #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "utils/ports.h" +#include "utils/extensible_object.h" +#include "utils/utils.h" +#include "utils/apply.h" +#include "utils/binary_writer.h" +#include "task_spec.h" +#include "task_tracker.h" +#include "runtime/rpc/rpc_message.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" namespace dsn { diff --git a/src/rdsn/src/runtime/task/task_code.cpp b/src/rdsn/src/runtime/task/task_code.cpp index 42dbb2085a..06cd3b0acf 100644 --- a/src/rdsn/src/runtime/task/task_code.cpp +++ b/src/rdsn/src/runtime/task/task_code.cpp @@ -24,9 +24,10 @@ * THE SOFTWARE. */ -#include -#include -#include +#include "task_code.h" + +#include "utils/customizable_id.h" +#include "task_spec.h" namespace dsn { diff --git a/src/rdsn/include/dsn/tool-api/task_code.h b/src/rdsn/src/runtime/task/task_code.h similarity index 98% rename from src/rdsn/include/dsn/tool-api/task_code.h rename to src/rdsn/src/runtime/task/task_code.h index 318e9df238..8695fa99aa 100644 --- a/src/rdsn/include/dsn/tool-api/task_code.h +++ b/src/rdsn/src/runtime/task/task_code.h @@ -26,9 +26,9 @@ #pragma once -#include -#include -#include +#include "utils/ports.h" +#include "utils/enum_helper.h" +#include "utils/threadpool_code.h" #include typedef enum dsn_task_type_t { diff --git a/src/rdsn/src/runtime/task/task_engine.cpp b/src/rdsn/src/runtime/task/task_engine.cpp index c9f18dfcf7..7236c668d7 100644 --- a/src/rdsn/src/runtime/task/task_engine.cpp +++ b/src/rdsn/src/runtime/task/task_engine.cpp @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#include -#include +#include "utils/fmt_logging.h" +#include "utils/command_manager.h" #include #include "task_engine.h" diff --git a/src/rdsn/src/runtime/task/task_engine.h b/src/rdsn/src/runtime/task/task_engine.h index 4175f1f71c..97f5f56ed1 100644 --- a/src/rdsn/src/runtime/task/task_engine.h +++ b/src/rdsn/src/runtime/task/task_engine.h @@ -36,10 +36,10 @@ #pragma once #include "runtime/service_engine.h" -#include -#include -#include -#include +#include "task_queue.h" +#include "task_worker.h" +#include "timer_service.h" +#include "utils/command_manager.h" namespace dsn { diff --git a/src/rdsn/src/runtime/task/task_engine.sim.cpp b/src/rdsn/src/runtime/task/task_engine.sim.cpp index b7ce80cb56..ed5e504aee 100644 --- a/src/rdsn/src/runtime/task/task_engine.sim.cpp +++ b/src/rdsn/src/runtime/task/task_engine.sim.cpp @@ -33,7 +33,7 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include +#include "utils/rand.h" #include "task_engine.sim.h" #include "runtime/scheduler.h" diff --git a/src/rdsn/src/runtime/task/task_engine.sim.h b/src/rdsn/src/runtime/task/task_engine.sim.h index 4dd54e0197..71eef89bbe 100644 --- a/src/rdsn/src/runtime/task/task_engine.sim.h +++ b/src/rdsn/src/runtime/task/task_engine.sim.h @@ -35,9 +35,9 @@ #pragma once -#include -#include -#include +#include "utils/priority_queue.h" +#include "timer_service.h" +#include "task_queue.h" #include "utils/zlock_provider.h" namespace dsn { diff --git a/src/rdsn/src/runtime/task/task_queue.cpp b/src/rdsn/src/runtime/task/task_queue.cpp index a4823c7b5f..a992efe9fe 100644 --- a/src/rdsn/src/runtime/task/task_queue.cpp +++ b/src/rdsn/src/runtime/task/task_queue.cpp @@ -24,10 +24,11 @@ * THE SOFTWARE. */ -#include +#include "task_queue.h" + #include "task_engine.h" -#include -#include +#include "runtime/rpc/network.h" +#include "utils/fmt_logging.h" #include "runtime/rpc/rpc_engine.h" namespace dsn { diff --git a/src/rdsn/include/dsn/tool-api/task_queue.h b/src/rdsn/src/runtime/task/task_queue.h similarity index 91% rename from src/rdsn/include/dsn/tool-api/task_queue.h rename to src/rdsn/src/runtime/task/task_queue.h index 9cc4f736c0..5019d305fb 100644 --- a/src/rdsn/include/dsn/tool-api/task_queue.h +++ b/src/rdsn/src/runtime/task/task_queue.h @@ -24,20 +24,12 @@ * THE SOFTWARE. */ -/* - * Description: - * task queue abstraction - * - * Revision history: - * Mar., 2015, @imzhenyu (Zhenyu Guo), first version - * xxxx-xx-xx, author, fix bug about xxx - */ - #pragma once -#include -#include -#include +#include "task.h" + +#include "perf_counter/perf_counter_wrapper.h" +#include "utils/dlib.h" namespace dsn { diff --git a/src/rdsn/src/runtime/task/task_spec.cpp b/src/rdsn/src/runtime/task/task_spec.cpp index 6b469ec865..53bee44705 100644 --- a/src/rdsn/src/runtime/task/task_spec.cpp +++ b/src/rdsn/src/runtime/task/task_spec.cpp @@ -24,22 +24,14 @@ * THE SOFTWARE. */ -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * xxxx-xx-xx, author, fix bug about xxx - */ +#include "task_spec.h" #include -#include -#include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "utils/command_manager.h" +#include "utils/threadpool_spec.h" +#include "utils/smart_pointers.h" namespace dsn { diff --git a/src/rdsn/include/dsn/tool-api/task_spec.h b/src/rdsn/src/runtime/task/task_spec.h similarity index 96% rename from src/rdsn/include/dsn/tool-api/task_spec.h rename to src/rdsn/src/runtime/task/task_spec.h index 25aad3d0ed..a6806b79e4 100644 --- a/src/rdsn/include/dsn/tool-api/task_spec.h +++ b/src/rdsn/src/runtime/task/task_spec.h @@ -35,17 +35,20 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "utils/utils.h" +#include "utils/config_helper.h" +#include "utils/enum_helper.h" +#include "utils/customizable_id.h" +#include "utils/join_point.h" +#include "utils/extensible_object.h" +#include "utils/exp_delay.h" +#include "utils/dlib.h" +#include "perf_counter/perf_counter.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "utils/api_utilities.h" ENUM_BEGIN(dsn_log_level_t, LOG_LEVEL_INVALID) ENUM_REG(LOG_LEVEL_INFORMATION) diff --git a/src/rdsn/src/runtime/task/task_tracker.cpp b/src/rdsn/src/runtime/task/task_tracker.cpp index f1ad6c7d76..a887868106 100644 --- a/src/rdsn/src/runtime/task/task_tracker.cpp +++ b/src/rdsn/src/runtime/task/task_tracker.cpp @@ -24,18 +24,10 @@ * THE SOFTWARE. */ -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * xxxx-xx-xx, author, fix bug about xxx - */ +#include "task_tracker.h" -#include -#include -#include +#include "task.h" +#include "runtime/tool_api.h" namespace dsn { diff --git a/src/rdsn/include/dsn/tool-api/task_tracker.h b/src/rdsn/src/runtime/task/task_tracker.h similarity index 98% rename from src/rdsn/include/dsn/tool-api/task_tracker.h rename to src/rdsn/src/runtime/task/task_tracker.h index 06b26cab2c..5d26d4c1bd 100644 --- a/src/rdsn/include/dsn/tool-api/task_tracker.h +++ b/src/rdsn/src/runtime/task/task_tracker.h @@ -36,10 +36,10 @@ #pragma once -#include -#include -#include -#include +#include "utils/link.h" +#include "utils/synchronize.h" +#include "utils/error_code.h" +#include "utils/api_utilities.h" #include namespace dsn { diff --git a/src/rdsn/src/runtime/task/task_worker.cpp b/src/rdsn/src/runtime/task/task_worker.cpp index 05a18b6d13..1f067967ff 100644 --- a/src/rdsn/src/runtime/task/task_worker.cpp +++ b/src/rdsn/src/runtime/task/task_worker.cpp @@ -29,8 +29,8 @@ #endif // defined(__linux__) #include -#include -#include +#include "utils/process_utils.h" +#include "utils/smart_pointers.h" #include "task_engine.h" diff --git a/src/rdsn/include/dsn/tool-api/task_worker.h b/src/rdsn/src/runtime/task/task_worker.h similarity index 94% rename from src/rdsn/include/dsn/tool-api/task_worker.h rename to src/rdsn/src/runtime/task/task_worker.h index e4f56c6bf9..f625df0149 100644 --- a/src/rdsn/include/dsn/tool-api/task_worker.h +++ b/src/rdsn/src/runtime/task/task_worker.h @@ -35,11 +35,11 @@ #pragma once -#include -#include -#include -#include -#include +#include "task_queue.h" +#include "utils/extensible_object.h" +#include "utils/synchronize.h" +#include "utils/dlib.h" +#include "perf_counter/perf_counter.h" #include namespace dsn { diff --git a/src/rdsn/include/dsn/tool-api/timer_service.h b/src/rdsn/src/runtime/task/timer_service.h similarity index 90% rename from src/rdsn/include/dsn/tool-api/timer_service.h rename to src/rdsn/src/runtime/task/timer_service.h index d2866cd007..86f4b775c9 100644 --- a/src/rdsn/include/dsn/tool-api/timer_service.h +++ b/src/rdsn/src/runtime/task/timer_service.h @@ -24,18 +24,9 @@ * THE SOFTWARE. */ -/* - * Description: - * timer service abstraction - * - * Revision history: - * Mar., 2015, @imzhenyu (Zhenyu Guo), first version - * xxxx-xx-xx, author, fix bug about xxx - */ - #pragma once -#include +#include "task.h" namespace dsn { class service_node; diff --git a/src/rdsn/src/runtime/test/async_call.cpp b/src/rdsn/src/runtime/test/async_call.cpp index 91a72d1327..cc1b0d7aa4 100644 --- a/src/rdsn/src/runtime/test/async_call.cpp +++ b/src/rdsn/src/runtime/test/async_call.cpp @@ -33,9 +33,22 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include -#include -#include +#include "runtime/task/async_calls.h" +#include "utils/thread_access_checker.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" #include #include diff --git a/src/rdsn/src/runtime/test/client_negotiation_test.cpp b/src/rdsn/src/runtime/test/client_negotiation_test.cpp index e60c2d66f2..ef7bd49371 100644 --- a/src/rdsn/src/runtime/test/client_negotiation_test.cpp +++ b/src/rdsn/src/runtime/test/client_negotiation_test.cpp @@ -20,8 +20,8 @@ #include "runtime/rpc/network.sim.h" #include -#include -#include +#include "utils/flags.h" +#include "utils/fail_point.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/test/corrupt_message.cpp b/src/rdsn/src/runtime/test/corrupt_message.cpp index 4382f80a83..333da4a9c2 100644 --- a/src/rdsn/src/runtime/test/corrupt_message.cpp +++ b/src/rdsn/src/runtime/test/corrupt_message.cpp @@ -27,8 +27,21 @@ #include #include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "runtime/task/async_calls.h" #include #include diff --git a/src/rdsn/src/runtime/test/lpc.cpp b/src/rdsn/src/runtime/test/lpc.cpp index e8d2fbb800..82cdd57cce 100644 --- a/src/rdsn/src/runtime/test/lpc.cpp +++ b/src/rdsn/src/runtime/test/lpc.cpp @@ -34,7 +34,20 @@ */ #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" #include "test_utils.h" DEFINE_TASK_CODE(LPC_TEST_HASH, TASK_PRIORITY_COMMON, THREAD_POOL_TEST_SERVER) diff --git a/src/rdsn/src/runtime/test/message_reader_test.cpp b/src/rdsn/src/runtime/test/message_reader_test.cpp index 0a1b53f822..e8123109c5 100644 --- a/src/rdsn/src/runtime/test/message_reader_test.cpp +++ b/src/rdsn/src/runtime/test/message_reader_test.cpp @@ -17,7 +17,7 @@ #include -#include +#include "runtime/rpc/message_parser.h" namespace dsn { diff --git a/src/rdsn/src/runtime/test/message_utils_test.cpp b/src/rdsn/src/runtime/test/message_utils_test.cpp index 8fd106316a..821aab90ac 100644 --- a/src/rdsn/src/runtime/test/message_utils_test.cpp +++ b/src/rdsn/src/runtime/test/message_utils_test.cpp @@ -24,9 +24,9 @@ * THE SOFTWARE. */ -#include -#include -#include +#include "runtime/message_utils.h" +#include "common/replication.codes.h" +#include "runtime/rpc/rpc_holder.h" #include namespace dsn { diff --git a/src/rdsn/src/runtime/test/meta_access_controller_test.cpp b/src/rdsn/src/runtime/test/meta_access_controller_test.cpp index 19215d7a86..2a7aa4b785 100644 --- a/src/rdsn/src/runtime/test/meta_access_controller_test.cpp +++ b/src/rdsn/src/runtime/test/meta_access_controller_test.cpp @@ -16,9 +16,24 @@ // under the License. #include -#include -#include -#include +#include "utils/flags.h" +#include "runtime/rpc/network.sim.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "common/replication_other_types.h" +#include "common/replication.codes.h" #include "runtime/security/access_controller.h" namespace dsn { diff --git a/src/rdsn/src/runtime/test/negotiation_manager_test.cpp b/src/rdsn/src/runtime/test/negotiation_manager_test.cpp index b5b41bd177..cbc2055248 100644 --- a/src/rdsn/src/runtime/test/negotiation_manager_test.cpp +++ b/src/rdsn/src/runtime/test/negotiation_manager_test.cpp @@ -20,9 +20,9 @@ #include "runtime/rpc/network.sim.h" #include -#include -#include -#include +#include "utils/flags.h" +#include "failure_detector/fd.code.definition.h" +#include "http/http_server_impl.h" #include "nfs/nfs_code_definition.h" namespace dsn { diff --git a/src/rdsn/src/runtime/test/netprovider.cpp b/src/rdsn/src/runtime/test/netprovider.cpp index 90e6bc1cc8..8ca4e73891 100644 --- a/src/rdsn/src/runtime/test/netprovider.cpp +++ b/src/rdsn/src/runtime/test/netprovider.cpp @@ -38,10 +38,23 @@ #include -#include - -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" + +#include "runtime/task/task.h" +#include "runtime/task/task_spec.h" #include "runtime/rpc/asio_net_provider.h" #include "runtime/rpc/network.sim.h" diff --git a/src/rdsn/src/runtime/test/pipeline_test.cpp b/src/rdsn/src/runtime/test/pipeline_test.cpp index 4b574d21ec..6ab745d0e4 100644 --- a/src/rdsn/src/runtime/test/pipeline_test.cpp +++ b/src/rdsn/src/runtime/test/pipeline_test.cpp @@ -25,8 +25,23 @@ */ #include -#include -#include +#include "runtime/pipeline.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "common/replication_other_types.h" +#include "common/replication.codes.h" namespace dsn { diff --git a/src/rdsn/src/runtime/test/replica_access_controller_test.cpp b/src/rdsn/src/runtime/test/replica_access_controller_test.cpp index a2ea3418ae..345c03c61f 100644 --- a/src/rdsn/src/runtime/test/replica_access_controller_test.cpp +++ b/src/rdsn/src/runtime/test/replica_access_controller_test.cpp @@ -16,8 +16,23 @@ // under the License. #include -#include -#include +#include "utils/flags.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "common/replication_other_types.h" +#include "common/replication.codes.h" #include "runtime/security/replica_access_controller.h" #include "runtime/rpc/network.sim.h" diff --git a/src/rdsn/src/runtime/test/rpc.cpp b/src/rdsn/src/runtime/test/rpc.cpp index 6a9c03c35f..aecf56dbfc 100644 --- a/src/rdsn/src/runtime/test/rpc.cpp +++ b/src/rdsn/src/runtime/test/rpc.cpp @@ -31,11 +31,24 @@ #include #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" -#include -#include -#include +#include "utils/priority_queue.h" +#include "runtime/rpc/group_address.h" +#include "runtime/task/async_calls.h" #include "test_utils.h" diff --git a/src/rdsn/src/runtime/test/rpc_holder_test.cpp b/src/rdsn/src/runtime/test/rpc_holder_test.cpp index 1cb5eb0dbf..ca6c695d88 100644 --- a/src/rdsn/src/runtime/test/rpc_holder_test.cpp +++ b/src/rdsn/src/runtime/test/rpc_holder_test.cpp @@ -24,9 +24,9 @@ * THE SOFTWARE. */ -#include -#include -#include +#include "runtime/rpc/rpc_holder.h" +#include "common/serialization_helper/dsn.layer2_types.h" +#include "runtime/message_utils.h" #include diff --git a/src/rdsn/src/runtime/test/rpc_message.cpp b/src/rdsn/src/runtime/test/rpc_message.cpp index f47a04b8e7..9e8f006990 100644 --- a/src/rdsn/src/runtime/test/rpc_message.cpp +++ b/src/rdsn/src/runtime/test/rpc_message.cpp @@ -34,8 +34,8 @@ */ #include "runtime/message_utils.cpp" -#include -#include +#include "utils/crc.h" +#include "runtime/rpc/rpc_message.h" #include using namespace ::dsn; diff --git a/src/rdsn/src/runtime/test/server_negotiation_test.cpp b/src/rdsn/src/runtime/test/server_negotiation_test.cpp index 175e99eaf6..57a7d9ce3e 100644 --- a/src/rdsn/src/runtime/test/server_negotiation_test.cpp +++ b/src/rdsn/src/runtime/test/server_negotiation_test.cpp @@ -20,7 +20,7 @@ #include "runtime/rpc/network.sim.h" #include -#include +#include "utils/fail_point.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/runtime/test/service_api_c.cpp b/src/rdsn/src/runtime/test/service_api_c.cpp index 6bb3a46b6b..25640e6efc 100644 --- a/src/rdsn/src/runtime/test/service_api_c.cpp +++ b/src/rdsn/src/runtime/test/service_api_c.cpp @@ -33,16 +33,23 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include -#include -#include -#include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "runtime/tool_api.h" +#include "aio/file_io.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "utils/zlocks.h" +#include "utils/utils.h" +#include "utils/filesystem.h" #include #include -#include +#include "utils/rand.h" #include "runtime/service_engine.h" using namespace dsn; diff --git a/src/rdsn/src/runtime/test/sim_lock.cpp b/src/rdsn/src/runtime/test/sim_lock.cpp index 95b54ace03..26cf1abc0c 100644 --- a/src/rdsn/src/runtime/test/sim_lock.cpp +++ b/src/rdsn/src/runtime/test/sim_lock.cpp @@ -33,12 +33,19 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include -#include -#include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "runtime/tool_api.h" +#include "runtime/task/task.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "utils/utils.h" +#include "utils/synchronize.h" #include #include #include "runtime/service_engine.h" diff --git a/src/rdsn/src/runtime/test/task_engine.cpp b/src/rdsn/src/runtime/test/task_engine.cpp index 240ea9f08a..e2688dfc3d 100644 --- a/src/rdsn/src/runtime/test/task_engine.cpp +++ b/src/rdsn/src/runtime/test/task_engine.cpp @@ -35,7 +35,7 @@ #include "runtime/task/task_engine.h" #include "test_utils.h" -#include +#include "runtime/tool_api.h" #include #include diff --git a/src/rdsn/src/runtime/test/task_test.cpp b/src/rdsn/src/runtime/test/task_test.cpp index c784d92ed5..fa31c7d654 100644 --- a/src/rdsn/src/runtime/test/task_test.cpp +++ b/src/rdsn/src/runtime/test/task_test.cpp @@ -15,10 +15,11 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "runtime/task/task.h" +#include "runtime/task/task_code.h" + #include -#include +#include "aio/file_io.h" namespace dsn { diff --git a/src/rdsn/src/runtime/test/test_utils.h b/src/rdsn/src/runtime/test/test_utils.h index 1d0f9b5ff3..14d44222a6 100644 --- a/src/rdsn/src/runtime/test/test_utils.h +++ b/src/rdsn/src/runtime/test/test_utils.h @@ -35,9 +35,22 @@ #pragma once -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "runtime/task/task.h" +#include "runtime/task/task_worker.h" #include #include diff --git a/src/rdsn/src/runtime/test/thrift_message_parser_test.cpp b/src/rdsn/src/runtime/test/thrift_message_parser_test.cpp index fefaab11df..a9987c48a6 100644 --- a/src/rdsn/src/runtime/test/thrift_message_parser_test.cpp +++ b/src/rdsn/src/runtime/test/thrift_message_parser_test.cpp @@ -16,10 +16,10 @@ // under the License. #include -#include -#include -#include -#include +#include "utils/crc.h" +#include "utils/endians.h" +#include "common/serialization_helper/thrift_helper.h" +#include "common/serialization_helper/dsn.layer2_types.h" #include "runtime/rpc/thrift_message_parser.h" diff --git a/src/rdsn/src/runtime/threadpool_code.cpp b/src/rdsn/src/runtime/threadpool_code.cpp index 055aa3f4f2..48a050e228 100644 --- a/src/rdsn/src/runtime/threadpool_code.cpp +++ b/src/rdsn/src/runtime/threadpool_code.cpp @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#include -#include +#include "utils/threadpool_code.h" +#include "utils/customizable_id.h" namespace dsn { diff --git a/src/rdsn/src/runtime/tool_api.cpp b/src/rdsn/src/runtime/tool_api.cpp index 5a294073d4..75cf821c44 100644 --- a/src/rdsn/src/runtime/tool_api.cpp +++ b/src/rdsn/src/runtime/tool_api.cpp @@ -33,9 +33,9 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include -#include -#include +#include "runtime/tool_api.h" +#include "utils/factory_store.h" +#include "utils/singleton_store.h" #include "runtime/service_engine.h" #include "runtime/rpc/message_parser_manager.h" diff --git a/src/rdsn/include/dsn/tool_api.h b/src/rdsn/src/runtime/tool_api.h similarity index 94% rename from src/rdsn/include/dsn/tool_api.h rename to src/rdsn/src/runtime/tool_api.h index 8412012a2d..8876cfb2b7 100644 --- a/src/rdsn/include/dsn/tool_api.h +++ b/src/rdsn/src/runtime/tool_api.h @@ -51,15 +51,15 @@ Component providers define the interface for the local components (e.g., network #pragma once // providers -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "utils/factory_store.h" +#include "runtime/task/task_queue.h" +#include "runtime/task/task_worker.h" +#include "runtime/rpc/network.h" +#include "runtime/env_provider.h" +#include "runtime/rpc/message_parser.h" +#include "utils/logging_provider.h" +#include "runtime/task/timer_service.h" +#include "utils/sys_exit_hook.h" namespace dsn { namespace tools { diff --git a/src/rdsn/src/runtime/tracer.cpp b/src/rdsn/src/runtime/tracer.cpp index ce937b053b..a033d3834f 100644 --- a/src/rdsn/src/runtime/tracer.cpp +++ b/src/rdsn/src/runtime/tracer.cpp @@ -33,10 +33,10 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include -#include -#include -#include +#include "runtime/tracer.h" +#include "utils/filesystem.h" +#include "utils/command_manager.h" +#include "aio/aio_task.h" namespace dsn { namespace tools { diff --git a/src/rdsn/include/dsn/toollet/tracer.h b/src/rdsn/src/runtime/tracer.h similarity index 98% rename from src/rdsn/include/dsn/toollet/tracer.h rename to src/rdsn/src/runtime/tracer.h index fb144c048b..72e6c6b191 100644 --- a/src/rdsn/include/dsn/toollet/tracer.h +++ b/src/rdsn/src/runtime/tracer.h @@ -36,7 +36,7 @@ #pragma once -#include +#include "runtime/tool_api.h" /*! @defgroup tracer Tracer diff --git a/src/rdsn/src/runtime/zlocks.cpp b/src/rdsn/src/runtime/zlocks.cpp index 88bceb6c35..5d5afc2705 100644 --- a/src/rdsn/src/runtime/zlocks.cpp +++ b/src/rdsn/src/runtime/zlocks.cpp @@ -33,8 +33,8 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include -#include +#include "utils/factory_store.h" +#include "utils/zlocks.h" #include "utils/zlock_provider.h" #include "runtime/service_engine.h" diff --git a/src/rdsn/src/tools/mutation_log_tool.cpp b/src/rdsn/src/tools/mutation_log_tool.cpp index 706c0b49b5..b2a7058b86 100644 --- a/src/rdsn/src/tools/mutation_log_tool.cpp +++ b/src/rdsn/src/tools/mutation_log_tool.cpp @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#include -#include +#include "mutation_log_tool.h" +#include "utils/time_utils.h" #include "replica/mutation_log.h" namespace dsn { diff --git a/src/rdsn/include/dsn/dist/replication/mutation_log_tool.h b/src/rdsn/src/tools/mutation_log_tool.h similarity index 97% rename from src/rdsn/include/dsn/dist/replication/mutation_log_tool.h rename to src/rdsn/src/tools/mutation_log_tool.h index 31e575b2c6..40d2db4464 100644 --- a/src/rdsn/include/dsn/dist/replication/mutation_log_tool.h +++ b/src/rdsn/src/tools/mutation_log_tool.h @@ -38,7 +38,7 @@ #include #include #include -#include +#include "runtime/rpc/rpc_message.h" namespace dsn { namespace replication { diff --git a/src/rdsn/include/dsn/utility/TokenBucket.h b/src/rdsn/src/utils/TokenBucket.h similarity index 99% rename from src/rdsn/include/dsn/utility/TokenBucket.h rename to src/rdsn/src/utils/TokenBucket.h index 07ee4547eb..9a5a2327d8 100644 --- a/src/rdsn/include/dsn/utility/TokenBucket.h +++ b/src/rdsn/src/utils/TokenBucket.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include "utils/ports.h" namespace folly { diff --git a/src/rdsn/include/dsn/utility/absl/base/internal/invoke.h b/src/rdsn/src/utils/absl/base/internal/invoke.h similarity index 100% rename from src/rdsn/include/dsn/utility/absl/base/internal/invoke.h rename to src/rdsn/src/utils/absl/base/internal/invoke.h diff --git a/src/rdsn/include/dsn/utility/absl/utility/utility.h b/src/rdsn/src/utils/absl/utility/utility.h similarity index 99% rename from src/rdsn/include/dsn/utility/absl/utility/utility.h rename to src/rdsn/src/utils/absl/utility/utility.h index 1533bf5505..10f03b1e8c 100644 --- a/src/rdsn/include/dsn/utility/absl/utility/utility.h +++ b/src/rdsn/src/utils/absl/utility/utility.h @@ -44,7 +44,7 @@ #include #include -#include +#include "utils/absl/base/internal/invoke.h" // make namespace absl internal of dsn to solve redefine error with absl in s2geometry namespace dsn { diff --git a/src/rdsn/src/utils/alloc.cpp b/src/rdsn/src/utils/alloc.cpp index fbf641a7e2..b2028b6367 100644 --- a/src/rdsn/src/utils/alloc.cpp +++ b/src/rdsn/src/utils/alloc.cpp @@ -15,11 +15,11 @@ // specific language governing permissions and limitations // under the License. -#include +#include "utils/alloc.h" #include -#include +#include "utils/safe_strerror_posix.h" namespace dsn { diff --git a/src/rdsn/include/dsn/utility/alloc.h b/src/rdsn/src/utils/alloc.h similarity index 96% rename from src/rdsn/include/dsn/utility/alloc.h rename to src/rdsn/src/utils/alloc.h index 6a5d63e7ce..df07d19824 100644 --- a/src/rdsn/include/dsn/utility/alloc.h +++ b/src/rdsn/src/utils/alloc.h @@ -22,9 +22,9 @@ #include #include -#include -#include -#include +#include "utils/api_utilities.h" +#include "utils/fmt_logging.h" +#include "utils/ports.h" namespace dsn { diff --git a/src/rdsn/include/dsn/c/api_utilities.h b/src/rdsn/src/utils/api_utilities.h similarity index 96% rename from src/rdsn/include/dsn/c/api_utilities.h rename to src/rdsn/src/utils/api_utilities.h index 828b1f9dc8..209ab83cdb 100644 --- a/src/rdsn/include/dsn/c/api_utilities.h +++ b/src/rdsn/src/utils/api_utilities.h @@ -24,19 +24,15 @@ * THE SOFTWARE. */ -/* - * Description: - * useful utilities in rDSN exposed via C API - * - * Revision history: - * Feb., 2016, @imzhenyu (Zhenyu Guo), first version - * xxxx-xx-xx, author, fix bug about xxx - */ +// some useful utility functions provided by rDSN, +// such as logging, performance counter, checksum, +// command line interface registration and invocation, +// etc. #pragma once -#include -#include +#include "common/api_common.h" +#include "ports.h" /*! @defgroup logging Logging Service diff --git a/src/rdsn/include/dsn/utility/apply.h b/src/rdsn/src/utils/apply.h similarity index 96% rename from src/rdsn/include/dsn/utility/apply.h rename to src/rdsn/src/utils/apply.h index 41b6f64e7c..6fa1ca711e 100644 --- a/src/rdsn/include/dsn/utility/apply.h +++ b/src/rdsn/src/utils/apply.h @@ -26,7 +26,7 @@ #pragma once -#include +#include "utils/absl/utility/utility.h" namespace dsn { diff --git a/src/rdsn/include/dsn/utility/autoref_ptr.h b/src/rdsn/src/utils/autoref_ptr.h similarity index 100% rename from src/rdsn/include/dsn/utility/autoref_ptr.h rename to src/rdsn/src/utils/autoref_ptr.h diff --git a/src/rdsn/src/utils/binary_reader.cpp b/src/rdsn/src/utils/binary_reader.cpp index 622409a3ff..1937204dab 100644 --- a/src/rdsn/src/utils/binary_reader.cpp +++ b/src/rdsn/src/utils/binary_reader.cpp @@ -24,9 +24,10 @@ * THE SOFTWARE. */ -#include -#include -#include +#include "binary_reader.h" + +#include "utils.h" +#include "api_utilities.h" namespace dsn { diff --git a/src/rdsn/include/dsn/utility/binary_reader.h b/src/rdsn/src/utils/binary_reader.h similarity index 99% rename from src/rdsn/include/dsn/utility/binary_reader.h rename to src/rdsn/src/utils/binary_reader.h index cfb86e98b0..59a9f91efc 100644 --- a/src/rdsn/include/dsn/utility/binary_reader.h +++ b/src/rdsn/src/utils/binary_reader.h @@ -27,9 +27,11 @@ #pragma once #include -#include + #include +#include "utils/blob.h" + namespace dsn { class binary_reader { diff --git a/src/rdsn/src/utils/binary_writer.cpp b/src/rdsn/src/utils/binary_writer.cpp index 5d291c9a49..fc0f6ed321 100644 --- a/src/rdsn/src/utils/binary_writer.cpp +++ b/src/rdsn/src/utils/binary_writer.cpp @@ -24,8 +24,9 @@ * THE SOFTWARE. */ -#include -#include +#include "binary_writer.h" + +#include "utils.h" namespace dsn { int binary_writer::_reserved_size_per_buffer_static = 256; diff --git a/src/rdsn/include/dsn/utility/binary_writer.h b/src/rdsn/src/utils/binary_writer.h similarity index 99% rename from src/rdsn/include/dsn/utility/binary_writer.h rename to src/rdsn/src/utils/binary_writer.h index 7be96b45e2..97053e29ca 100644 --- a/src/rdsn/include/dsn/utility/binary_writer.h +++ b/src/rdsn/src/utils/binary_writer.h @@ -26,9 +26,10 @@ #pragma once -#include #include +#include "blob.h" + namespace dsn { class binary_writer diff --git a/src/rdsn/include/dsn/utility/blob.h b/src/rdsn/src/utils/blob.h similarity index 77% rename from src/rdsn/include/dsn/utility/blob.h rename to src/rdsn/src/utils/blob.h index 38105a3435..e5c541ec3b 100644 --- a/src/rdsn/include/dsn/utility/blob.h +++ b/src/rdsn/src/utils/blob.h @@ -27,8 +27,12 @@ #pragma once #include + +#include #include +#include "utils.h" + namespace dsn { /// dsn::blob is a special thrift type that's not generated by thrift compiler, @@ -152,7 +156,6 @@ class blob return std::string(_data, _length); } - // for serialization in thrift format uint32_t read(::apache::thrift::protocol::TProtocol *iprot); uint32_t write(::apache::thrift::protocol::TProtocol *oprot) const; @@ -164,4 +167,46 @@ class blob unsigned int _length{0}; // data length }; +class blob_string +{ +private: + blob &_buffer; + +public: + blob_string(blob &bb) : _buffer(bb) {} + + void clear() { _buffer.assign(std::shared_ptr(nullptr), 0, 0); } + void resize(std::size_t new_size) + { + std::shared_ptr b(utils::make_shared_array(new_size)); + _buffer.assign(b, 0, static_cast(new_size)); + } + void assign(const char *ptr, std::size_t size) + { + std::shared_ptr b(utils::make_shared_array(size)); + memcpy(b.get(), ptr, size); + _buffer.assign(b, 0, static_cast(size)); + } + const char *data() const { return _buffer.data(); } + size_t size() const { return _buffer.length(); } + + char &operator[](int pos) { return const_cast(_buffer.data())[pos]; } +}; + +inline uint32_t blob::read(apache::thrift::protocol::TProtocol *iprot) +{ + // for optimization, it is dangerous if the oprot is not a binary proto + apache::thrift::protocol::TBinaryProtocol *binary_proto = + static_cast(iprot); + blob_string str(*this); + return binary_proto->readString(str); +} + +inline uint32_t blob::write(apache::thrift::protocol::TProtocol *oprot) const +{ + apache::thrift::protocol::TBinaryProtocol *binary_proto = + static_cast(oprot); + return binary_proto->writeString(blob_string(const_cast(*this))); +} + } // namespace dsn diff --git a/src/rdsn/include/dsn/utility/casts.h b/src/rdsn/src/utils/casts.h similarity index 100% rename from src/rdsn/include/dsn/utility/casts.h rename to src/rdsn/src/utils/casts.h diff --git a/src/rdsn/include/dsn/utility/chrono_literals.h b/src/rdsn/src/utils/chrono_literals.h similarity index 100% rename from src/rdsn/include/dsn/utility/chrono_literals.h rename to src/rdsn/src/utils/chrono_literals.h diff --git a/src/rdsn/src/utils/clock.cpp b/src/rdsn/src/utils/clock.cpp index 46d80741c5..2ad9c0eeb3 100644 --- a/src/rdsn/src/utils/clock.cpp +++ b/src/rdsn/src/utils/clock.cpp @@ -15,10 +15,11 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include -#include +#include "clock.h" + +#include "time_utils.h" +#include "dlib.h" +#include "smart_pointers.h" DSN_API uint64_t dsn_now_ns() { return dsn::utils::clock::instance()->now_ns(); } diff --git a/src/rdsn/include/dsn/utility/clock.h b/src/rdsn/src/utils/clock.h similarity index 100% rename from src/rdsn/include/dsn/utility/clock.h rename to src/rdsn/src/utils/clock.h diff --git a/src/rdsn/src/utils/command_manager.cpp b/src/rdsn/src/utils/command_manager.cpp index b2b77f4d47..5ec71d593a 100644 --- a/src/rdsn/src/utils/command_manager.cpp +++ b/src/rdsn/src/utils/command_manager.cpp @@ -28,8 +28,8 @@ #include #include -#include -#include +#include "utils/utils.h" +#include "utils/command_manager.h" namespace dsn { diff --git a/src/rdsn/include/dsn/tool-api/command_manager.h b/src/rdsn/src/utils/command_manager.h similarity index 96% rename from src/rdsn/include/dsn/tool-api/command_manager.h rename to src/rdsn/src/utils/command_manager.h index 1c784d3a3e..c729763092 100644 --- a/src/rdsn/include/dsn/tool-api/command_manager.h +++ b/src/rdsn/src/utils/command_manager.h @@ -26,11 +26,12 @@ #pragma once -#include -#include -#include #include -#include + +#include "utils/api_utilities.h" +#include "utils/autoref_ptr.h" +#include "utils/singleton.h" +#include "utils/synchronize.h" namespace dsn { diff --git a/src/rdsn/src/utils/config_api.cpp b/src/rdsn/src/utils/config_api.cpp index a184c322c1..da67c208a5 100644 --- a/src/rdsn/src/utils/config_api.cpp +++ b/src/rdsn/src/utils/config_api.cpp @@ -25,8 +25,8 @@ */ #include -#include -#include +#include "utils/config_api.h" +#include "utils/configuration.h" dsn::configuration g_config; diff --git a/src/rdsn/include/dsn/utility/config_api.h b/src/rdsn/src/utils/config_api.h similarity index 100% rename from src/rdsn/include/dsn/utility/config_api.h rename to src/rdsn/src/utils/config_api.h diff --git a/src/rdsn/include/dsn/utility/config_helper.h b/src/rdsn/src/utils/config_helper.h similarity index 99% rename from src/rdsn/include/dsn/utility/config_helper.h rename to src/rdsn/src/utils/config_helper.h index 458230b120..aeda3048c9 100644 --- a/src/rdsn/include/dsn/utility/config_helper.h +++ b/src/rdsn/src/utils/config_helper.h @@ -26,8 +26,8 @@ #pragma once -#include -#include +#include "utils/config_api.h" +#include "utils/strings.h" /// you can use following macros to implement a function called "read_config" /// to initialize a structure from the configuration file quickly diff --git a/src/rdsn/src/utils/configuration.cpp b/src/rdsn/src/utils/configuration.cpp index 09b96e8e76..c77d63a590 100644 --- a/src/rdsn/src/utils/configuration.cpp +++ b/src/rdsn/src/utils/configuration.cpp @@ -38,10 +38,10 @@ #include #include -#include -#include -#include -#include +#include "utils/utils.h" +#include "utils/filesystem.h" +#include "utils/strings.h" +#include "utils/configuration.h" namespace dsn { diff --git a/src/rdsn/include/dsn/utility/configuration.h b/src/rdsn/src/utils/configuration.h similarity index 99% rename from src/rdsn/include/dsn/utility/configuration.h rename to src/rdsn/src/utils/configuration.h index dcbea1a5ca..a9acafb0a2 100644 --- a/src/rdsn/include/dsn/utility/configuration.h +++ b/src/rdsn/src/utils/configuration.h @@ -35,7 +35,9 @@ #include #include #include -#include +#include + +#include "string_conv.h" namespace dsn { diff --git a/src/rdsn/src/utils/coredump.posix.cpp b/src/rdsn/src/utils/coredump.posix.cpp index 41d327ad57..c421f30a33 100644 --- a/src/rdsn/src/utils/coredump.posix.cpp +++ b/src/rdsn/src/utils/coredump.posix.cpp @@ -25,10 +25,10 @@ */ #include "coredump.h" -#include +#include "runtime/tool_api.h" #include #include -#include +#include "runtime/app_model.h" namespace dsn { namespace utils { diff --git a/src/rdsn/src/utils/crc.cpp b/src/rdsn/src/utils/crc.cpp index 87773bfb4a..b0d608eba8 100644 --- a/src/rdsn/src/utils/crc.cpp +++ b/src/rdsn/src/utils/crc.cpp @@ -25,7 +25,7 @@ */ #include -#include +#include "utils/crc.h" namespace dsn { namespace utils { diff --git a/src/rdsn/include/dsn/utility/crc.h b/src/rdsn/src/utils/crc.h similarity index 100% rename from src/rdsn/include/dsn/utility/crc.h rename to src/rdsn/src/utils/crc.h diff --git a/src/rdsn/include/dsn/utility/customizable_id.h b/src/rdsn/src/utils/customizable_id.h similarity index 96% rename from src/rdsn/include/dsn/utility/customizable_id.h rename to src/rdsn/src/utils/customizable_id.h index 499aff95de..6ce09428de 100644 --- a/src/rdsn/include/dsn/utility/customizable_id.h +++ b/src/rdsn/src/utils/customizable_id.h @@ -28,16 +28,12 @@ * Description: * dynamic and seperated string to/from integer id mapping * in constrast to defining all enums in a single file - * - * Revision history: - * Mar., 2015, @imzhenyu (Zhenyu Guo), first version - * xxxx-xx-xx, author, fix bug about xxx */ #pragma once -#include -#include +#include "singleton.h" +#include "ports.h" #include #include #include diff --git a/src/rdsn/include/dsn/utility/defer.h b/src/rdsn/src/utils/defer.h similarity index 100% rename from src/rdsn/include/dsn/utility/defer.h rename to src/rdsn/src/utils/defer.h diff --git a/src/rdsn/include/dsn/dist/distributed_lock_service.h b/src/rdsn/src/utils/distributed_lock_service.h similarity index 93% rename from src/rdsn/include/dsn/dist/distributed_lock_service.h rename to src/rdsn/src/utils/distributed_lock_service.h index 6f6526b42c..58470797e9 100644 --- a/src/rdsn/include/dsn/dist/distributed_lock_service.h +++ b/src/rdsn/src/utils/distributed_lock_service.h @@ -41,9 +41,22 @@ #pragma once -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "utils/error_code.h" +#include "runtime/task/future_types.h" #include #include #include diff --git a/src/rdsn/include/dsn/utility/dlib.h b/src/rdsn/src/utils/dlib.h similarity index 100% rename from src/rdsn/include/dsn/utility/dlib.h rename to src/rdsn/src/utils/dlib.h diff --git a/src/rdsn/include/dsn/utility/endians.h b/src/rdsn/src/utils/endians.h similarity index 96% rename from src/rdsn/include/dsn/utility/endians.h rename to src/rdsn/src/utils/endians.h index 5a3f751a68..49868d0895 100644 --- a/src/rdsn/include/dsn/utility/endians.h +++ b/src/rdsn/src/utils/endians.h @@ -20,10 +20,10 @@ #include #include -#include -#include -#include -#include +#include "api_utilities.h" +#include "fmt_logging.h" +#include "ports.h" +#include "string_view.h" namespace dsn { diff --git a/src/rdsn/include/dsn/utility/enum_helper.h b/src/rdsn/src/utils/enum_helper.h similarity index 100% rename from src/rdsn/include/dsn/utility/enum_helper.h rename to src/rdsn/src/utils/enum_helper.h diff --git a/src/rdsn/src/utils/error_code.cpp b/src/rdsn/src/utils/error_code.cpp index bde7938655..3b3cb8442c 100644 --- a/src/rdsn/src/utils/error_code.cpp +++ b/src/rdsn/src/utils/error_code.cpp @@ -23,7 +23,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include +#include "utils/error_code.h" namespace dsn { /*static*/ diff --git a/src/rdsn/include/dsn/utility/error_code.h b/src/rdsn/src/utils/error_code.h similarity index 99% rename from src/rdsn/include/dsn/utility/error_code.h rename to src/rdsn/src/utils/error_code.h index e5a9169f6b..94256afebf 100644 --- a/src/rdsn/include/dsn/utility/error_code.h +++ b/src/rdsn/src/utils/error_code.h @@ -26,7 +26,7 @@ #pragma once -#include +#include "customizable_id.h" #include namespace dsn { diff --git a/src/rdsn/include/dsn/utility/errors.h b/src/rdsn/src/utils/errors.h similarity index 97% rename from src/rdsn/include/dsn/utility/errors.h rename to src/rdsn/src/utils/errors.h index 8515c8719a..cefa194da4 100644 --- a/src/rdsn/include/dsn/utility/errors.h +++ b/src/rdsn/src/utils/errors.h @@ -26,10 +26,10 @@ #pragma once -#include -#include -#include -#include +#include "utils/error_code.h" +#include "utils/smart_pointers.h" +#include "utils/string_view.h" +#include "utils/api_utilities.h" #include diff --git a/src/rdsn/include/dsn/utility/exp_delay.h b/src/rdsn/src/utils/exp_delay.h similarity index 99% rename from src/rdsn/include/dsn/utility/exp_delay.h rename to src/rdsn/src/utils/exp_delay.h index 0a75a27538..d3d950ebaf 100644 --- a/src/rdsn/include/dsn/utility/exp_delay.h +++ b/src/rdsn/src/utils/exp_delay.h @@ -35,7 +35,7 @@ #pragma once -#include +#include "utils/singleton.h" #include #include diff --git a/src/rdsn/include/dsn/utility/extensible_object.h b/src/rdsn/src/utils/extensible_object.h similarity index 99% rename from src/rdsn/include/dsn/utility/extensible_object.h rename to src/rdsn/src/utils/extensible_object.h index acf3c9ffb3..56d25bd9cc 100644 --- a/src/rdsn/include/dsn/utility/extensible_object.h +++ b/src/rdsn/src/utils/extensible_object.h @@ -35,7 +35,7 @@ #pragma once -#include +#include "utils/utils.h" #include #include #include diff --git a/src/rdsn/include/dsn/utility/factory_store.h b/src/rdsn/src/utils/factory_store.h similarity index 99% rename from src/rdsn/include/dsn/utility/factory_store.h rename to src/rdsn/src/utils/factory_store.h index 8317d86351..561cedca2b 100644 --- a/src/rdsn/include/dsn/utility/factory_store.h +++ b/src/rdsn/src/utils/factory_store.h @@ -35,7 +35,7 @@ #pragma once -#include +#include "utils/singleton_store.h" namespace dsn { diff --git a/src/rdsn/src/utils/fail_point.cpp b/src/rdsn/src/utils/fail_point.cpp index d71addbfa6..bad0c859a5 100644 --- a/src/rdsn/src/utils/fail_point.cpp +++ b/src/rdsn/src/utils/fail_point.cpp @@ -30,11 +30,11 @@ #include "fail_point_impl.h" -#include +#include "runtime/api_layer1.h" // TOOD(wutao1): use instead when our lowest compiler support // advances to gcc-4.9. #include -#include +#include "utils/rand.h" namespace dsn { namespace fail { diff --git a/src/rdsn/include/dsn/utility/fail_point.h b/src/rdsn/src/utils/fail_point.h similarity index 99% rename from src/rdsn/include/dsn/utility/fail_point.h rename to src/rdsn/src/utils/fail_point.h index 7bf9f9c696..b99e807a49 100644 --- a/src/rdsn/include/dsn/utility/fail_point.h +++ b/src/rdsn/src/utils/fail_point.h @@ -33,7 +33,7 @@ /// A fail point implementation in C++. /// This lib is ported from https://github.com/pingcap/fail-rs. -#include +#include "utils/string_view.h" /// The only entry to define a fail point with `return` function: lambda function must be /// return non-void type. When a fail point is defined, it's referenced via the name. diff --git a/src/rdsn/src/utils/fail_point_impl.h b/src/rdsn/src/utils/fail_point_impl.h index 2d82716d52..b8b96fd9c2 100644 --- a/src/rdsn/src/utils/fail_point_impl.h +++ b/src/rdsn/src/utils/fail_point_impl.h @@ -30,9 +30,9 @@ #pragma once -#include -#include -#include +#include "utils/fail_point.h" +#include "utils/api_utilities.h" +#include "utils/ports.h" #include #include #include diff --git a/src/rdsn/src/utils/filesystem.cpp b/src/rdsn/src/utils/filesystem.cpp index 0265cfbe97..3d7624ce8c 100644 --- a/src/rdsn/src/utils/filesystem.cpp +++ b/src/rdsn/src/utils/filesystem.cpp @@ -35,14 +35,14 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include "utils/api_utilities.h" +#include "utils/fmt_logging.h" +#include "utils/defer.h" +#include "utils/fail_point.h" +#include "utils/filesystem.h" +#include "utils/strings.h" +#include "utils/utils.h" +#include "utils/safe_strerror_posix.h" #include #include diff --git a/src/rdsn/include/dsn/utility/filesystem.h b/src/rdsn/src/utils/filesystem.h similarity index 99% rename from src/rdsn/include/dsn/utility/filesystem.h rename to src/rdsn/src/utils/filesystem.h index a94bc0ccc3..142e15f730 100644 --- a/src/rdsn/include/dsn/utility/filesystem.h +++ b/src/rdsn/src/utils/filesystem.h @@ -27,7 +27,7 @@ #pragma once #include -#include +#include "utils/error_code.h" #ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE 500 diff --git a/src/rdsn/include/dsn/utility/fixed_size_buffer_pool.h b/src/rdsn/src/utils/fixed_size_buffer_pool.h similarity index 100% rename from src/rdsn/include/dsn/utility/fixed_size_buffer_pool.h rename to src/rdsn/src/utils/fixed_size_buffer_pool.h diff --git a/src/rdsn/src/utils/flags.cpp b/src/rdsn/src/utils/flags.cpp index 922cce7976..b7a313c3ca 100644 --- a/src/rdsn/src/utils/flags.cpp +++ b/src/rdsn/src/utils/flags.cpp @@ -17,18 +17,18 @@ #include -#include -#include -#include -#include -#include -#include -#include +#include "utils/flags.h" +#include "utils/config_api.h" +#include "utils/singleton.h" +#include "utils/errors.h" +#include "utils/string_conv.h" +#include "utils/join_point.h" +#include "utils/api_utilities.h" #include -#include +#include "utils/fmt_logging.h" #include -#include +#include "utils/output_utils.h" namespace dsn { diff --git a/src/rdsn/include/dsn/utility/flags.h b/src/rdsn/src/utils/flags.h similarity index 100% rename from src/rdsn/include/dsn/utility/flags.h rename to src/rdsn/src/utils/flags.h diff --git a/src/rdsn/include/dsn/dist/fmt_logging.h b/src/rdsn/src/utils/fmt_logging.h similarity index 100% rename from src/rdsn/include/dsn/dist/fmt_logging.h rename to src/rdsn/src/utils/fmt_logging.h diff --git a/src/rdsn/include/dsn/utility/function_traits.h b/src/rdsn/src/utils/function_traits.h similarity index 100% rename from src/rdsn/include/dsn/utility/function_traits.h rename to src/rdsn/src/utils/function_traits.h diff --git a/src/rdsn/src/utils/gpid.cpp b/src/rdsn/src/utils/gpid.cpp index 8dc932d146..6250f15bb8 100644 --- a/src/rdsn/src/utils/gpid.cpp +++ b/src/rdsn/src/utils/gpid.cpp @@ -23,8 +23,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include -#include +#include "utils/fixed_size_buffer_pool.h" +#include "common/gpid.h" #include namespace dsn { diff --git a/src/rdsn/include/dsn/utility/hpc_locks/autoresetevent.h b/src/rdsn/src/utils/hpc_locks/autoresetevent.h similarity index 98% rename from src/rdsn/include/dsn/utility/hpc_locks/autoresetevent.h rename to src/rdsn/src/utils/hpc_locks/autoresetevent.h index ecb089cf30..83052c016f 100644 --- a/src/rdsn/include/dsn/utility/hpc_locks/autoresetevent.h +++ b/src/rdsn/src/utils/hpc_locks/autoresetevent.h @@ -8,7 +8,7 @@ #include #include -#include +#include "utils/hpc_locks/sema.h" //--------------------------------------------------------- // AutoResetEvent diff --git a/src/rdsn/include/dsn/utility/hpc_locks/autoreseteventcondvar.h b/src/rdsn/src/utils/hpc_locks/autoreseteventcondvar.h similarity index 100% rename from src/rdsn/include/dsn/utility/hpc_locks/autoreseteventcondvar.h rename to src/rdsn/src/utils/hpc_locks/autoreseteventcondvar.h diff --git a/src/rdsn/include/dsn/utility/hpc_locks/benaphore.h b/src/rdsn/src/utils/hpc_locks/benaphore.h similarity index 97% rename from src/rdsn/include/dsn/utility/hpc_locks/benaphore.h rename to src/rdsn/src/utils/hpc_locks/benaphore.h index 2744cbc378..9549336ed1 100644 --- a/src/rdsn/include/dsn/utility/hpc_locks/benaphore.h +++ b/src/rdsn/src/utils/hpc_locks/benaphore.h @@ -9,8 +9,8 @@ #include #include #include -#include -#include +#include "utils/process_utils.h" +#include "utils/hpc_locks/sema.h" //--------------------------------------------------------- // NonRecursiveBenaphore diff --git a/src/rdsn/include/dsn/utility/hpc_locks/bitfield.h b/src/rdsn/src/utils/hpc_locks/bitfield.h similarity index 100% rename from src/rdsn/include/dsn/utility/hpc_locks/bitfield.h rename to src/rdsn/src/utils/hpc_locks/bitfield.h diff --git a/src/rdsn/include/dsn/utility/hpc_locks/readme.txt b/src/rdsn/src/utils/hpc_locks/readme.txt similarity index 100% rename from src/rdsn/include/dsn/utility/hpc_locks/readme.txt rename to src/rdsn/src/utils/hpc_locks/readme.txt diff --git a/src/rdsn/include/dsn/utility/hpc_locks/rwlock.h b/src/rdsn/src/utils/hpc_locks/rwlock.h similarity index 98% rename from src/rdsn/include/dsn/utility/hpc_locks/rwlock.h rename to src/rdsn/src/utils/hpc_locks/rwlock.h index ce22908f0b..a75b2d6797 100644 --- a/src/rdsn/include/dsn/utility/hpc_locks/rwlock.h +++ b/src/rdsn/src/utils/hpc_locks/rwlock.h @@ -9,8 +9,8 @@ #include #include #include -#include -#include +#include "utils/hpc_locks/sema.h" +#include "utils/hpc_locks/bitfield.h" //--------------------------------------------------------- // NonRecursiveRWLock diff --git a/src/rdsn/include/dsn/utility/hpc_locks/sema.h b/src/rdsn/src/utils/hpc_locks/sema.h similarity index 100% rename from src/rdsn/include/dsn/utility/hpc_locks/sema.h rename to src/rdsn/src/utils/hpc_locks/sema.h diff --git a/src/rdsn/src/utils/je_ctl.cpp b/src/rdsn/src/utils/je_ctl.cpp index 92761d3c2f..0ef30ecae3 100644 --- a/src/rdsn/src/utils/je_ctl.cpp +++ b/src/rdsn/src/utils/je_ctl.cpp @@ -25,8 +25,8 @@ #include #include -#include -#include +#include "utils/api_utilities.h" +#include "utils/fmt_logging.h" #define RETURN_ARRAY_ELEM_BY_ENUM_TYPE(type, array) \ do { \ diff --git a/src/rdsn/src/utils/je_ctl.h b/src/rdsn/src/utils/je_ctl.h index b26acfea9d..504c372329 100644 --- a/src/rdsn/src/utils/je_ctl.h +++ b/src/rdsn/src/utils/je_ctl.h @@ -21,7 +21,7 @@ #include -#include +#include "utils/enum_helper.h" namespace dsn { diff --git a/src/rdsn/include/dsn/utility/join_point.h b/src/rdsn/src/utils/join_point.h similarity index 99% rename from src/rdsn/include/dsn/utility/join_point.h rename to src/rdsn/src/utils/join_point.h index 2decb9b381..89cf77c026 100644 --- a/src/rdsn/include/dsn/utility/join_point.h +++ b/src/rdsn/src/utils/join_point.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include "utils/apply.h" namespace dsn { diff --git a/src/rdsn/src/utils/latency_tracer.cpp b/src/rdsn/src/utils/latency_tracer.cpp index e32d257ae9..b13908946d 100644 --- a/src/rdsn/src/utils/latency_tracer.cpp +++ b/src/rdsn/src/utils/latency_tracer.cpp @@ -15,12 +15,16 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include -#include -#include -#include +#include "utils/latency_tracer.h" +#include "perf_counter/perf_counters.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/fmt_logging.h" +#include "utils/config_api.h" +#include "utils/flags.h" #include #include "lockp.std.h" diff --git a/src/rdsn/include/dsn/utils/latency_tracer.h b/src/rdsn/src/utils/latency_tracer.h similarity index 97% rename from src/rdsn/include/dsn/utils/latency_tracer.h rename to src/rdsn/src/utils/latency_tracer.h index a63ee39d75..2492e9f9ee 100644 --- a/src/rdsn/include/dsn/utils/latency_tracer.h +++ b/src/rdsn/src/utils/latency_tracer.h @@ -16,11 +16,11 @@ // under the License. #pragma once -#include -#include -#include -#include -#include +#include "utils/synchronize.h" +#include "utils/flags.h" +#include "utils/fmt_logging.h" +#include "runtime/task/task_code.h" +#include "common/replication.codes.h" namespace dsn { namespace utils { diff --git a/src/rdsn/include/dsn/utility/link.h b/src/rdsn/src/utils/link.h similarity index 100% rename from src/rdsn/include/dsn/utility/link.h rename to src/rdsn/src/utils/link.h diff --git a/src/rdsn/src/utils/lockp.std.h b/src/rdsn/src/utils/lockp.std.h index a8fcd68d65..e797e2423e 100644 --- a/src/rdsn/src/utils/lockp.std.h +++ b/src/rdsn/src/utils/lockp.std.h @@ -35,7 +35,7 @@ #pragma once -#include +#include "utils/synchronize.h" #include "utils/zlock_provider.h" namespace dsn { diff --git a/src/rdsn/src/utils/logging.cpp b/src/rdsn/src/utils/logging.cpp index 84e33e4c77..143baf1bd0 100644 --- a/src/rdsn/src/utils/logging.cpp +++ b/src/rdsn/src/utils/logging.cpp @@ -24,11 +24,14 @@ * THE SOFTWARE. */ -#include -#include -#include -#include -#include +#include "utils/command_manager.h" +#include "utils/logging_provider.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "utils/flags.h" +#include "utils/smart_pointers.h" #include "simple_logger.h" DSN_API dsn_log_level_t dsn_log_start_level = dsn_log_level_t::LOG_LEVEL_INFORMATION; diff --git a/src/rdsn/include/dsn/tool-api/logging_provider.h b/src/rdsn/src/utils/logging_provider.h similarity index 98% rename from src/rdsn/include/dsn/tool-api/logging_provider.h rename to src/rdsn/src/utils/logging_provider.h index 61fe8fc8ce..1357377a36 100644 --- a/src/rdsn/include/dsn/tool-api/logging_provider.h +++ b/src/rdsn/src/utils/logging_provider.h @@ -36,7 +36,7 @@ #pragma once #include -#include +#include "utils/factory_store.h" namespace dsn { /*! diff --git a/src/rdsn/src/utils/long_adder.cpp b/src/rdsn/src/utils/long_adder.cpp index af080f3d5b..c5c550df15 100644 --- a/src/rdsn/src/utils/long_adder.cpp +++ b/src/rdsn/src/utils/long_adder.cpp @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include +#include "utils/long_adder.h" #ifdef __aarch64__ #define _mm_free(p) free(p) @@ -30,11 +30,11 @@ #include #include -#include -#include -#include -#include -#include +#include "utils/api_utilities.h" +#include "utils/fmt_logging.h" +#include "utils/process_utils.h" +#include "utils/rand.h" +#include "utils/safe_strerror_posix.h" namespace dsn { diff --git a/src/rdsn/include/dsn/utility/long_adder.h b/src/rdsn/src/utils/long_adder.h similarity index 99% rename from src/rdsn/include/dsn/utility/long_adder.h rename to src/rdsn/src/utils/long_adder.h index 99a3d2d3bf..89713a4c9b 100644 --- a/src/rdsn/include/dsn/utility/long_adder.h +++ b/src/rdsn/src/utils/long_adder.h @@ -22,7 +22,7 @@ #include #include -#include +#include "utils/ports.h" // Refer to https://github.com/apache/kudu/blob/master/src/kudu/util/striped64.h diff --git a/src/rdsn/src/utils/long_adder_bench/long_adder_bench.cpp b/src/rdsn/src/utils/long_adder_bench/long_adder_bench.cpp index 6fbb249b8f..be11784b89 100644 --- a/src/rdsn/src/utils/long_adder_bench/long_adder_bench.cpp +++ b/src/rdsn/src/utils/long_adder_bench/long_adder_bench.cpp @@ -23,10 +23,10 @@ #include -#include -#include -#include -#include +#include "runtime/api_layer1.h" +#include "utils/long_adder.h" +#include "utils/process_utils.h" +#include "utils/string_conv.h" // The simplest implementation of long adder: just wrap std::atomic. class simple_long_adder diff --git a/src/rdsn/src/utils/math.cpp b/src/rdsn/src/utils/math.cpp index 3dcb351f3e..6ec52779cf 100644 --- a/src/rdsn/src/utils/math.cpp +++ b/src/rdsn/src/utils/math.cpp @@ -18,8 +18,8 @@ #include #include #include -#include -#include +#include "utils/api_utilities.h" +#include "utils/math.h" namespace dsn { namespace utils { diff --git a/src/rdsn/include/dsn/utility/math.h b/src/rdsn/src/utils/math.h similarity index 100% rename from src/rdsn/include/dsn/utility/math.h rename to src/rdsn/src/utils/math.h diff --git a/src/rdsn/src/utils/metrics.cpp b/src/rdsn/src/utils/metrics.cpp index d1cad67487..7ad4d53ee2 100644 --- a/src/rdsn/src/utils/metrics.cpp +++ b/src/rdsn/src/utils/metrics.cpp @@ -15,10 +15,10 @@ // specific language governing permissions and limitations // under the License. -#include +#include "utils/metrics.h" -#include -#include +#include "utils/api_utilities.h" +#include "utils/rand.h" #include "shared_io_service.h" diff --git a/src/rdsn/include/dsn/utility/metrics.h b/src/rdsn/src/utils/metrics.h similarity index 98% rename from src/rdsn/include/dsn/utility/metrics.h rename to src/rdsn/src/utils/metrics.h index 1e48ef34eb..b5f5551c53 100644 --- a/src/rdsn/include/dsn/utility/metrics.h +++ b/src/rdsn/src/utils/metrics.h @@ -32,18 +32,18 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "api_utilities.h" +#include "fmt_logging.h" +#include "alloc.h" +#include "autoref_ptr.h" +#include "casts.h" +#include "enum_helper.h" +#include "long_adder.h" +#include "nth_element.h" +#include "ports.h" +#include "singleton.h" +#include "string_view.h" +#include "synchronize.h" // A metric library (for details pls see https://github.com/apache/incubator-pegasus/issues/922) // inspired by Kudu metrics (https://github.com/apache/kudu/blob/master/src/kudu/util/metrics.h). diff --git a/src/rdsn/include/dsn/utility/nth_element.h b/src/rdsn/src/utils/nth_element.h similarity index 98% rename from src/rdsn/include/dsn/utility/nth_element.h rename to src/rdsn/src/utils/nth_element.h index d6fbe85d04..591cba2a1d 100644 --- a/src/rdsn/include/dsn/utility/nth_element.h +++ b/src/rdsn/src/utils/nth_element.h @@ -27,9 +27,9 @@ #include -#include -#include -#include +#include "utils/api_utilities.h" +#include "utils/fmt_logging.h" +#include "utils/ports.h" namespace dsn { diff --git a/src/rdsn/include/dsn/utility/optional.h b/src/rdsn/src/utils/optional.h similarity index 100% rename from src/rdsn/include/dsn/utility/optional.h rename to src/rdsn/src/utils/optional.h diff --git a/src/rdsn/src/utils/output_utils.cpp b/src/rdsn/src/utils/output_utils.cpp index e7033a8c7f..5358c1cbe3 100644 --- a/src/rdsn/src/utils/output_utils.cpp +++ b/src/rdsn/src/utils/output_utils.cpp @@ -15,9 +15,9 @@ // specific language governing permissions and limitations // under the License. -#include "dsn/utility/output_utils.h" +#include "utils/output_utils.h" -#include +#include "utils/api_utilities.h" namespace dsn { namespace utils { diff --git a/src/rdsn/include/dsn/utility/output_utils.h b/src/rdsn/src/utils/output_utils.h similarity index 99% rename from src/rdsn/include/dsn/utility/output_utils.h rename to src/rdsn/src/utils/output_utils.h index 8c776e3870..4df0d20bfb 100644 --- a/src/rdsn/include/dsn/utility/output_utils.h +++ b/src/rdsn/src/utils/output_utils.h @@ -24,7 +24,7 @@ #include #include -#include +#include "common/json_helper.h" namespace dsn { namespace utils { diff --git a/src/rdsn/include/dsn/utility/ports.h b/src/rdsn/src/utils/ports.h similarity index 100% rename from src/rdsn/include/dsn/utility/ports.h rename to src/rdsn/src/utils/ports.h diff --git a/src/rdsn/include/dsn/utility/preloadable.h b/src/rdsn/src/utils/preloadable.h similarity index 97% rename from src/rdsn/include/dsn/utility/preloadable.h rename to src/rdsn/src/utils/preloadable.h index 117c8151f5..afca5b065d 100644 --- a/src/rdsn/include/dsn/utility/preloadable.h +++ b/src/rdsn/src/utils/preloadable.h @@ -17,7 +17,7 @@ #pragma once -#include +#include "utils/ports.h" namespace dsn { namespace utils { diff --git a/src/rdsn/include/dsn/utility/priority_queue.h b/src/rdsn/src/utils/priority_queue.h similarity index 99% rename from src/rdsn/include/dsn/utility/priority_queue.h rename to src/rdsn/src/utils/priority_queue.h index 17d1125987..058a4e2b7e 100644 --- a/src/rdsn/include/dsn/utility/priority_queue.h +++ b/src/rdsn/src/utils/priority_queue.h @@ -37,7 +37,7 @@ #include #include -#include +#include "utils/synchronize.h" namespace dsn { namespace utils { diff --git a/src/rdsn/src/utils/process_utils.cpp b/src/rdsn/src/utils/process_utils.cpp index 015800ede2..da8d171d0d 100644 --- a/src/rdsn/src/utils/process_utils.cpp +++ b/src/rdsn/src/utils/process_utils.cpp @@ -20,10 +20,10 @@ #include #include #include -#include -#include -#include -#include +#include "utils/utils.h" +#include "utils/preloadable.h" +#include "utils/process_utils.h" +#include "utils/time_utils.h" namespace dsn { namespace utils { diff --git a/src/rdsn/include/dsn/utility/process_utils.h b/src/rdsn/src/utils/process_utils.h similarity index 98% rename from src/rdsn/include/dsn/utility/process_utils.h rename to src/rdsn/src/utils/process_utils.h index 323f84dc73..a047fc9915 100644 --- a/src/rdsn/include/dsn/utility/process_utils.h +++ b/src/rdsn/src/utils/process_utils.h @@ -19,7 +19,7 @@ #include -#include +#include "utils/ports.h" namespace dsn { namespace utils { diff --git a/src/rdsn/src/utils/rand.cpp b/src/rdsn/src/utils/rand.cpp index d4e98653db..36e18f0a71 100644 --- a/src/rdsn/src/utils/rand.cpp +++ b/src/rdsn/src/utils/rand.cpp @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include +#include "utils/rand.h" #include namespace dsn { diff --git a/src/rdsn/include/dsn/utility/rand.h b/src/rdsn/src/utils/rand.h similarity index 100% rename from src/rdsn/include/dsn/utility/rand.h rename to src/rdsn/src/utils/rand.h diff --git a/src/rdsn/src/utils/rpc_address.cpp b/src/rdsn/src/utils/rpc_address.cpp index ce11110c0a..37c4cefba1 100644 --- a/src/rdsn/src/utils/rpc_address.cpp +++ b/src/rdsn/src/utils/rpc_address.cpp @@ -30,14 +30,14 @@ #include #include -#include -#include -#include +#include "utils/ports.h" +#include "utils/string_view.h" +#include "utils/fixed_size_buffer_pool.h" -#include +#include "utils/api_utilities.h" -#include -#include +#include "utils/rpc_address.h" +#include "runtime/rpc/group_address.h" namespace dsn { diff --git a/src/rdsn/include/dsn/tool-api/rpc_address.h b/src/rdsn/src/utils/rpc_address.h similarity index 99% rename from src/rdsn/include/dsn/tool-api/rpc_address.h rename to src/rdsn/src/utils/rpc_address.h index 783c2cde1a..20a859c70c 100644 --- a/src/rdsn/include/dsn/tool-api/rpc_address.h +++ b/src/rdsn/src/utils/rpc_address.h @@ -29,7 +29,8 @@ #include #include -#include + +#include "string_conv.h" typedef enum dsn_host_type_t { HOST_TYPE_INVALID = 0, diff --git a/src/rdsn/src/utils/safe_strerror_posix.cpp b/src/rdsn/src/utils/safe_strerror_posix.cpp index 185457efee..02cb7cf968 100644 --- a/src/rdsn/src/utils/safe_strerror_posix.cpp +++ b/src/rdsn/src/utils/safe_strerror_posix.cpp @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include +#include "utils/safe_strerror_posix.h" #include #include diff --git a/src/rdsn/include/dsn/utility/safe_strerror_posix.h b/src/rdsn/src/utils/safe_strerror_posix.h similarity index 100% rename from src/rdsn/include/dsn/utility/safe_strerror_posix.h rename to src/rdsn/src/utils/safe_strerror_posix.h diff --git a/src/rdsn/src/utils/shared_io_service.cpp b/src/rdsn/src/utils/shared_io_service.cpp index d4a82d95b6..11635a9148 100644 --- a/src/rdsn/src/utils/shared_io_service.cpp +++ b/src/rdsn/src/utils/shared_io_service.cpp @@ -17,7 +17,7 @@ #include "shared_io_service.h" -#include +#include "utils/flags.h" namespace dsn { namespace tools { diff --git a/src/rdsn/src/utils/shared_io_service.h b/src/rdsn/src/utils/shared_io_service.h index df6db1326f..7caf0743a5 100644 --- a/src/rdsn/src/utils/shared_io_service.h +++ b/src/rdsn/src/utils/shared_io_service.h @@ -40,7 +40,7 @@ #include -#include +#include "utils/singleton.h" namespace dsn { namespace tools { diff --git a/src/rdsn/src/utils/simple_logger.cpp b/src/rdsn/src/utils/simple_logger.cpp index 7c19526e4d..ea23f55060 100644 --- a/src/rdsn/src/utils/simple_logger.cpp +++ b/src/rdsn/src/utils/simple_logger.cpp @@ -26,9 +26,9 @@ #include "simple_logger.h" #include -#include -#include -#include +#include "utils/filesystem.h" +#include "utils/flags.h" +#include "utils/time_utils.h" #include namespace dsn { diff --git a/src/rdsn/src/utils/simple_logger.h b/src/rdsn/src/utils/simple_logger.h index e71c8d86a6..fb7286e64f 100644 --- a/src/rdsn/src/utils/simple_logger.h +++ b/src/rdsn/src/utils/simple_logger.h @@ -26,7 +26,7 @@ #pragma once -#include +#include "runtime/tool_api.h" #include #include diff --git a/src/rdsn/include/dsn/utility/singleton.h b/src/rdsn/src/utils/singleton.h similarity index 100% rename from src/rdsn/include/dsn/utility/singleton.h rename to src/rdsn/src/utils/singleton.h diff --git a/src/rdsn/include/dsn/utility/singleton_store.h b/src/rdsn/src/utils/singleton_store.h similarity index 98% rename from src/rdsn/include/dsn/utility/singleton_store.h rename to src/rdsn/src/utils/singleton_store.h index 8f6023c873..bd680b5d6d 100644 --- a/src/rdsn/include/dsn/utility/singleton_store.h +++ b/src/rdsn/src/utils/singleton_store.h @@ -35,8 +35,8 @@ #pragma once -#include -#include +#include "utils/singleton.h" +#include "utils/synchronize.h" #include #include diff --git a/src/rdsn/include/dsn/utility/smart_pointers.h b/src/rdsn/src/utils/smart_pointers.h similarity index 100% rename from src/rdsn/include/dsn/utility/smart_pointers.h rename to src/rdsn/src/utils/smart_pointers.h diff --git a/src/rdsn/include/dsn/utility/string_conv.h b/src/rdsn/src/utils/string_conv.h similarity index 99% rename from src/rdsn/include/dsn/utility/string_conv.h rename to src/rdsn/src/utils/string_conv.h index 973961e2dc..380a06742d 100644 --- a/src/rdsn/include/dsn/utility/string_conv.h +++ b/src/rdsn/src/utils/string_conv.h @@ -20,7 +20,7 @@ #include #include -#include +#include "string_view.h" namespace dsn { diff --git a/src/rdsn/include/dsn/utility/string_splitter.h b/src/rdsn/src/utils/string_splitter.h similarity index 100% rename from src/rdsn/include/dsn/utility/string_splitter.h rename to src/rdsn/src/utils/string_splitter.h diff --git a/src/rdsn/src/utils/string_view.cpp b/src/rdsn/src/utils/string_view.cpp index bb7b3e9aae..fe6e6a4a9d 100644 --- a/src/rdsn/src/utils/string_view.cpp +++ b/src/rdsn/src/utils/string_view.cpp @@ -13,9 +13,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include "string_view.h" + #include +#include "blob.h" #include "memutil.h" namespace dsn { @@ -84,6 +86,8 @@ const char *memmatch(const char *phaystack, size_t haylen, const char *pneedle, } // namespace strings_internal +string_view::string_view(const blob &buf) noexcept : ptr_(buf.data()), length_(buf.length()) {} + string_view::size_type string_view::find(string_view s, size_type pos) const noexcept { if (empty() || pos > length_) { diff --git a/src/rdsn/include/dsn/utility/string_view.h b/src/rdsn/src/utils/string_view.h similarity index 98% rename from src/rdsn/include/dsn/utility/string_view.h rename to src/rdsn/src/utils/string_view.h index 61e52e4b29..b83bcc13fb 100644 --- a/src/rdsn/include/dsn/utility/string_view.h +++ b/src/rdsn/src/utils/string_view.h @@ -40,14 +40,18 @@ #pragma once -#include #include #include -#include -#include +#include +#include +#include + +#include "ports.h" namespace dsn { +class blob; + // dsn::string_view // // A `string_view` provides a lightweight view into the std::string data provided by @@ -166,11 +170,7 @@ class string_view { } - string_view(const blob &buf) noexcept // NOLINT(runtime/explicit) - : ptr_(buf.data()), - length_(buf.length()) - { - } + string_view(const blob &buf) noexcept; // NOLINT(runtime/explicit) constexpr string_view(const char *str) // NOLINT(runtime/explicit) : ptr_(str), diff --git a/src/rdsn/src/utils/strings.cpp b/src/rdsn/src/utils/strings.cpp index 412d3e17d8..aef9af5e51 100644 --- a/src/rdsn/src/utils/strings.cpp +++ b/src/rdsn/src/utils/strings.cpp @@ -23,10 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ + #include #include #include -#include +#include "utils/strings.h" namespace dsn { namespace utils { diff --git a/src/rdsn/include/dsn/utility/strings.h b/src/rdsn/src/utils/strings.h similarity index 100% rename from src/rdsn/include/dsn/utility/strings.h rename to src/rdsn/src/utils/strings.h diff --git a/src/rdsn/include/dsn/utility/synchronize.h b/src/rdsn/src/utils/synchronize.h similarity index 95% rename from src/rdsn/include/dsn/utility/synchronize.h rename to src/rdsn/src/utils/synchronize.h index 2004e19862..80a51a6f67 100644 --- a/src/rdsn/include/dsn/utility/synchronize.h +++ b/src/rdsn/src/utils/synchronize.h @@ -25,11 +25,11 @@ */ #pragma once -#include -#include -#include -#include -#include +#include "utils/ports.h" +#include "utils/utils.h" +#include "utils/hpc_locks/benaphore.h" +#include "utils/hpc_locks/autoresetevent.h" +#include "utils/hpc_locks/rwlock.h" namespace dsn { namespace utils { diff --git a/src/rdsn/include/dsn/utility/sys_exit_hook.h b/src/rdsn/src/utils/sys_exit_hook.h similarity index 97% rename from src/rdsn/include/dsn/utility/sys_exit_hook.h rename to src/rdsn/src/utils/sys_exit_hook.h index a89f2d9722..29befb8326 100644 --- a/src/rdsn/include/dsn/utility/sys_exit_hook.h +++ b/src/rdsn/src/utils/sys_exit_hook.h @@ -17,7 +17,7 @@ #pragma once -#include +#include "utils/enum_helper.h" namespace dsn { diff --git a/src/rdsn/src/utils/test/TokenBucketTest.cpp b/src/rdsn/src/utils/test/TokenBucketTest.cpp index 6593f1bfe0..9043de9b0d 100644 --- a/src/rdsn/src/utils/test/TokenBucketTest.cpp +++ b/src/rdsn/src/utils/test/TokenBucketTest.cpp @@ -16,7 +16,7 @@ #include "TokenBucketTest.h" #include -#include +#include "utils/TokenBucket.h" using namespace folly; diff --git a/src/rdsn/src/utils/test/TokenBucketTest.h b/src/rdsn/src/utils/test/TokenBucketTest.h index 146cb3b5e2..4227186cee 100644 --- a/src/rdsn/src/utils/test/TokenBucketTest.h +++ b/src/rdsn/src/utils/test/TokenBucketTest.h @@ -17,7 +17,7 @@ #pragma once #include -#include +#include "utils/TokenBucket.h" namespace folly { diff --git a/src/rdsn/src/utils/test/address.cpp b/src/rdsn/src/utils/test/address.cpp index 352d3bd788..3c071355b9 100644 --- a/src/rdsn/src/utils/test/address.cpp +++ b/src/rdsn/src/utils/test/address.cpp @@ -33,8 +33,8 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include -#include +#include "utils/rpc_address.h" +#include "runtime/rpc/group_address.h" #include using namespace ::dsn; diff --git a/src/rdsn/src/utils/test/autoref_ptr_test.cpp b/src/rdsn/src/utils/test/autoref_ptr_test.cpp index fe07110a17..325499f6fd 100644 --- a/src/rdsn/src/utils/test/autoref_ptr_test.cpp +++ b/src/rdsn/src/utils/test/autoref_ptr_test.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include "utils/autoref_ptr.h" namespace { diff --git a/src/rdsn/src/utils/test/binary_reader_test.cpp b/src/rdsn/src/utils/test/binary_reader_test.cpp index 5d4473749c..74a6ed5ca1 100644 --- a/src/rdsn/src/utils/test/binary_reader_test.cpp +++ b/src/rdsn/src/utils/test/binary_reader_test.cpp @@ -15,9 +15,9 @@ // specific language governing permissions and limitations // under the License. -#include +#include "utils/binary_reader.h" #include -#include +#include "utils/defer.h" namespace dsn { diff --git a/src/rdsn/src/utils/test/command_manager.cpp b/src/rdsn/src/utils/test/command_manager.cpp index b1074849e0..3fe0767863 100644 --- a/src/rdsn/src/utils/test/command_manager.cpp +++ b/src/rdsn/src/utils/test/command_manager.cpp @@ -33,7 +33,7 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include +#include "utils/command_manager.h" #include using namespace ::dsn; diff --git a/src/rdsn/src/utils/test/configuration.cpp b/src/rdsn/src/utils/test/configuration.cpp index e581773dfd..5bee70dcc0 100644 --- a/src/rdsn/src/utils/test/configuration.cpp +++ b/src/rdsn/src/utils/test/configuration.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include "utils/configuration.h" using namespace ::dsn; diff --git a/src/rdsn/src/utils/test/endian_test.cpp b/src/rdsn/src/utils/test/endian_test.cpp index dd634ef7e9..9fb951f4e6 100644 --- a/src/rdsn/src/utils/test/endian_test.cpp +++ b/src/rdsn/src/utils/test/endian_test.cpp @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include +#include "utils/endians.h" #include diff --git a/src/rdsn/src/utils/test/env.cpp b/src/rdsn/src/utils/test/env.cpp index bf55d43deb..b352624ec2 100644 --- a/src/rdsn/src/utils/test/env.cpp +++ b/src/rdsn/src/utils/test/env.cpp @@ -34,7 +34,7 @@ */ #include -#include +#include "utils/rand.h" using namespace ::dsn; diff --git a/src/rdsn/src/utils/test/file_system_test.cpp b/src/rdsn/src/utils/test/file_system_test.cpp index e21ef1348a..92a9199308 100644 --- a/src/rdsn/src/utils/test/file_system_test.cpp +++ b/src/rdsn/src/utils/test/file_system_test.cpp @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include +#include "utils/filesystem.h" #include namespace dsn { diff --git a/src/rdsn/src/utils/test/file_utils.cpp b/src/rdsn/src/utils/test/file_utils.cpp index cf72ddf5cb..2ddabc0d60 100644 --- a/src/rdsn/src/utils/test/file_utils.cpp +++ b/src/rdsn/src/utils/test/file_utils.cpp @@ -25,9 +25,22 @@ */ #include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "utils/utils.h" +#include "utils/filesystem.h" #include static void file_utils_test_setup() diff --git a/src/rdsn/src/utils/test/flag_test.cpp b/src/rdsn/src/utils/test/flag_test.cpp index 90217ee9d3..195ea911d7 100644 --- a/src/rdsn/src/utils/test/flag_test.cpp +++ b/src/rdsn/src/utils/test/flag_test.cpp @@ -16,7 +16,7 @@ // under the License. #include -#include +#include "utils/flags.h" #include namespace dsn { diff --git a/src/rdsn/src/utils/test/fmt_logging_test.cpp b/src/rdsn/src/utils/test/fmt_logging_test.cpp index 2a711f0223..d483167bbf 100644 --- a/src/rdsn/src/utils/test/fmt_logging_test.cpp +++ b/src/rdsn/src/utils/test/fmt_logging_test.cpp @@ -24,11 +24,11 @@ * THE SOFTWARE. */ -#include -#include -#include +#include "utils/string_view.h" +#include "utils/errors.h" +#include "utils/fmt_logging.h" #include -#include +#include "common/replication.codes.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/utils/test/hostname_test.cpp b/src/rdsn/src/utils/test/hostname_test.cpp index fcdabc792a..42452bbe03 100644 --- a/src/rdsn/src/utils/test/hostname_test.cpp +++ b/src/rdsn/src/utils/test/hostname_test.cpp @@ -15,9 +15,9 @@ // specific language governing permissions and limitations // under the License. -#include +#include "utils/utils.h" -#include +#include "utils/rpc_address.h" #include namespace dsn { diff --git a/src/rdsn/src/utils/test/join_point_test.cpp b/src/rdsn/src/utils/test/join_point_test.cpp index 0bc7f6da44..21eb27ec8b 100644 --- a/src/rdsn/src/utils/test/join_point_test.cpp +++ b/src/rdsn/src/utils/test/join_point_test.cpp @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include +#include "utils/join_point.h" #include namespace dsn { diff --git a/src/rdsn/src/utils/test/json_helper_test.cpp b/src/rdsn/src/utils/test/json_helper_test.cpp index 61e3dc0ddd..ea5a80c85a 100644 --- a/src/rdsn/src/utils/test/json_helper_test.cpp +++ b/src/rdsn/src/utils/test/json_helper_test.cpp @@ -25,7 +25,7 @@ */ #include -#include +#include "common/json_helper.h" namespace dsn { diff --git a/src/rdsn/src/utils/test/latency_tracer_test.cpp b/src/rdsn/src/utils/test/latency_tracer_test.cpp index c9314836f4..bd25661cfd 100644 --- a/src/rdsn/src/utils/test/latency_tracer_test.cpp +++ b/src/rdsn/src/utils/test/latency_tracer_test.cpp @@ -16,8 +16,8 @@ // under the License. #include -#include -#include +#include "utils/fmt_logging.h" +#include "utils/latency_tracer.h" namespace dsn { namespace utils { diff --git a/src/rdsn/src/utils/test/logger.cpp b/src/rdsn/src/utils/test/logger.cpp index f8bf4d1ee1..d69699feb7 100644 --- a/src/rdsn/src/utils/test/logger.cpp +++ b/src/rdsn/src/utils/test/logger.cpp @@ -35,7 +35,7 @@ #include "utils/simple_logger.h" #include -#include +#include "utils/filesystem.h" using namespace dsn; using namespace dsn::tools; diff --git a/src/rdsn/src/utils/test/logging.cpp b/src/rdsn/src/utils/test/logging.cpp index 03cc31cbb6..e75ada94f5 100644 --- a/src/rdsn/src/utils/test/logging.cpp +++ b/src/rdsn/src/utils/test/logging.cpp @@ -35,8 +35,8 @@ #include #include -#include -#include +#include "utils/fmt_logging.h" +#include "utils/api_utilities.h" TEST(core, logging) { diff --git a/src/rdsn/src/utils/test/long_adder_test.cpp b/src/rdsn/src/utils/test/long_adder_test.cpp index 71d8e4ffb9..6ee8cb774d 100644 --- a/src/rdsn/src/utils/test/long_adder_test.cpp +++ b/src/rdsn/src/utils/test/long_adder_test.cpp @@ -23,8 +23,8 @@ #include #include -#include -#include +#include "runtime/api_layer1.h" +#include "utils/long_adder.h" namespace dsn { diff --git a/src/rdsn/src/utils/test/main.cpp b/src/rdsn/src/utils/test/main.cpp index ef43558934..163f8d70d5 100644 --- a/src/rdsn/src/utils/test/main.cpp +++ b/src/rdsn/src/utils/test/main.cpp @@ -16,9 +16,9 @@ // under the License. #include -#include -#include -#include +#include "utils/api_utilities.h" +#include "utils/logging_provider.h" +#include "utils/flags.h" extern void command_manager_module_init(); diff --git a/src/rdsn/src/utils/test/metrics_test.cpp b/src/rdsn/src/utils/test/metrics_test.cpp index 777cfa0b74..352682ba08 100644 --- a/src/rdsn/src/utils/test/metrics_test.cpp +++ b/src/rdsn/src/utils/test/metrics_test.cpp @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include -#include +#include "utils/metrics.h" +#include "utils/rand.h" #include #include diff --git a/src/rdsn/src/utils/test/nth_element_bench/nth_element_bench.cpp b/src/rdsn/src/utils/test/nth_element_bench/nth_element_bench.cpp index 6a2b154448..ec672893b8 100644 --- a/src/rdsn/src/utils/test/nth_element_bench/nth_element_bench.cpp +++ b/src/rdsn/src/utils/test/nth_element_bench/nth_element_bench.cpp @@ -27,11 +27,11 @@ #include -#include -#include -#include -#include -#include +#include "runtime/api_layer1.h" +#include "utils/nth_element.h" +#include "utils/smart_pointers.h" +#include "utils/string_conv.h" +#include "utils/strings.h" #include "utils/test/nth_element_utils.h" diff --git a/src/rdsn/src/utils/test/nth_element_test.cpp b/src/rdsn/src/utils/test/nth_element_test.cpp index 44586ecf26..bec46861e7 100644 --- a/src/rdsn/src/utils/test/nth_element_test.cpp +++ b/src/rdsn/src/utils/test/nth_element_test.cpp @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include +#include "utils/nth_element.h" #include #include diff --git a/src/rdsn/src/utils/test/nth_element_utils.h b/src/rdsn/src/utils/test/nth_element_utils.h index 7b138b2cfb..00078eb75a 100644 --- a/src/rdsn/src/utils/test/nth_element_utils.h +++ b/src/rdsn/src/utils/test/nth_element_utils.h @@ -26,11 +26,11 @@ #include -#include -#include -#include -#include -#include +#include "utils/api_utilities.h" +#include "utils/fmt_logging.h" +#include "utils/ports.h" +#include "utils/process_utils.h" +#include "utils/rand.h" #include "perf_counter/perf_counter_atomic.h" diff --git a/src/rdsn/src/utils/test/output_utils_test.cpp b/src/rdsn/src/utils/test/output_utils_test.cpp index 270b395b45..f890b4cf5a 100644 --- a/src/rdsn/src/utils/test/output_utils_test.cpp +++ b/src/rdsn/src/utils/test/output_utils_test.cpp @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "dsn/utility/output_utils.h" +#include "utils/output_utils.h" #include diff --git a/src/rdsn/src/utils/test/percentile_utils.h b/src/rdsn/src/utils/test/percentile_utils.h index b764f5e0da..83116eac7f 100644 --- a/src/rdsn/src/utils/test/percentile_utils.h +++ b/src/rdsn/src/utils/test/percentile_utils.h @@ -22,9 +22,9 @@ #include #include -#include -#include -#include +#include "utils/api_utilities.h" +#include "utils/metrics.h" +#include "utils/fmt_logging.h" #include "nth_element_utils.h" diff --git a/src/rdsn/src/utils/test/priority_queue.cpp b/src/rdsn/src/utils/test/priority_queue.cpp index 348abc2f11..6497961ba9 100644 --- a/src/rdsn/src/utils/test/priority_queue.cpp +++ b/src/rdsn/src/utils/test/priority_queue.cpp @@ -33,7 +33,7 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include +#include "utils/priority_queue.h" #include #include diff --git a/src/rdsn/src/utils/test/rand_test.cpp b/src/rdsn/src/utils/test/rand_test.cpp index 0f1c5bcf0f..1bc67e87d6 100644 --- a/src/rdsn/src/utils/test/rand_test.cpp +++ b/src/rdsn/src/utils/test/rand_test.cpp @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include +#include "utils/rand.h" #include #include diff --git a/src/rdsn/src/utils/test/sema.cpp b/src/rdsn/src/utils/test/sema.cpp index 0099896a9d..7a475423e1 100644 --- a/src/rdsn/src/utils/test/sema.cpp +++ b/src/rdsn/src/utils/test/sema.cpp @@ -33,7 +33,7 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include +#include "utils/hpc_locks/sema.h" #include #include diff --git a/src/rdsn/src/utils/test/smart_pointers_test.cpp b/src/rdsn/src/utils/test/smart_pointers_test.cpp index 518ee19ee1..4f9f2744fa 100644 --- a/src/rdsn/src/utils/test/smart_pointers_test.cpp +++ b/src/rdsn/src/utils/test/smart_pointers_test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include "utils/smart_pointers.h" #include diff --git a/src/rdsn/src/utils/test/string_conv_test.cpp b/src/rdsn/src/utils/test/string_conv_test.cpp index 01607591dd..237808e5b4 100644 --- a/src/rdsn/src/utils/test/string_conv_test.cpp +++ b/src/rdsn/src/utils/test/string_conv_test.cpp @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include +#include "utils/string_conv.h" #include TEST(string_conv, buf2bool) diff --git a/src/rdsn/src/utils/test/string_view_test.cpp b/src/rdsn/src/utils/test/string_view_test.cpp index 3ec54ae973..c6e03c7bda 100644 --- a/src/rdsn/src/utils/test/string_view_test.cpp +++ b/src/rdsn/src/utils/test/string_view_test.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include "utils/string_view.h" #include diff --git a/src/rdsn/src/utils/test/time_utils_test.cpp b/src/rdsn/src/utils/test/time_utils_test.cpp index 4290581a22..f45e929e62 100644 --- a/src/rdsn/src/utils/test/time_utils_test.cpp +++ b/src/rdsn/src/utils/test/time_utils_test.cpp @@ -24,9 +24,9 @@ * THE SOFTWARE. */ -#include +#include "utils/time_utils.h" #include -#include +#include "runtime/api_layer1.h" namespace dsn { namespace utils { diff --git a/src/rdsn/src/utils/test/token_bucket_throttling_controller_test.cpp b/src/rdsn/src/utils/test/token_bucket_throttling_controller_test.cpp index 41a805ffb8..a7f38607b9 100644 --- a/src/rdsn/src/utils/test/token_bucket_throttling_controller_test.cpp +++ b/src/rdsn/src/utils/test/token_bucket_throttling_controller_test.cpp @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include +#include "utils/token_bucket_throttling_controller.h" #include namespace dsn { diff --git a/src/rdsn/src/utils/test/token_buckets_test.cpp b/src/rdsn/src/utils/test/token_buckets_test.cpp index bef18ed9b9..10d2814f39 100644 --- a/src/rdsn/src/utils/test/token_buckets_test.cpp +++ b/src/rdsn/src/utils/test/token_buckets_test.cpp @@ -16,7 +16,7 @@ // under the License. #include -#include +#include "utils/token_buckets.h" namespace dsn { namespace utils { diff --git a/src/rdsn/src/utils/test/utils.cpp b/src/rdsn/src/utils/test/utils.cpp index 7cf009aa73..c8682aa8d3 100644 --- a/src/rdsn/src/utils/test/utils.cpp +++ b/src/rdsn/src/utils/test/utils.cpp @@ -33,16 +33,16 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include -#include -#include -#include -#include -#include -#include -#include +#include "utils/utils.h" +#include "utils/strings.h" +#include "utils/binary_reader.h" +#include "utils/binary_writer.h" +#include "utils/link.h" +#include "utils/crc.h" +#include "utils/autoref_ptr.h" +#include "runtime/api_layer1.h" #include -#include +#include "utils/rand.h" using namespace ::dsn; using namespace ::dsn::utils; diff --git a/src/rdsn/src/utils/thread_access_checker.cpp b/src/rdsn/src/utils/thread_access_checker.cpp index fc50acab53..0d09a064cc 100644 --- a/src/rdsn/src/utils/thread_access_checker.cpp +++ b/src/rdsn/src/utils/thread_access_checker.cpp @@ -23,9 +23,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include -#include -#include +#include "utils/process_utils.h" +#include "utils/thread_access_checker.h" +#include "utils/api_utilities.h" namespace dsn { diff --git a/src/rdsn/include/dsn/tool-api/thread_access_checker.h b/src/rdsn/src/utils/thread_access_checker.h similarity index 100% rename from src/rdsn/include/dsn/tool-api/thread_access_checker.h rename to src/rdsn/src/utils/thread_access_checker.h diff --git a/src/rdsn/include/dsn/tool-api/threadpool_code.h b/src/rdsn/src/utils/threadpool_code.h similarity index 98% rename from src/rdsn/include/dsn/tool-api/threadpool_code.h rename to src/rdsn/src/utils/threadpool_code.h index 9b34caab42..5abf4747c1 100644 --- a/src/rdsn/include/dsn/tool-api/threadpool_code.h +++ b/src/rdsn/src/utils/threadpool_code.h @@ -26,7 +26,7 @@ #pragma once -#include +#include "ports.h" namespace dsn { class threadpool_code diff --git a/src/rdsn/include/dsn/tool-api/threadpool_spec.h b/src/rdsn/src/utils/threadpool_spec.h similarity index 97% rename from src/rdsn/include/dsn/tool-api/threadpool_spec.h rename to src/rdsn/src/utils/threadpool_spec.h index ed168929cb..f9bd082a1e 100644 --- a/src/rdsn/include/dsn/tool-api/threadpool_spec.h +++ b/src/rdsn/src/utils/threadpool_spec.h @@ -28,9 +28,9 @@ #include #include -#include -#include -#include +#include "utils/enum_helper.h" +#include "utils/config_helper.h" +#include "utils/threadpool_code.h" namespace dsn { diff --git a/src/rdsn/src/utils/throttling_controller.cpp b/src/rdsn/src/utils/throttling_controller.cpp index 2a455e5767..cf83065d97 100644 --- a/src/rdsn/src/utils/throttling_controller.cpp +++ b/src/rdsn/src/utils/throttling_controller.cpp @@ -17,9 +17,9 @@ #include "throttling_controller.h" -#include -#include -#include +#include "runtime/api_layer1.h" +#include "utils/string_conv.h" +#include "utils/strings.h" namespace dsn { namespace replication { diff --git a/src/rdsn/src/utils/time_utils.cpp b/src/rdsn/src/utils/time_utils.cpp index ed12fdef68..d1f6464457 100644 --- a/src/rdsn/src/utils/time_utils.cpp +++ b/src/rdsn/src/utils/time_utils.cpp @@ -17,7 +17,7 @@ * under the License. */ -#include +#include "utils/time_utils.h" #include #if FMT_VERSION < 60000 #include // time.h was removed from fmtlib >=6.x diff --git a/src/rdsn/include/dsn/utils/time_utils.h b/src/rdsn/src/utils/time_utils.h similarity index 99% rename from src/rdsn/include/dsn/utils/time_utils.h rename to src/rdsn/src/utils/time_utils.h index 41e93083db..04f3616d47 100644 --- a/src/rdsn/include/dsn/utils/time_utils.h +++ b/src/rdsn/src/utils/time_utils.h @@ -27,7 +27,8 @@ #include #include -#include + +#include "string_view.h" namespace dsn { namespace utils { diff --git a/src/rdsn/include/dsn/utility/timer.h b/src/rdsn/src/utils/timer.h similarity index 97% rename from src/rdsn/include/dsn/utility/timer.h rename to src/rdsn/src/utils/timer.h index 940e1ce052..083b940673 100644 --- a/src/rdsn/include/dsn/utility/timer.h +++ b/src/rdsn/src/utils/timer.h @@ -17,7 +17,7 @@ #pragma once -#include +#include "utils/chrono_literals.h" namespace dsn { diff --git a/src/rdsn/src/utils/token_bucket_throttling_controller.cpp b/src/rdsn/src/utils/token_bucket_throttling_controller.cpp index e7f0f4c305..6a355bbf27 100644 --- a/src/rdsn/src/utils/token_bucket_throttling_controller.cpp +++ b/src/rdsn/src/utils/token_bucket_throttling_controller.cpp @@ -15,10 +15,10 @@ // specific language governing permissions and limitations // under the License. -#include "dsn/utils/token_bucket_throttling_controller.h" +#include "token_bucket_throttling_controller.h" -#include -#include +#include "api_utilities.h" +#include "string_conv.h" namespace dsn { namespace utils { diff --git a/src/rdsn/include/dsn/utils/token_bucket_throttling_controller.h b/src/rdsn/src/utils/token_bucket_throttling_controller.h similarity index 98% rename from src/rdsn/include/dsn/utils/token_bucket_throttling_controller.h rename to src/rdsn/src/utils/token_bucket_throttling_controller.h index 1385c42304..0a5dec06c0 100644 --- a/src/rdsn/include/dsn/utils/token_bucket_throttling_controller.h +++ b/src/rdsn/src/utils/token_bucket_throttling_controller.h @@ -18,7 +18,7 @@ #include #include -#include +#include "utils/TokenBucket.h" namespace dsn { namespace utils { diff --git a/src/rdsn/src/utils/token_buckets.cpp b/src/rdsn/src/utils/token_buckets.cpp index 4bb602b996..449167ba56 100644 --- a/src/rdsn/src/utils/token_buckets.cpp +++ b/src/rdsn/src/utils/token_buckets.cpp @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include "dsn/utils/token_buckets.h" +#include "token_buckets.h" namespace dsn { namespace utils { diff --git a/src/rdsn/include/dsn/utils/token_buckets.h b/src/rdsn/src/utils/token_buckets.h similarity index 94% rename from src/rdsn/include/dsn/utils/token_buckets.h rename to src/rdsn/src/utils/token_buckets.h index 894edbeeec..d2a698ef10 100644 --- a/src/rdsn/include/dsn/utils/token_buckets.h +++ b/src/rdsn/src/utils/token_buckets.h @@ -19,8 +19,8 @@ #include -#include -#include +#include "utils/synchronize.h" +#include "utils/TokenBucket.h" namespace dsn { namespace utils { diff --git a/src/rdsn/include/dsn/tool-api/uniq_timestamp_us.h b/src/rdsn/src/utils/uniq_timestamp_us.h similarity index 96% rename from src/rdsn/include/dsn/tool-api/uniq_timestamp_us.h rename to src/rdsn/src/utils/uniq_timestamp_us.h index 9df8088b65..5094071f2e 100644 --- a/src/rdsn/include/dsn/tool-api/uniq_timestamp_us.h +++ b/src/rdsn/src/utils/uniq_timestamp_us.h @@ -23,12 +23,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ + #pragma once #include #include -#include -#include +#include "utils/ports.h" +#include "runtime/api_layer1.h" namespace dsn { // diff --git a/src/rdsn/src/utils/utils.cpp b/src/rdsn/src/utils/utils.cpp index d0ddf27f74..4b363c8ab8 100644 --- a/src/rdsn/src/utils/utils.cpp +++ b/src/rdsn/src/utils/utils.cpp @@ -33,7 +33,7 @@ * xxxx-xx-xx, author, fix bug about xxx */ -#include +#include "utils/utils.h" #include #include @@ -47,8 +47,21 @@ #include #include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "utils/singleton.h" #include #include diff --git a/src/rdsn/include/dsn/utility/utils.h b/src/rdsn/src/utils/utils.h similarity index 95% rename from src/rdsn/include/dsn/utility/utils.h rename to src/rdsn/src/utils/utils.h index 55beb1adaa..d770b7fb36 100644 --- a/src/rdsn/include/dsn/utility/utils.h +++ b/src/rdsn/src/utils/utils.h @@ -24,22 +24,13 @@ * THE SOFTWARE. */ -/* - * Description: - * What is this file about? - * - * Revision history: - * xxxx-xx-xx, author, first version - * xxxx-xx-xx, author, fix bug about xxx - */ - #pragma once #include #include -#include -#include +#include "rpc_address.h" +#include "string_view.h" #define TIME_MS_MAX 0xffffffff diff --git a/src/rdsn/include/dsn/utility/work_queue.h b/src/rdsn/src/utils/work_queue.h similarity index 97% rename from src/rdsn/include/dsn/utility/work_queue.h rename to src/rdsn/src/utils/work_queue.h index 0b3fb7e0cf..62ecdba256 100644 --- a/src/rdsn/include/dsn/utility/work_queue.h +++ b/src/rdsn/src/utils/work_queue.h @@ -35,8 +35,8 @@ #pragma once -#include -#include +#include "utils/synchronize.h" +#include "utils/link.h" #include namespace dsn { diff --git a/src/rdsn/src/utils/zlock_provider.h b/src/rdsn/src/utils/zlock_provider.h index 871e29ef45..0658066404 100644 --- a/src/rdsn/src/utils/zlock_provider.h +++ b/src/rdsn/src/utils/zlock_provider.h @@ -26,9 +26,9 @@ #pragma once -#include -#include -#include +#include "utils/extensible_object.h" +#include "utils/factory_store.h" +#include "utils/zlocks.h" namespace dsn { diff --git a/src/rdsn/include/dsn/tool-api/zlocks.h b/src/rdsn/src/utils/zlocks.h similarity index 97% rename from src/rdsn/include/dsn/tool-api/zlocks.h rename to src/rdsn/src/utils/zlocks.h index ad73a5b939..de8c5e1706 100644 --- a/src/rdsn/include/dsn/tool-api/zlocks.h +++ b/src/rdsn/src/utils/zlocks.h @@ -27,7 +27,7 @@ #pragma once #include -#include +#include "utils/utils.h" /// /// synchronization objects of rDSN. @@ -36,7 +36,7 @@ /// in rdsn's "service_app", because different implementations may be provided /// when then program is running in different mode(nativerun/simulator). /// -/// As for the synchronize objects in "utility/synchronize.h", they are +/// As for the synchronize objects in "utils/synchronize.h", they are /// used for synchronization inner the rdsn core runtime. /// diff --git a/src/rdsn/src/zookeeper/distributed_lock_service_zookeeper.cpp b/src/rdsn/src/zookeeper/distributed_lock_service_zookeeper.cpp index 1dff571f5b..77e600d1e0 100644 --- a/src/rdsn/src/zookeeper/distributed_lock_service_zookeeper.cpp +++ b/src/rdsn/src/zookeeper/distributed_lock_service_zookeeper.cpp @@ -31,8 +31,8 @@ * Revision history: * 2015-12-04, @shengofsun (sunweijie@xiaomi.com) */ -#include -#include +#include "runtime/task/async_calls.h" +#include "common/replication.codes.h" #include #include diff --git a/src/rdsn/src/zookeeper/distributed_lock_service_zookeeper.h b/src/rdsn/src/zookeeper/distributed_lock_service_zookeeper.h index 2e3855f22b..4aadb6b544 100644 --- a/src/rdsn/src/zookeeper/distributed_lock_service_zookeeper.h +++ b/src/rdsn/src/zookeeper/distributed_lock_service_zookeeper.h @@ -33,7 +33,7 @@ */ #pragma once -#include +#include "utils/distributed_lock_service.h" #include #include "lock_types.h" diff --git a/src/rdsn/src/zookeeper/lock_struct.cpp b/src/rdsn/src/zookeeper/lock_struct.cpp index 7ade218f48..fb75b39e42 100644 --- a/src/rdsn/src/zookeeper/lock_struct.cpp +++ b/src/rdsn/src/zookeeper/lock_struct.cpp @@ -40,8 +40,8 @@ #include #include -#include -#include +#include "utils/thread_access_checker.h" +#include "runtime/task/async_calls.h" #include "distributed_lock_service_zookeeper.h" #include "lock_struct.h" diff --git a/src/rdsn/src/zookeeper/lock_struct.h b/src/rdsn/src/zookeeper/lock_struct.h index 26b8165ad8..2a7e8bee26 100644 --- a/src/rdsn/src/zookeeper/lock_struct.h +++ b/src/rdsn/src/zookeeper/lock_struct.h @@ -33,8 +33,8 @@ */ #pragma once -#include -#include +#include "utils/thread_access_checker.h" +#include "utils/distributed_lock_service.h" #include #include "lock_types.h" diff --git a/src/rdsn/src/zookeeper/lock_types.h b/src/rdsn/src/zookeeper/lock_types.h index a47263404c..01035e422f 100644 --- a/src/rdsn/src/zookeeper/lock_types.h +++ b/src/rdsn/src/zookeeper/lock_types.h @@ -33,9 +33,12 @@ */ #pragma once -#include -#include -#include +#include "utils/autoref_ptr.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "utils/distributed_lock_service.h" namespace dsn { namespace dist { diff --git a/src/rdsn/src/zookeeper/test/distributed_lock_zookeeper.cpp b/src/rdsn/src/zookeeper/test/distributed_lock_zookeeper.cpp index a74ade1ee6..c770b3bda1 100644 --- a/src/rdsn/src/zookeeper/test/distributed_lock_zookeeper.cpp +++ b/src/rdsn/src/zookeeper/test/distributed_lock_zookeeper.cpp @@ -32,7 +32,20 @@ #include #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" #include "zookeeper/distributed_lock_service_zookeeper.h" #include "zookeeper/lock_struct.h" diff --git a/src/rdsn/src/zookeeper/test/main.cpp b/src/rdsn/src/zookeeper/test/main.cpp index f85554e5bc..87b7739cb7 100644 --- a/src/rdsn/src/zookeeper/test/main.cpp +++ b/src/rdsn/src/zookeeper/test/main.cpp @@ -32,7 +32,20 @@ #endif #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" int g_test_count = 0; int g_test_ret = 0; diff --git a/src/rdsn/src/zookeeper/zookeeper_error.cpp b/src/rdsn/src/zookeeper/zookeeper_error.cpp index 8f893a1354..85dbcbad74 100644 --- a/src/rdsn/src/zookeeper/zookeeper_error.cpp +++ b/src/rdsn/src/zookeeper/zookeeper_error.cpp @@ -33,8 +33,11 @@ */ #include -#include -#include +#include "utils/error_code.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" #include "zookeeper_error.h" namespace dsn { diff --git a/src/rdsn/src/zookeeper/zookeeper_error.h b/src/rdsn/src/zookeeper/zookeeper_error.h index 6df9aee17c..2298bbd5f8 100644 --- a/src/rdsn/src/zookeeper/zookeeper_error.h +++ b/src/rdsn/src/zookeeper/zookeeper_error.h @@ -33,7 +33,10 @@ */ #pragma once -#include +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" namespace dsn { namespace dist { diff --git a/src/rdsn/src/zookeeper/zookeeper_session.cpp b/src/rdsn/src/zookeeper/zookeeper_session.cpp index 4c9bb5b9fa..7cd5c1ad1f 100644 --- a/src/rdsn/src/zookeeper/zookeeper_session.cpp +++ b/src/rdsn/src/zookeeper/zookeeper_session.cpp @@ -38,7 +38,7 @@ #include "zookeeper_session.h" #include "zookeeper_session_mgr.h" -#include +#include "utils/flags.h" namespace dsn { namespace security { diff --git a/src/rdsn/src/zookeeper/zookeeper_session.h b/src/rdsn/src/zookeeper/zookeeper_session.h index 43aca88053..49c0dc5f90 100644 --- a/src/rdsn/src/zookeeper/zookeeper_session.h +++ b/src/rdsn/src/zookeeper/zookeeper_session.h @@ -32,9 +32,9 @@ * 2015-12-04, @shengofsun (sunweijie@xiaomi.com) */ -#include -#include -#include +#include "utils/utils.h" +#include "utils/singleton.h" +#include "utils/synchronize.h" #include #include diff --git a/src/rdsn/src/zookeeper/zookeeper_session_mgr.h b/src/rdsn/src/zookeeper/zookeeper_session_mgr.h index 0f3d18039d..d6df0e062a 100644 --- a/src/rdsn/src/zookeeper/zookeeper_session_mgr.h +++ b/src/rdsn/src/zookeeper/zookeeper_session_mgr.h @@ -33,8 +33,21 @@ * 2015-12-04, @shengofsun (sunweijie@xiaomi.com) */ -#include -#include +#include "utils/singleton_store.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" #include #pragma once diff --git a/src/redis_protocol/proxy_lib/proxy_layer.cpp b/src/redis_protocol/proxy_lib/proxy_layer.cpp index 5f00146f67..cce6b97c39 100644 --- a/src/redis_protocol/proxy_lib/proxy_layer.cpp +++ b/src/redis_protocol/proxy_lib/proxy_layer.cpp @@ -17,7 +17,7 @@ * under the License. */ -#include +#include "runtime/task/task_spec.h" #include #include "proxy_layer.h" diff --git a/src/redis_protocol/proxy_lib/proxy_layer.h b/src/redis_protocol/proxy_lib/proxy_layer.h index 9bac31569a..a83cb55fa4 100644 --- a/src/redis_protocol/proxy_lib/proxy_layer.h +++ b/src/redis_protocol/proxy_lib/proxy_layer.h @@ -19,8 +19,21 @@ #pragma once -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "utils/zlocks.h" #include #include diff --git a/src/redis_protocol/proxy_lib/redis_parser.cpp b/src/redis_protocol/proxy_lib/redis_parser.cpp index 04b871ee3f..4f41e14ec8 100644 --- a/src/redis_protocol/proxy_lib/redis_parser.cpp +++ b/src/redis_protocol/proxy_lib/redis_parser.cpp @@ -20,9 +20,9 @@ #include "redis_parser.h" #include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "common/replication_other_types.h" +#include "utils/string_conv.h" #include #include diff --git a/src/redis_protocol/proxy_ut/redis_proxy_test.cpp b/src/redis_protocol/proxy_ut/redis_proxy_test.cpp index 124f00f460..fa1316a9d7 100644 --- a/src/redis_protocol/proxy_ut/redis_proxy_test.cpp +++ b/src/redis_protocol/proxy_ut/redis_proxy_test.cpp @@ -22,8 +22,8 @@ #include #include -#include -#include +#include "utils/string_conv.h" +#include "utils/rand.h" #include #include diff --git a/src/reporter/pegasus_counter_reporter.cpp b/src/reporter/pegasus_counter_reporter.cpp index 1e5b5eab5d..cef95f298b 100644 --- a/src/reporter/pegasus_counter_reporter.cpp +++ b/src/reporter/pegasus_counter_reporter.cpp @@ -33,10 +33,10 @@ #include #include -#include -#include -#include -#include +#include "runtime/service_app.h" +#include "common/common.h" +#include "utils/fmt_logging.h" +#include "utils/flags.h" #include "base/pegasus_utils.h" #include "pegasus_io_service.h" diff --git a/src/reporter/pegasus_counter_reporter.h b/src/reporter/pegasus_counter_reporter.h index 314dd78d51..d1107ba965 100644 --- a/src/reporter/pegasus_counter_reporter.h +++ b/src/reporter/pegasus_counter_reporter.h @@ -19,9 +19,9 @@ #pragma once -#include -#include -#include +#include "utils/singleton.h" +#include "utils/synchronize.h" +#include "common/json_helper.h" #include #include diff --git a/src/reporter/pegasus_io_service.h b/src/reporter/pegasus_io_service.h index 9ddcd0329b..03e27330fb 100644 --- a/src/reporter/pegasus_io_service.h +++ b/src/reporter/pegasus_io_service.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include "utils/singleton.h" namespace pegasus { namespace server { diff --git a/src/sample/Makefile b/src/sample/CMakeLists.txt similarity index 53% rename from src/sample/Makefile rename to src/sample/CMakeLists.txt index 2dd3197f03..788bdfc234 100644 --- a/src/sample/Makefile +++ b/src/sample/CMakeLists.txt @@ -15,24 +15,21 @@ # specific language governing permissions and limitations # under the License. -# pegasus client depends on pthread, rt, dl, aio, boost_system boost_filesystem for linkage, -# no matter the shared or static library -# please make sure to install these depedencies properly -CXX = g++ -CXXFLAGS = -std=c++11 -g -INCLUDE = -I../include -LIBRARY = -Wl,-rpath-link,../lib -L../lib -L../../DSN_ROOT/lib -lpegasus_client_static -lcrypto -lpthread -lrt -ldl -laio -lboost_system -lboost_filesystem -CPPS = $(wildcard vad_stdaln/*.cpp) $(wildcard ./*.cpp) -OBJS = $(patsubst %.cpp,%.o,$(CPPS)) +set(MY_PROJ_NAME "sample") -all: pegasus_cpp_sample +set(MY_SRC_SEARCH_MODE "GLOB") -%.o: %.cpp - $(CXX) $(CXXFLAGS) $(INCLUDE) -c -o $@ $< +set(MY_PROJ_LIBS + pegasus_client_static + ) -pegasus_cpp_sample: $(OBJS) - $(CXX) -o $@ $(OBJS) $(LIBRARY) +set(MY_BOOST_LIBS + Boost::filesystem + Boost::system + Boost::regex + ) -clean: - rm -f $(OBJS) pegasus_cpp_sample *.o +set(MY_BINPLACES config.ini run.sh) +dsn_add_executable() +dsn_install_executable() diff --git a/src/sample/README.md b/src/sample/README.md index ea5d02659e..7e31b98c9a 100644 --- a/src/sample/README.md +++ b/src/sample/README.md @@ -17,10 +17,6 @@ specific language governing permissions and limitations under the License. --> -Build -===== -make - Run === ./run.sh @@ -29,4 +25,3 @@ For example: ./run.sh onebox temp To change cluster, please modify the last line of `config.ini'. - diff --git a/src/sample/run.sh b/src/sample/run.sh index b8ee90b35e..646446ef83 100755 --- a/src/sample/run.sh +++ b/src/sample/run.sh @@ -16,5 +16,5 @@ # specific language governing permissions and limitations # under the License. -LD_LIBRARY_PATH=`pwd`/../lib:`pwd`/../../DSN_ROOT/lib ./pegasus_cpp_sample onebox temp - +export LD_LIBRARY_PATH=`pwd`/../../../../../thirdparty/output/lib:`pwd`/../../lib:/usr/lib/jvm/java-1.8.0-openjdk/jre/lib/amd64/server +./sample onebox temp diff --git a/src/server/available_detector.cpp b/src/server/available_detector.cpp index 75df12743f..707072bb9e 100644 --- a/src/server/available_detector.cpp +++ b/src/server/available_detector.cpp @@ -20,8 +20,8 @@ #include "available_detector.h" #include -#include -#include +#include "common/common.h" +#include "utils/time_utils.h" #include #include diff --git a/src/server/available_detector.h b/src/server/available_detector.h index 3baad79a1e..48dae71a44 100644 --- a/src/server/available_detector.h +++ b/src/server/available_detector.h @@ -20,8 +20,8 @@ #pragma once #include -#include -#include +#include "client/replication_ddl_client.h" +#include "perf_counter/perf_counter_wrapper.h" namespace pegasus { namespace server { diff --git a/src/server/brief_stat.cpp b/src/server/brief_stat.cpp index 04be2fd2b9..8d3c8045d2 100644 --- a/src/server/brief_stat.cpp +++ b/src/server/brief_stat.cpp @@ -18,8 +18,8 @@ */ #include -#include -#include +#include "utils/api_utilities.h" +#include "perf_counter/perf_counters.h" #include "brief_stat.h" diff --git a/src/server/capacity_unit_calculator.cpp b/src/server/capacity_unit_calculator.cpp index c630bef397..8f2574fd6c 100644 --- a/src/server/capacity_unit_calculator.cpp +++ b/src/server/capacity_unit_calculator.cpp @@ -19,8 +19,8 @@ #include "capacity_unit_calculator.h" -#include -#include +#include "utils/config_api.h" +#include "utils/token_bucket_throttling_controller.h" #include #include "hotkey_collector.h" diff --git a/src/server/capacity_unit_calculator.h b/src/server/capacity_unit_calculator.h index 0ff0ac7d67..404c2964a4 100644 --- a/src/server/capacity_unit_calculator.h +++ b/src/server/capacity_unit_calculator.h @@ -19,8 +19,9 @@ #pragma once -#include -#include +#include "replica/replica_base.h" +#include "runtime/rpc/rpc_message.h" +#include "perf_counter/perf_counter_wrapper.h" #include namespace dsn { diff --git a/src/server/compaction_filter_rule.cpp b/src/server/compaction_filter_rule.cpp index d373d9fc27..b81259c3f0 100644 --- a/src/server/compaction_filter_rule.cpp +++ b/src/server/compaction_filter_rule.cpp @@ -19,9 +19,9 @@ #include "compaction_filter_rule.h" -#include -#include -#include +#include "utils/fmt_logging.h" +#include "utils/string_view.h" +#include "utils/api_utilities.h" #include "base/pegasus_utils.h" #include "base/pegasus_value_schema.h" diff --git a/src/server/compaction_filter_rule.h b/src/server/compaction_filter_rule.h index ed038e3cf8..71f7c5b175 100644 --- a/src/server/compaction_filter_rule.h +++ b/src/server/compaction_filter_rule.h @@ -19,8 +19,8 @@ #pragma once -#include -#include +#include "utils/enum_helper.h" +#include "common/json_helper.h" #include #include "base/pegasus_value_schema.h" diff --git a/src/server/hashkey_transform.h b/src/server/hashkey_transform.h index e0f64ff968..2f99d9b0b7 100644 --- a/src/server/hashkey_transform.h +++ b/src/server/hashkey_transform.h @@ -22,9 +22,9 @@ #include #include -#include -#include -#include +#include "utils/api_utilities.h" +#include "utils/blob.h" +#include "utils/endians.h" namespace pegasus { namespace server { diff --git a/src/server/hotkey_collector.cpp b/src/server/hotkey_collector.cpp index d05bd7bdcc..28dd1fe183 100644 --- a/src/server/hotkey_collector.cpp +++ b/src/server/hotkey_collector.cpp @@ -17,11 +17,11 @@ #include "hotkey_collector.h" -#include -#include +#include "common/replication_enums.h" +#include "utils/smart_pointers.h" #include -#include -#include +#include "utils/fmt_logging.h" +#include "utils/flags.h" #include "base/pegasus_key_schema.h" #include "base/pegasus_utils.h" diff --git a/src/server/hotkey_collector.h b/src/server/hotkey_collector.h index 92b140b0f8..ed84532271 100644 --- a/src/server/hotkey_collector.h +++ b/src/server/hotkey_collector.h @@ -17,9 +17,15 @@ #pragma once -#include +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" #include -#include +#include "replica/replica_base.h" #include "hotkey_collector_state.h" namespace pegasus { diff --git a/src/server/hotkey_collector_state.h b/src/server/hotkey_collector_state.h index 315ac7cdd3..aff1ce7fe6 100644 --- a/src/server/hotkey_collector_state.h +++ b/src/server/hotkey_collector_state.h @@ -17,7 +17,7 @@ #pragma once -#include +#include "utils/enum_helper.h" namespace pegasus { namespace server { diff --git a/src/server/hotspot_partition_calculator.cpp b/src/server/hotspot_partition_calculator.cpp index f072fc062f..366114cbfb 100644 --- a/src/server/hotspot_partition_calculator.cpp +++ b/src/server/hotspot_partition_calculator.cpp @@ -18,12 +18,12 @@ #include "hotspot_partition_calculator.h" #include -#include -#include -#include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "common/serialization_helper/dsn.layer2_types.h" +#include "utils/flags.h" +#include "utils/error_code.h" +#include "utils/fail_point.h" +#include "common//duplication_common.h" namespace pegasus { namespace server { diff --git a/src/server/hotspot_partition_calculator.h b/src/server/hotspot_partition_calculator.h index 1e7c38e94d..94326c0f68 100644 --- a/src/server/hotspot_partition_calculator.h +++ b/src/server/hotspot_partition_calculator.h @@ -19,8 +19,8 @@ #include -#include -#include +#include "perf_counter/perf_counter.h" +#include "utils/flags.h" #include "hotspot_partition_stat.h" namespace pegasus { diff --git a/src/server/info_collector.cpp b/src/server/info_collector.cpp index 3a569dcb81..98e3263474 100644 --- a/src/server/info_collector.cpp +++ b/src/server/info_collector.cpp @@ -23,9 +23,9 @@ #include #include #include -#include -#include -#include +#include "runtime/rpc/group_address.h" +#include "common/common.h" +#include "utils/fmt_logging.h" #include "base/pegasus_const.h" #include "result_writer.h" diff --git a/src/server/info_collector.h b/src/server/info_collector.h index 9f26901622..707f389901 100644 --- a/src/server/info_collector.h +++ b/src/server/info_collector.h @@ -19,10 +19,25 @@ #pragma once -#include -#include -#include -#include +#include "runtime/task/task_tracker.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "common/replication_other_types.h" +#include "common/replication.codes.h" +#include "common/replication_other_types.h" +#include "perf_counter/perf_counter_wrapper.h" #include #include diff --git a/src/server/info_collector_app.cpp b/src/server/info_collector_app.cpp index a8c0c9f041..959a62daa6 100644 --- a/src/server/info_collector_app.cpp +++ b/src/server/info_collector_app.cpp @@ -20,8 +20,23 @@ #include "info_collector_app.h" #include "reporter/pegasus_counter_reporter.h" -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "common/replication_other_types.h" +#include "common/replication.codes.h" +#include "common/replication_other_types.h" #include #include diff --git a/src/server/info_collector_app.h b/src/server/info_collector_app.h index ebf416c46f..e4ff019aa2 100644 --- a/src/server/info_collector_app.h +++ b/src/server/info_collector_app.h @@ -19,8 +19,8 @@ #pragma once -#include -#include +#include "runtime/service_app.h" +#include "http/http_server.h" #include "info_collector.h" #include "available_detector.h" diff --git a/src/server/logging_utils.h b/src/server/logging_utils.h index e85b9b5b8f..77d5e56114 100644 --- a/src/server/logging_utils.h +++ b/src/server/logging_utils.h @@ -19,7 +19,7 @@ #pragma once -#include +#include "utils/fmt_logging.h" /// Utilities for logging the operation on rocksdb. diff --git a/src/server/main.cpp b/src/server/main.cpp index eb3c0a5c36..7391cf19d4 100644 --- a/src/server/main.cpp +++ b/src/server/main.cpp @@ -26,11 +26,11 @@ #include #include -#include -#include +#include "runtime/tool_api.h" +#include "utils/command_manager.h" -#include -#include +#include "replica/replication_service_app.h" +#include "meta/meta_service_app.h" #include #include diff --git a/src/server/meta_store.cpp b/src/server/meta_store.cpp index 78f4532cee..0359cfde99 100644 --- a/src/server/meta_store.cpp +++ b/src/server/meta_store.cpp @@ -19,8 +19,8 @@ #include "meta_store.h" -#include -#include +#include "utils/fmt_logging.h" +#include "utils/flags.h" namespace pegasus { namespace server { diff --git a/src/server/meta_store.h b/src/server/meta_store.h index fb67a53fcc..5b924b8991 100644 --- a/src/server/meta_store.h +++ b/src/server/meta_store.h @@ -20,7 +20,7 @@ #pragma once #include -#include +#include "replica/replica_base.h" #include diff --git a/src/server/pegasus_event_listener.cpp b/src/server/pegasus_event_listener.cpp index 7354b31e36..6957444c59 100644 --- a/src/server/pegasus_event_listener.cpp +++ b/src/server/pegasus_event_listener.cpp @@ -20,7 +20,7 @@ #include "pegasus_event_listener.h" #include "logging_utils.h" -#include +#include "utils/api_utilities.h" namespace pegasus { namespace server { diff --git a/src/server/pegasus_event_listener.h b/src/server/pegasus_event_listener.h index bb5b483bab..79acbfff76 100644 --- a/src/server/pegasus_event_listener.h +++ b/src/server/pegasus_event_listener.h @@ -21,8 +21,8 @@ #include #include -#include -#include +#include "perf_counter/perf_counter_wrapper.h" +#include "replica/replica_base.h" namespace pegasus { namespace server { diff --git a/src/server/pegasus_manual_compact_service.cpp b/src/server/pegasus_manual_compact_service.cpp index cf4901c68d..f69b61ad50 100644 --- a/src/server/pegasus_manual_compact_service.cpp +++ b/src/server/pegasus_manual_compact_service.cpp @@ -19,11 +19,11 @@ #include "pegasus_manual_compact_service.h" -#include -#include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "common/replication.codes.h" +#include "runtime/task/async_calls.h" +#include "utils/string_conv.h" +#include "utils/time_utils.h" #include "base/pegasus_const.h" #include "pegasus_server_impl.h" diff --git a/src/server/pegasus_manual_compact_service.h b/src/server/pegasus_manual_compact_service.h index 0abb50b735..31c02d2990 100644 --- a/src/server/pegasus_manual_compact_service.h +++ b/src/server/pegasus_manual_compact_service.h @@ -20,10 +20,16 @@ #pragma once #include -#include -#include -#include -#include +#include "utils/string_view.h" +#include "perf_counter/perf_counter_wrapper.h" +#include "replica/replica_base.h" +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" namespace pegasus { namespace server { diff --git a/src/server/pegasus_mutation_duplicator.cpp b/src/server/pegasus_mutation_duplicator.cpp index c2513a9d3a..fbc55988ba 100644 --- a/src/server/pegasus_mutation_duplicator.cpp +++ b/src/server/pegasus_mutation_duplicator.cpp @@ -21,8 +21,8 @@ #include "pegasus_server_impl.h" #include "base/pegasus_rpc_types.h" -#include -#include +#include "runtime/message_utils.h" +#include "utils/chrono_literals.h" #include namespace dsn { diff --git a/src/server/pegasus_mutation_duplicator.h b/src/server/pegasus_mutation_duplicator.h index 2d04cbd757..84ff97dda1 100644 --- a/src/server/pegasus_mutation_duplicator.h +++ b/src/server/pegasus_mutation_duplicator.h @@ -19,11 +19,11 @@ #pragma once -#include -#include +#include "replica/duplication/mutation_duplicator.h" +#include "replica/replica_base.h" #include -#include -#include +#include "utils/flags.h" +#include "common//duplication_common.h" #include "client_lib/pegasus_client_factory_impl.h" diff --git a/src/server/pegasus_read_service.h b/src/server/pegasus_read_service.h index df531b239c..697274d832 100644 --- a/src/server/pegasus_read_service.h +++ b/src/server/pegasus_read_service.h @@ -17,8 +17,8 @@ #pragma once #include -#include -#include +#include "replica/replication_app_base.h" +#include "common/storage_serverlet.h" #include namespace pegasus { diff --git a/src/server/pegasus_scan_context.h b/src/server/pegasus_scan_context.h index be858a82d5..9f363924c1 100644 --- a/src/server/pegasus_scan_context.h +++ b/src/server/pegasus_scan_context.h @@ -21,8 +21,8 @@ #include #include -#include -#include +#include "runtime/tool_api.h" +#include "utils/rand.h" #include #include "base/pegasus_const.h" diff --git a/src/server/pegasus_server_impl.cpp b/src/server/pegasus_server_impl.cpp index 36b1088e3d..a9f17f929e 100644 --- a/src/server/pegasus_server_impl.cpp +++ b/src/server/pegasus_server_impl.cpp @@ -24,15 +24,15 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "utils/chrono_literals.h" +#include "utils/utils.h" +#include "utils/filesystem.h" +#include "utils/string_conv.h" +#include "utils/fmt_logging.h" +#include "common/replication.codes.h" +#include "utils/flags.h" +#include "utils/token_bucket_throttling_controller.h" +#include "common//duplication_common.h" #include "base/pegasus_key_schema.h" #include "base/pegasus_value_schema.h" diff --git a/src/server/pegasus_server_impl.h b/src/server/pegasus_server_impl.h index b81c8e3b3d..c907f05b42 100644 --- a/src/server/pegasus_server_impl.h +++ b/src/server/pegasus_server_impl.h @@ -24,9 +24,9 @@ #include #include #include -#include -#include -#include +#include "perf_counter/perf_counter_wrapper.h" +#include "common/replication.codes.h" +#include "utils/flags.h" #include #include #include diff --git a/src/server/pegasus_server_impl_init.cpp b/src/server/pegasus_server_impl_init.cpp index cf34f04cb3..d5171afbc1 100644 --- a/src/server/pegasus_server_impl_init.cpp +++ b/src/server/pegasus_server_impl_init.cpp @@ -20,9 +20,9 @@ #include "pegasus_server_impl.h" #include -#include +#include "utils/flags.h" #include -#include +#include "utils/token_bucket_throttling_controller.h" #include "capacity_unit_calculator.h" #include "hashkey_transform.h" diff --git a/src/server/pegasus_server_write.cpp b/src/server/pegasus_server_write.cpp index 8501bd1c41..eeaae1510e 100644 --- a/src/server/pegasus_server_write.cpp +++ b/src/server/pegasus_server_write.cpp @@ -17,9 +17,9 @@ * under the License. */ -#include -#include -#include +#include "runtime/message_utils.h" +#include "common//duplication_common.h" +#include "utils/defer.h" #include "base/pegasus_key_schema.h" #include "pegasus_server_write.h" diff --git a/src/server/pegasus_server_write.h b/src/server/pegasus_server_write.h index c73fc0d50d..5ecfc84a34 100644 --- a/src/server/pegasus_server_write.h +++ b/src/server/pegasus_server_write.h @@ -19,7 +19,7 @@ #pragma once -#include +#include "replica/replica_base.h" #include "base/pegasus_rpc_types.h" #include "pegasus_write_service.h" diff --git a/src/server/pegasus_service_app.h b/src/server/pegasus_service_app.h index b53be1af33..bae6901142 100644 --- a/src/server/pegasus_service_app.h +++ b/src/server/pegasus_service_app.h @@ -19,8 +19,8 @@ #pragma once -#include -#include +#include "meta/meta_service_app.h" +#include "replica/replication_service_app.h" #include #include #include "reporter/pegasus_counter_reporter.h" diff --git a/src/server/pegasus_write_service.cpp b/src/server/pegasus_write_service.cpp index 1a13753bf4..4134b7cccd 100644 --- a/src/server/pegasus_write_service.cpp +++ b/src/server/pegasus_write_service.cpp @@ -22,9 +22,9 @@ #include "pegasus_write_service_impl.h" #include "capacity_unit_calculator.h" -#include -#include -#include +#include "runtime/message_utils.h" +#include "common/replication.codes.h" +#include "utils/defer.h" namespace pegasus { namespace server { diff --git a/src/server/pegasus_write_service.h b/src/server/pegasus_write_service.h index badbd1239d..0b2a157ece 100644 --- a/src/server/pegasus_write_service.h +++ b/src/server/pegasus_write_service.h @@ -19,11 +19,17 @@ #pragma once -#include -#include -#include -#include -#include +#include "perf_counter/perf_counter_wrapper.h" +#include "replica/replica_base.h" +#include "common/common.h" +#include "common//duplication_common.h" +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" #include "base/pegasus_value_schema.h" #include "base/pegasus_utils.h" diff --git a/src/server/pegasus_write_service_impl.h b/src/server/pegasus_write_service_impl.h index 1a8884cca5..4c668bac70 100644 --- a/src/server/pegasus_write_service_impl.h +++ b/src/server/pegasus_write_service_impl.h @@ -27,10 +27,10 @@ #include "meta_store.h" #include "rocksdb_wrapper.h" -#include -#include +#include "utils/filesystem.h" +#include "utils/string_conv.h" #include -#include +#include "utils/defer.h" namespace pegasus { namespace server { diff --git a/src/server/range_read_limiter.h b/src/server/range_read_limiter.h index 762fe1edfb..9c80147136 100644 --- a/src/server/range_read_limiter.h +++ b/src/server/range_read_limiter.h @@ -19,7 +19,7 @@ #pragma once -#include +#include "common/replication.codes.h" namespace pegasus { namespace server { diff --git a/src/server/result_writer.cpp b/src/server/result_writer.cpp index 1996b76ed7..75e407d47a 100644 --- a/src/server/result_writer.cpp +++ b/src/server/result_writer.cpp @@ -18,7 +18,7 @@ */ #include "result_writer.h" -#include +#include "utils/flags.h" namespace pegasus { namespace server { diff --git a/src/server/result_writer.h b/src/server/result_writer.h index d5f2b07f19..19814f3732 100644 --- a/src/server/result_writer.h +++ b/src/server/result_writer.h @@ -19,10 +19,10 @@ #pragma once -#include -#include -#include -#include +#include "runtime/task/task_code.h" +#include "runtime/task/task_tracker.h" +#include "runtime/task/task_queue.h" +#include "runtime/task/async_calls.h" #include namespace pegasus { diff --git a/src/server/rocksdb_wrapper.cpp b/src/server/rocksdb_wrapper.cpp index e9131e2e94..33a18cf9f7 100644 --- a/src/server/rocksdb_wrapper.cpp +++ b/src/server/rocksdb_wrapper.cpp @@ -19,7 +19,7 @@ #include "rocksdb_wrapper.h" -#include +#include "utils/fail_point.h" #include #include "pegasus_write_service_impl.h" #include "base/pegasus_value_schema.h" diff --git a/src/server/rocksdb_wrapper.h b/src/server/rocksdb_wrapper.h index 4f8abdff8e..51a46c7ff8 100644 --- a/src/server/rocksdb_wrapper.h +++ b/src/server/rocksdb_wrapper.h @@ -19,7 +19,7 @@ #pragma once -#include +#include "replica/replica_base.h" #include namespace rocksdb { diff --git a/src/server/test/capacity_unit_calculator_test.cpp b/src/server/test/capacity_unit_calculator_test.cpp index 2d1c26220b..ef94adb9f0 100644 --- a/src/server/test/capacity_unit_calculator_test.cpp +++ b/src/server/test/capacity_unit_calculator_test.cpp @@ -20,8 +20,8 @@ #include "pegasus_server_test_base.h" #include "server/capacity_unit_calculator.h" -#include -#include +#include "replica/replica_base.h" +#include "utils/token_bucket_throttling_controller.h" #include "pegasus_key_schema.h" #include "server/hotkey_collector.h" diff --git a/src/server/test/compaction_operation_test.cpp b/src/server/test/compaction_operation_test.cpp index c8ea5d3486..09fd648903 100644 --- a/src/server/test/compaction_operation_test.cpp +++ b/src/server/test/compaction_operation_test.cpp @@ -22,7 +22,7 @@ #include "server/compaction_filter_rule.h" #include "base/pegasus_value_schema.h" #include "base/pegasus_utils.h" -#include +#include "utils/smart_pointers.h" namespace pegasus { namespace server { diff --git a/src/server/test/hotkey_collector_test.cpp b/src/server/test/hotkey_collector_test.cpp index 2b40e67cf9..aa15fda080 100644 --- a/src/server/test/hotkey_collector_test.cpp +++ b/src/server/test/hotkey_collector_test.cpp @@ -17,10 +17,10 @@ #include "server/hotkey_collector.h" -#include -#include -#include -#include +#include "utils/rand.h" +#include "utils/flags.h" +#include "utils/defer.h" +#include "runtime/task/task_tracker.h" #include "server/test/message_utils.h" #include "base/pegasus_key_schema.h" #include "pegasus_server_test_base.h" diff --git a/src/server/test/hotspot_partition_test.cpp b/src/server/test/hotspot_partition_test.cpp index c746e94125..cbe7c8b8fc 100644 --- a/src/server/test/hotspot_partition_test.cpp +++ b/src/server/test/hotspot_partition_test.cpp @@ -19,7 +19,7 @@ #include "pegasus_server_test_base.h" #include -#include +#include "utils/fail_point.h" namespace pegasus { namespace server { diff --git a/src/server/test/main.cpp b/src/server/test/main.cpp index 56083e1ec8..dce80212dd 100644 --- a/src/server/test/main.cpp +++ b/src/server/test/main.cpp @@ -18,8 +18,21 @@ */ #include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "replica/replication_service_app.h" #include "server/compaction_operation.h" #include "server/pegasus_server_impl.h" diff --git a/src/server/test/manual_compact_service_test.cpp b/src/server/test/manual_compact_service_test.cpp index 210075cc30..9282897784 100644 --- a/src/server/test/manual_compact_service_test.cpp +++ b/src/server/test/manual_compact_service_test.cpp @@ -17,7 +17,7 @@ * under the License. */ -#include +#include "utils/time_utils.h" #include "pegasus_server_test_base.h" #include "server/pegasus_manual_compact_service.h" diff --git a/src/server/test/message_utils.h b/src/server/test/message_utils.h index a78aeee9bb..dfe9a0be00 100644 --- a/src/server/test/message_utils.h +++ b/src/server/test/message_utils.h @@ -22,7 +22,7 @@ #include "rrdb/rrdb_types.h" #include "rrdb/rrdb.code.definition.h" -#include +#include "runtime/message_utils.h" namespace pegasus { diff --git a/src/server/test/pegasus_mutation_duplicator_test.cpp b/src/server/test/pegasus_mutation_duplicator_test.cpp index 15239db25d..8fe9f5ad5f 100644 --- a/src/server/test/pegasus_mutation_duplicator_test.cpp +++ b/src/server/test/pegasus_mutation_duplicator_test.cpp @@ -23,8 +23,8 @@ #include "pegasus_server_test_base.h" #include -#include -#include +#include "runtime/message_utils.h" +#include "replica/replica_base.h" #include namespace pegasus { diff --git a/src/server/test/pegasus_server_test_base.h b/src/server/test/pegasus_server_test_base.h index d9ed1e32e3..54a3d2c05e 100644 --- a/src/server/test/pegasus_server_test_base.h +++ b/src/server/test/pegasus_server_test_base.h @@ -23,8 +23,8 @@ #include #include -#include -#include +#include "replica/replica_test_utils.h" +#include "utils/filesystem.h" namespace pegasus { namespace server { diff --git a/src/server/test/pegasus_server_write_test.cpp b/src/server/test/pegasus_server_write_test.cpp index 44c42a0ac8..02c49de69d 100644 --- a/src/server/test/pegasus_server_write_test.cpp +++ b/src/server/test/pegasus_server_write_test.cpp @@ -23,8 +23,8 @@ #include "server/pegasus_write_service_impl.h" #include "base/pegasus_key_schema.h" -#include -#include +#include "utils/fail_point.h" +#include "utils/defer.h" namespace pegasus { namespace server { diff --git a/src/server/test/pegasus_write_service_impl_test.cpp b/src/server/test/pegasus_write_service_impl_test.cpp index cf09db0362..ff8508d441 100644 --- a/src/server/test/pegasus_write_service_impl_test.cpp +++ b/src/server/test/pegasus_write_service_impl_test.cpp @@ -17,7 +17,7 @@ * under the License. */ -#include +#include "utils/fail_point.h" #include "pegasus_server_test_base.h" #include "server/pegasus_server_write.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 9bd3d7fce1..393fc4c0d9 100644 --- a/src/server/test/pegasus_write_service_test.cpp +++ b/src/server/test/pegasus_write_service_test.cpp @@ -17,7 +17,7 @@ * under the License. */ -#include +#include "utils/fail_point.h" #include "base/pegasus_key_schema.h" #include "pegasus_server_test_base.h" #include "server/pegasus_server_write.h" diff --git a/src/shell/args.h b/src/shell/args.h index 179662c78f..595f2fa0b3 100644 --- a/src/shell/args.h +++ b/src/shell/args.h @@ -19,8 +19,8 @@ #pragma once -#include -#include +#include "runtime/app_model.h" +#include "utils/defer.h" #include "linenoise/linenoise.h" #include "sds/sds.h" diff --git a/src/shell/command_executor.h b/src/shell/command_executor.h index 7b0aaab16d..cba3b0a5cf 100644 --- a/src/shell/command_executor.h +++ b/src/shell/command_executor.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include "client/replication_ddl_client.h" #include #include "sds/sds.h" diff --git a/src/shell/command_helper.h b/src/shell/command_helper.h index 138f5d5f57..62826f48ee 100644 --- a/src/shell/command_helper.h +++ b/src/shell/command_helper.h @@ -29,14 +29,14 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include "common/json_helper.h" +#include "remote_cmd/remote_command.h" +#include "client/replication_ddl_client.h" +#include "tools/mutation_log_tool.h" +#include "perf_counter/perf_counter_utils.h" +#include "utils/string_view.h" +#include "utils/synchronize.h" +#include "utils/time_utils.h" #include #include diff --git a/src/shell/command_output.h b/src/shell/command_output.h index 45e7e394d5..f25401397a 100644 --- a/src/shell/command_output.h +++ b/src/shell/command_output.h @@ -18,7 +18,7 @@ */ #include "shell/commands.h" -#include +#include "utils/smart_pointers.h" class command_output { diff --git a/src/shell/command_utils.h b/src/shell/command_utils.h index 92482f4d0a..3550dc6ddb 100644 --- a/src/shell/command_utils.h +++ b/src/shell/command_utils.h @@ -24,7 +24,7 @@ #include #include "shell/argh.h" -#include +#include "utils/fmt_logging.h" namespace dsn { class rpc_address; diff --git a/src/shell/commands.h b/src/shell/commands.h index 09ea489853..4685326550 100644 --- a/src/shell/commands.h +++ b/src/shell/commands.h @@ -26,12 +26,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include "utils/filesystem.h" +#include "utils/output_utils.h" +#include "utils/string_conv.h" +#include "utils/string_view.h" +#include "client/replication_ddl_client.h" +#include "tools/mutation_log_tool.h" #include #include diff --git a/src/shell/commands/detect_hotkey.cpp b/src/shell/commands/detect_hotkey.cpp index c1c2440da9..094f832338 100644 --- a/src/shell/commands/detect_hotkey.cpp +++ b/src/shell/commands/detect_hotkey.cpp @@ -17,7 +17,13 @@ #include "shell/commands.h" #include "shell/argh.h" -#include +#include "meta_admin_types.h" +#include "partition_split_types.h" +#include "duplication_types.h" +#include "bulk_load_types.h" +#include "backup_types.h" +#include "consensus_types.h" +#include "replica_admin_types.h" bool generate_hotkey_request(dsn::replication::detect_hotkey_request &req, const std::string &hotkey_action, diff --git a/src/shell/commands/duplication.cpp b/src/shell/commands/duplication.cpp index 370bb1faae..4897c27c42 100644 --- a/src/shell/commands/duplication.cpp +++ b/src/shell/commands/duplication.cpp @@ -21,10 +21,10 @@ #include "shell/argh.h" #include -#include -#include -#include -#include +#include "utils/errors.h" +#include "utils/output_utils.h" +#include "utils/string_conv.h" +#include "common//duplication_common.h" using dsn::replication::dupid_t; using dsn::replication::duplication_status; diff --git a/src/shell/commands/node_management.cpp b/src/shell/commands/node_management.cpp index b61cc91206..2f9cbd191f 100644 --- a/src/shell/commands/node_management.cpp +++ b/src/shell/commands/node_management.cpp @@ -18,7 +18,7 @@ */ #include "shell/commands.h" -#include +#include "utils/utils.h" bool query_cluster_info(command_executor *e, shell_context *sc, arguments args) { diff --git a/src/shell/commands/table_management.cpp b/src/shell/commands/table_management.cpp index 8ee8439366..85aa5b6211 100644 --- a/src/shell/commands/table_management.cpp +++ b/src/shell/commands/table_management.cpp @@ -19,7 +19,7 @@ #include "shell/commands.h" -#include +#include "utils/ports.h" double convert_to_ratio(double hit, double total) { diff --git a/src/shell/main.cpp b/src/shell/main.cpp index 0f2a3bd42e..32a67d36fd 100644 --- a/src/shell/main.cpp +++ b/src/shell/main.cpp @@ -18,7 +18,7 @@ */ #include -#include +#include "utils/strings.h" #include #include #include diff --git a/src/test/bench_test/benchmark.cpp b/src/test/bench_test/benchmark.cpp index 2d576aab44..397042a734 100644 --- a/src/test/bench_test/benchmark.cpp +++ b/src/test/bench_test/benchmark.cpp @@ -21,11 +21,11 @@ #include -#include "dsn/c/api_utilities.h" -#include "dsn/c/app_model.h" -#include "dsn/dist/fmt_logging.h" -#include "dsn/utility/ports.h" #include "rand.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/fmt_logging.h" +#include "utils/ports.h" namespace pegasus { namespace test { diff --git a/src/test/bench_test/config.cpp b/src/test/bench_test/config.cpp index 901aac3d7e..bdf0fd6b14 100644 --- a/src/test/bench_test/config.cpp +++ b/src/test/bench_test/config.cpp @@ -17,7 +17,7 @@ * under the License. */ -#include +#include "utils/config_api.h" #include "config.h" namespace pegasus { diff --git a/src/test/bench_test/config.h b/src/test/bench_test/config.h index f207b799f4..749d9a899f 100644 --- a/src/test/bench_test/config.h +++ b/src/test/bench_test/config.h @@ -21,7 +21,7 @@ #include #include -#include +#include "utils/singleton.h" namespace pegasus { namespace test { diff --git a/src/test/bench_test/main.cpp b/src/test/bench_test/main.cpp index 5b98b3f3e1..35223d0e74 100644 --- a/src/test/bench_test/main.cpp +++ b/src/test/bench_test/main.cpp @@ -19,8 +19,8 @@ #include #include -#include -#include +#include "utils/fmt_logging.h" +#include "runtime/app_model.h" #include "benchmark.h" diff --git a/src/test/bench_test/statistics.cpp b/src/test/bench_test/statistics.cpp index cc29eb25f9..010fdaa277 100644 --- a/src/test/bench_test/statistics.cpp +++ b/src/test/bench_test/statistics.cpp @@ -18,7 +18,7 @@ */ #include -#include +#include "utils/fmt_logging.h" #include "statistics.h" #include "config.h" diff --git a/src/test/function_test/backup_restore_test/main.cpp b/src/test/function_test/backup_restore_test/main.cpp index 3ecd8ac752..74e29e22a7 100644 --- a/src/test/function_test/backup_restore_test/main.cpp +++ b/src/test/function_test/backup_restore_test/main.cpp @@ -19,7 +19,7 @@ #include -#include "dsn/service_api_c.h" +#include "runtime/app_model.h" GTEST_API_ int main(int argc, char **argv) { diff --git a/src/test/function_test/backup_restore_test/test_backup_and_restore.cpp b/src/test/function_test/backup_restore_test/test_backup_and_restore.cpp index 4da286b910..39c1cc1544 100644 --- a/src/test/function_test/backup_restore_test/test_backup_and_restore.cpp +++ b/src/test/function_test/backup_restore_test/test_backup_and_restore.cpp @@ -15,9 +15,13 @@ // specific language governing permissions and limitations // under the License. -#include -#include -#include +#include "client/replication_ddl_client.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/filesystem.h" #include #include #include "include/pegasus/client.h" diff --git a/src/test/function_test/base_api_test/main.cpp b/src/test/function_test/base_api_test/main.cpp index 3ecd8ac752..74e29e22a7 100644 --- a/src/test/function_test/base_api_test/main.cpp +++ b/src/test/function_test/base_api_test/main.cpp @@ -19,7 +19,7 @@ #include -#include "dsn/service_api_c.h" +#include "runtime/app_model.h" GTEST_API_ int main(int argc, char **argv) { diff --git a/src/test/function_test/base_api_test/test_basic.cpp b/src/test/function_test/base_api_test/test_basic.cpp index 4655cfd9e4..018e3d6b60 100644 --- a/src/test/function_test/base_api_test/test_basic.cpp +++ b/src/test/function_test/base_api_test/test_basic.cpp @@ -23,7 +23,11 @@ #include #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" #include #include "include/pegasus/client.h" #include diff --git a/src/test/function_test/base_api_test/test_batch_get.cpp b/src/test/function_test/base_api_test/test_batch_get.cpp index f31adf9801..064712d904 100644 --- a/src/test/function_test/base_api_test/test_batch_get.cpp +++ b/src/test/function_test/base_api_test/test_batch_get.cpp @@ -22,8 +22,12 @@ #include "base/pegasus_const.h" #include "base/pegasus_key_schema.h" -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "client/replication_ddl_client.h" #include #include "include/pegasus/client.h" #include diff --git a/src/test/function_test/base_api_test/test_check_and_mutate.cpp b/src/test/function_test/base_api_test/test_check_and_mutate.cpp index 4f5d25938f..29878f403d 100644 --- a/src/test/function_test/base_api_test/test_check_and_mutate.cpp +++ b/src/test/function_test/base_api_test/test_check_and_mutate.cpp @@ -23,7 +23,11 @@ #include #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" #include #include "include/pegasus/client.h" #include diff --git a/src/test/function_test/base_api_test/test_check_and_set.cpp b/src/test/function_test/base_api_test/test_check_and_set.cpp index 18995dab0a..56549f32e2 100644 --- a/src/test/function_test/base_api_test/test_check_and_set.cpp +++ b/src/test/function_test/base_api_test/test_check_and_set.cpp @@ -23,7 +23,11 @@ #include #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" #include #include "include/pegasus/client.h" #include diff --git a/src/test/function_test/base_api_test/test_copy.cpp b/src/test/function_test/base_api_test/test_copy.cpp index f6494eaec4..d556512b7c 100644 --- a/src/test/function_test/base_api_test/test_copy.cpp +++ b/src/test/function_test/base_api_test/test_copy.cpp @@ -22,9 +22,13 @@ #include #include -#include -#include -#include +#include "utils/fmt_logging.h" +#include "client/replication_ddl_client.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" #include #include "include/pegasus/client.h" #include diff --git a/src/test/function_test/base_api_test/test_incr.cpp b/src/test/function_test/base_api_test/test_incr.cpp index 0aeba6422f..edafe64069 100644 --- a/src/test/function_test/base_api_test/test_incr.cpp +++ b/src/test/function_test/base_api_test/test_incr.cpp @@ -23,7 +23,11 @@ #include #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" #include #include "include/pegasus/client.h" #include diff --git a/src/test/function_test/base_api_test/test_range_read.cpp b/src/test/function_test/base_api_test/test_range_read.cpp index b4c6febd9a..fb90ae31c7 100644 --- a/src/test/function_test/base_api_test/test_range_read.cpp +++ b/src/test/function_test/base_api_test/test_range_read.cpp @@ -17,7 +17,11 @@ * under the License. */ -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" #include #include "include/pegasus/client.h" #include "include/pegasus/error.h" diff --git a/src/test/function_test/base_api_test/test_recall.cpp b/src/test/function_test/base_api_test/test_recall.cpp index 37f4ed31fc..f5db3a6037 100644 --- a/src/test/function_test/base_api_test/test_recall.cpp +++ b/src/test/function_test/base_api_test/test_recall.cpp @@ -24,12 +24,16 @@ #include #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" #include #include "include/pegasus/client.h" #include -#include +#include "client/replication_ddl_client.h" #include "base/pegasus_const.h" #include "test/function_test/utils/utils.h" diff --git a/src/test/function_test/base_api_test/test_scan.cpp b/src/test/function_test/base_api_test/test_scan.cpp index 111bcd1d6b..37d44613fd 100644 --- a/src/test/function_test/base_api_test/test_scan.cpp +++ b/src/test/function_test/base_api_test/test_scan.cpp @@ -23,8 +23,12 @@ #include #include -#include -#include +#include "client/replication_ddl_client.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" #include #include "include/pegasus/client.h" #include diff --git a/src/test/function_test/base_api_test/test_ttl.cpp b/src/test/function_test/base_api_test/test_ttl.cpp index afb148410e..590b376252 100644 --- a/src/test/function_test/base_api_test/test_ttl.cpp +++ b/src/test/function_test/base_api_test/test_ttl.cpp @@ -19,7 +19,7 @@ #include -#include +#include "client/replication_ddl_client.h" #include "include/pegasus/client.h" #include diff --git a/src/test/function_test/bulk_load_test/main.cpp b/src/test/function_test/bulk_load_test/main.cpp index 3ecd8ac752..74e29e22a7 100644 --- a/src/test/function_test/bulk_load_test/main.cpp +++ b/src/test/function_test/bulk_load_test/main.cpp @@ -19,7 +19,7 @@ #include -#include "dsn/service_api_c.h" +#include "runtime/app_model.h" GTEST_API_ int main(int argc, char **argv) { diff --git a/src/test/function_test/bulk_load_test/test_bulk_load.cpp b/src/test/function_test/bulk_load_test/test_bulk_load.cpp index f09f12fdb0..20b5c49297 100644 --- a/src/test/function_test/bulk_load_test/test_bulk_load.cpp +++ b/src/test/function_test/bulk_load_test/test_bulk_load.cpp @@ -17,9 +17,13 @@ #include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "client/replication_ddl_client.h" +#include "utils/filesystem.h" #include "include/pegasus/client.h" #include "include/pegasus/error.h" diff --git a/src/test/function_test/detect_hotspot_test/main.cpp b/src/test/function_test/detect_hotspot_test/main.cpp index 3ecd8ac752..74e29e22a7 100644 --- a/src/test/function_test/detect_hotspot_test/main.cpp +++ b/src/test/function_test/detect_hotspot_test/main.cpp @@ -19,7 +19,7 @@ #include -#include "dsn/service_api_c.h" +#include "runtime/app_model.h" GTEST_API_ int main(int argc, char **argv) { diff --git a/src/test/function_test/detect_hotspot_test/test_detect_hotspot.cpp b/src/test/function_test/detect_hotspot_test/test_detect_hotspot.cpp index b1c56e8a65..3660adba74 100644 --- a/src/test/function_test/detect_hotspot_test/test_detect_hotspot.cpp +++ b/src/test/function_test/detect_hotspot_test/test_detect_hotspot.cpp @@ -19,9 +19,13 @@ #include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "client/replication_ddl_client.h" +#include "utils/filesystem.h" #include "include/pegasus/client.h" #include "include/pegasus/error.h" diff --git a/src/test/function_test/partition_split_test/main.cpp b/src/test/function_test/partition_split_test/main.cpp index 3ecd8ac752..74e29e22a7 100644 --- a/src/test/function_test/partition_split_test/main.cpp +++ b/src/test/function_test/partition_split_test/main.cpp @@ -19,7 +19,7 @@ #include -#include "dsn/service_api_c.h" +#include "runtime/app_model.h" GTEST_API_ int main(int argc, char **argv) { diff --git a/src/test/function_test/partition_split_test/test_split.cpp b/src/test/function_test/partition_split_test/test_split.cpp index 7456b81300..fa04ec6823 100644 --- a/src/test/function_test/partition_split_test/test_split.cpp +++ b/src/test/function_test/partition_split_test/test_split.cpp @@ -19,7 +19,7 @@ #include "include/pegasus/client.h" #include -#include +#include "client/replication_ddl_client.h" #include "base/pegasus_const.h" #include "test/function_test/utils/test_util.h" diff --git a/src/test/function_test/recovery_test/main.cpp b/src/test/function_test/recovery_test/main.cpp index 3ecd8ac752..74e29e22a7 100644 --- a/src/test/function_test/recovery_test/main.cpp +++ b/src/test/function_test/recovery_test/main.cpp @@ -19,7 +19,7 @@ #include -#include "dsn/service_api_c.h" +#include "runtime/app_model.h" GTEST_API_ int main(int argc, char **argv) { diff --git a/src/test/function_test/recovery_test/test_recovery.cpp b/src/test/function_test/recovery_test/test_recovery.cpp index 5cad0510ad..d8e6b56f4c 100644 --- a/src/test/function_test/recovery_test/test_recovery.cpp +++ b/src/test/function_test/recovery_test/test_recovery.cpp @@ -27,9 +27,13 @@ #include #include -#include -#include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "client/replication_ddl_client.h" +#include "utils/rand.h" #include "include/pegasus/client.h" diff --git a/src/test/function_test/restore_test/main.cpp b/src/test/function_test/restore_test/main.cpp index a847c57ae1..92a372ba33 100644 --- a/src/test/function_test/restore_test/main.cpp +++ b/src/test/function_test/restore_test/main.cpp @@ -19,7 +19,7 @@ #include -#include "dsn/service_api_c.h" +#include "runtime/app_model.h" GTEST_API_ int main(int argc, char **argv) { diff --git a/src/test/function_test/restore_test/test_restore.cpp b/src/test/function_test/restore_test/test_restore.cpp index 19a1605790..bb86b9dd0a 100644 --- a/src/test/function_test/restore_test/test_restore.cpp +++ b/src/test/function_test/restore_test/test_restore.cpp @@ -19,9 +19,9 @@ #include -#include -#include -#include +#include "utils/filesystem.h" +#include "utils/fmt_logging.h" +#include "client/replication_ddl_client.h" #include "include/pegasus/client.h" #include #include diff --git a/src/test/function_test/throttle_test/main.cpp b/src/test/function_test/throttle_test/main.cpp index 3ecd8ac752..74e29e22a7 100644 --- a/src/test/function_test/throttle_test/main.cpp +++ b/src/test/function_test/throttle_test/main.cpp @@ -19,7 +19,7 @@ #include -#include "dsn/service_api_c.h" +#include "runtime/app_model.h" GTEST_API_ int main(int argc, char **argv) { diff --git a/src/test/function_test/throttle_test/test_throttle.cpp b/src/test/function_test/throttle_test/test_throttle.cpp index 1b1780716a..a08721ce46 100644 --- a/src/test/function_test/throttle_test/test_throttle.cpp +++ b/src/test/function_test/throttle_test/test_throttle.cpp @@ -19,13 +19,26 @@ #include -#include -#include +#include "utils/filesystem.h" +#include "client/replication_ddl_client.h" #include "include/pegasus/client.h" #include -#include -#include -#include +#include "utils/TokenBucket.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "utils/fmt_logging.h" #include #include "base/pegasus_const.h" diff --git a/src/test/function_test/utils/global_env.cpp b/src/test/function_test/utils/global_env.cpp index 787ac7eaa9..6d8d6a5476 100644 --- a/src/test/function_test/utils/global_env.cpp +++ b/src/test/function_test/utils/global_env.cpp @@ -28,10 +28,10 @@ #include -#include "dsn/dist/fmt_logging.h" -#include "dsn/utility/utils.h" -#include "dsn/tool-api/rpc_address.h" -#include "dsn/c/api_layer1.h" +#include "utils/fmt_logging.h" +#include "utils/utils.h" +#include "utils/rpc_address.h" +#include "runtime/api_layer1.h" #include "test/function_test/utils/utils.h" global_env::global_env() diff --git a/src/test/function_test/utils/global_env.h b/src/test/function_test/utils/global_env.h index be54a458f4..67f310a0ff 100644 --- a/src/test/function_test/utils/global_env.h +++ b/src/test/function_test/utils/global_env.h @@ -22,7 +22,7 @@ #include #include -#include "dsn/utility/singleton.h" +#include "utils/singleton.h" class global_env : public dsn::utils::singleton { diff --git a/src/test/function_test/utils/test_util.cpp b/src/test/function_test/utils/test_util.cpp index e4403a631b..d8d8af9dba 100644 --- a/src/test/function_test/utils/test_util.cpp +++ b/src/test/function_test/utils/test_util.cpp @@ -22,9 +22,9 @@ #include #include "base/pegasus_const.h" -#include "dsn/dist/replication/replication_ddl_client.h" -#include "dsn/dist/replication/replication_other_types.h" -#include "dsn/tool-api/rpc_address.h" +#include "client/replication_ddl_client.h" +#include "common/replication_other_types.h" +#include "utils/rpc_address.h" #include "include/pegasus/client.h" #include "test/function_test/utils/global_env.h" #include "test/function_test/utils/utils.h" diff --git a/src/test/function_test/utils/utils.h b/src/test/function_test/utils/utils.h index 6712a67af5..6eba86f5b6 100644 --- a/src/test/function_test/utils/utils.h +++ b/src/test/function_test/utils/utils.h @@ -19,10 +19,10 @@ #pragma once -#include -#include -#include -#include +#include "utils/api_utilities.h" +#include "utils/fmt_logging.h" +#include "utils/rand.h" +#include "utils/strings.h" #define RETRY_OPERATION(CLIENT_FUNCTION, RESULT) \ do { \ diff --git a/src/test/kill_test/data_verifier.cpp b/src/test/kill_test/data_verifier.cpp index 75b631ef0e..ae29d58121 100644 --- a/src/test/kill_test/data_verifier.cpp +++ b/src/test/kill_test/data_verifier.cpp @@ -29,7 +29,20 @@ #include #include -#include +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" #include "pegasus/client.h" #include "data_verifier.h" diff --git a/src/test/kill_test/kill_testor.cpp b/src/test/kill_test/kill_testor.cpp index 6db8066e53..4198c4f5aa 100644 --- a/src/test/kill_test/kill_testor.cpp +++ b/src/test/kill_test/kill_testor.cpp @@ -19,9 +19,22 @@ #include -#include -#include -#include +#include "utils/api_utilities.h" +#include "common/api_common.h" +#include "runtime/api_task.h" +#include "runtime/api_layer1.h" +#include "runtime/app_model.h" +#include "utils/api_utilities.h" +#include "utils/error_code.h" +#include "utils/threadpool_code.h" +#include "runtime/task/task_code.h" +#include "common/gpid.h" +#include "runtime/rpc/serialization.h" +#include "runtime/rpc/rpc_stream.h" +#include "runtime/serverlet.h" +#include "runtime/service_app.h" +#include "utils/rpc_address.h" +#include "client/replication_ddl_client.h" #include #include "base/pegasus_const.h" diff --git a/src/test/kill_test/kill_testor.h b/src/test/kill_test/kill_testor.h index 516e08bc9c..533a45b41d 100644 --- a/src/test/kill_test/kill_testor.h +++ b/src/test/kill_test/kill_testor.h @@ -25,7 +25,7 @@ #include #include -#include +#include "client/replication_ddl_client.h" namespace pegasus { namespace test { diff --git a/src/test/kill_test/killer_handler.h b/src/test/kill_test/killer_handler.h index 42b824932b..4662663fd9 100644 --- a/src/test/kill_test/killer_handler.h +++ b/src/test/kill_test/killer_handler.h @@ -22,7 +22,7 @@ #include #include -#include +#include "utils/factory_store.h" namespace pegasus { namespace test { diff --git a/src/test/kill_test/killer_handler_shell.cpp b/src/test/kill_test/killer_handler_shell.cpp index 662eb069ee..959e9f3ae1 100644 --- a/src/test/kill_test/killer_handler_shell.cpp +++ b/src/test/kill_test/killer_handler_shell.cpp @@ -25,9 +25,9 @@ #include #include -#include "dsn/c/api_utilities.h" -#include "dsn/dist/fmt_logging.h" -#include "dsn/utility/config_api.h" +#include "utils/api_utilities.h" +#include "utils/config_api.h" +#include "utils/fmt_logging.h" namespace pegasus { namespace test { diff --git a/src/test/kill_test/partition_kill_testor.cpp b/src/test/kill_test/partition_kill_testor.cpp index c88bfae0c0..b81120a4aa 100644 --- a/src/test/kill_test/partition_kill_testor.cpp +++ b/src/test/kill_test/partition_kill_testor.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include "remote_cmd/remote_command.h" #include "partition_kill_testor.h" diff --git a/src/test/kill_test/partition_kill_testor.h b/src/test/kill_test/partition_kill_testor.h index 9fd578c70a..599a7a92ce 100644 --- a/src/test/kill_test/partition_kill_testor.h +++ b/src/test/kill_test/partition_kill_testor.h @@ -17,7 +17,7 @@ * under the License. */ -#include +#include "client/replication_ddl_client.h" #include #include "kill_testor.h" diff --git a/src/test/kill_test/process_kill_testor.cpp b/src/test/kill_test/process_kill_testor.cpp index a09ea61a9d..fc4bee09b0 100644 --- a/src/test/kill_test/process_kill_testor.cpp +++ b/src/test/kill_test/process_kill_testor.cpp @@ -29,8 +29,8 @@ #include #include -#include "dsn/dist/fmt_logging.h" -#include "dsn/dist/replication/replication_ddl_client.h" +#include "utils/fmt_logging.h" +#include "client/replication_ddl_client.h" #include diff --git a/src/test/pressure_test/main.cpp b/src/test/pressure_test/main.cpp index cb71020e52..58490df600 100644 --- a/src/test/pressure_test/main.cpp +++ b/src/test/pressure_test/main.cpp @@ -22,10 +22,10 @@ #include #include -#include -#include -#include -#include +#include "utils/api_utilities.h" +#include "runtime/api_layer1.h" +#include "utils/rand.h" +#include "runtime/task/async_calls.h" #include "pegasus/client.h"