From 2554a1a997e544ae617ac91d56c5046f8ff872fc Mon Sep 17 00:00:00 2001 From: mehrdadn Date: Sun, 19 Jul 2020 12:53:08 -0700 Subject: [PATCH] Bazel fixes (#9519) --- BUILD.bazel | 115 +++++++++--------- bazel/BUILD.msgpack | 51 ++------ bazel/BUILD.redis | 3 +- java/BUILD.bazel | 19 ++- python/ray/includes/common.pxd | 8 +- python/ray/includes/function_descriptor.pxd | 2 +- python/ray/includes/serialization.pxi | 2 +- src/ray/common/bundle_spec.cc | 3 +- src/ray/common/client_connection.cc | 2 +- src/ray/common/common_protocol.cc | 2 +- src/ray/common/function_descriptor.h | 4 +- src/ray/common/grpc_util.h | 2 +- src/ray/common/id.h | 6 +- src/ray/common/network_util.cc | 2 +- src/ray/common/network_util.h | 2 +- src/ray/common/placement_group.h | 4 +- src/ray/common/ray_config.h | 4 +- src/ray/common/ray_object.h | 2 +- src/ray/common/task/scheduling_resources.cc | 2 +- .../common/task/scheduling_resources_test.cc | 3 +- src/ray/common/task/task.cc | 4 +- src/ray/common/task/task_common.h | 2 +- src/ray/common/task/task_util.h | 2 +- src/ray/common/test_util.cc | 2 +- src/ray/common/test_util.h | 5 +- src/ray/core_worker/actor_handle.h | 4 +- src/ray/core_worker/common.h | 2 +- src/ray/core_worker/fiber.h | 3 +- src/ray/core_worker/future_resolver.h | 2 +- .../java/io_ray_runtime_RayNativeRuntime.cc | 4 +- .../io_ray_runtime_actor_NativeActorHandle.cc | 4 +- ...ray_runtime_context_NativeWorkerContext.cc | 4 +- .../io_ray_runtime_gcs_GlobalStateAccessor.cc | 4 +- ...io_ray_runtime_object_NativeObjectStore.cc | 4 +- .../io_ray_runtime_task_NativeTaskExecutor.cc | 4 +- ...io_ray_runtime_task_NativeTaskSubmitter.cc | 4 +- src/ray/core_worker/lib/java/jni_init.cc | 2 +- src/ray/core_worker/object_recovery_manager.h | 6 +- src/ray/core_worker/reference_count.h | 6 +- .../store_provider/plasma_store_provider.cc | 2 +- src/ray/core_worker/task_manager.h | 4 +- src/ray/core_worker/test/core_worker_test.cc | 4 +- .../transport/direct_actor_transport.h | 16 ++- .../transport/direct_task_transport.h | 2 +- src/ray/gcs/accessor.h | 4 +- src/ray/gcs/asio.cc | 2 +- src/ray/gcs/entry_change_notification.h | 3 +- .../gcs/gcs_client/global_state_accessor.cc | 2 +- .../gcs/gcs_client/global_state_accessor.h | 2 +- .../gcs/gcs_client/service_based_accessor.h | 3 +- .../gcs/gcs_server/error_info_handler_impl.cc | 2 +- src/ray/gcs/gcs_server/gcs_actor_manager.cc | 6 +- src/ray/gcs/gcs_server/gcs_actor_manager.h | 14 +-- src/ray/gcs/gcs_server/gcs_actor_scheduler.cc | 11 +- src/ray/gcs/gcs_server/gcs_actor_scheduler.h | 20 +-- src/ray/gcs/gcs_server/gcs_job_manager.cc | 2 +- src/ray/gcs/gcs_server/gcs_job_manager.h | 4 +- src/ray/gcs/gcs_server/gcs_node_manager.cc | 8 +- src/ray/gcs/gcs_server/gcs_node_manager.h | 13 +- src/ray/gcs/gcs_server/gcs_object_manager.cc | 3 +- src/ray/gcs/gcs_server/gcs_object_manager.h | 4 +- .../gcs_server/gcs_placement_group_manager.cc | 7 +- .../gcs_server/gcs_placement_group_manager.h | 14 +-- .../gcs_placement_group_scheduler.cc | 3 +- .../gcs_placement_group_scheduler.h | 17 +-- .../gcs_server/gcs_redis_failure_detector.cc | 3 +- src/ray/gcs/gcs_server/gcs_server.cc | 20 +-- src/ray/gcs/gcs_server/gcs_server.h | 8 +- src/ray/gcs/gcs_server/gcs_table_storage.cc | 2 +- src/ray/gcs/gcs_server/gcs_table_storage.h | 2 +- src/ray/gcs/gcs_server/gcs_worker_manager.cc | 2 +- src/ray/gcs/gcs_server/gcs_worker_manager.h | 2 +- src/ray/gcs/gcs_server/stats_handler_impl.cc | 2 +- src/ray/gcs/gcs_server/stats_handler_impl.h | 2 +- .../gcs/gcs_server/task_info_handler_impl.cc | 2 +- .../gcs/gcs_server/task_info_handler_impl.h | 2 +- .../gcs_server/test/gcs_actor_manager_test.cc | 5 +- .../test/gcs_actor_scheduler_test.cc | 6 +- .../gcs_server/test/gcs_node_manager_test.cc | 6 +- .../test/gcs_object_manager_test.cc | 5 +- .../test/gcs_placement_group_manager_test.cc | 5 +- .../gcs_placement_group_scheduler_test.cc | 6 +- src/ray/gcs/pb_util.h | 2 +- src/ray/gcs/pubsub/gcs_pub_sub.cc | 2 +- src/ray/gcs/pubsub/gcs_pub_sub.h | 3 +- src/ray/gcs/redis_accessor.h | 3 +- src/ray/gcs/redis_context.h | 5 +- src/ray/gcs/redis_module/chain_module.h | 2 +- src/ray/gcs/redis_module/ray_redis_module.cc | 9 +- src/ray/gcs/redis_module/redis_string.h | 2 +- .../gcs/store_client/in_memory_store_client.h | 2 +- src/ray/gcs/store_client/redis_store_client.h | 2 +- src/ray/gcs/store_client/store_client.h | 3 +- src/ray/gcs/tables.h | 2 +- src/ray/gcs/test/gcs_test_util.h | 4 +- src/ray/raylet/actor_registration.h | 2 +- src/ray/raylet/lineage_cache.cc | 4 +- src/ray/raylet/raylet.cc | 2 +- src/ray/raylet/reconstruction_policy.cc | 2 +- .../scheduling/cluster_resource_scheduler.cc | 2 +- .../raylet/scheduling/cluster_task_manager.cc | 2 +- src/ray/raylet/scheduling/fixed_point.cc | 2 +- src/ray/raylet/scheduling/scheduling_ids.cc | 2 +- src/ray/raylet/scheduling_policy.cc | 4 +- src/ray/raylet/scheduling_queue.cc | 2 +- src/ray/raylet/task_dependency_manager.cc | 2 +- src/ray/raylet/worker.cc | 6 +- src/ray/raylet_client/raylet_client.cc | 2 +- src/ray/raylet_client/raylet_client.h | 3 +- src/ray/rpc/gcs_server/gcs_rpc_client.h | 2 +- src/ray/rpc/gcs_server/gcs_rpc_server.h | 2 +- src/ray/rpc/grpc_server.h | 2 +- src/ray/rpc/metrics_agent_client.h | 10 +- .../rpc/node_manager/node_manager_client.h | 16 +-- .../rpc/node_manager/node_manager_server.h | 4 +- .../object_manager/object_manager_client.h | 9 +- .../object_manager/object_manager_server.h | 4 +- src/ray/rpc/worker/core_worker_client.h | 27 ++-- src/ray/rpc/worker/core_worker_server.h | 5 +- src/ray/stats/metric.h | 9 +- src/ray/stats/stats.h | 5 +- src/ray/thirdparty/sha256.c | 2 +- src/ray/util/filesystem.h | 10 +- src/ray/util/util.h | 2 +- streaming/BUILD.bazel | 60 ++------- streaming/src/channel.cc | 1 + streaming/src/config/streaming_config.cc | 3 +- streaming/src/data_reader.cc | 6 +- streaming/src/data_writer.cc | 7 +- streaming/src/event_service.cc | 7 +- ...ay_streaming_runtime_transfer_ChannelId.cc | 2 + ...y_streaming_runtime_transfer_DataReader.cc | 1 + ...y_streaming_runtime_transfer_DataWriter.cc | 1 + ...eaming_runtime_transfer_TransferHandler.cc | 1 + streaming/src/message/message.cc | 4 +- streaming/src/message/message_bundle.cc | 6 +- streaming/src/message/message_bundle.h | 4 +- streaming/src/protobuf/remote_call.proto | 2 +- streaming/src/queue/message.cc | 2 +- streaming/src/queue/queue.cc | 6 +- streaming/src/queue/queue.h | 7 +- streaming/src/queue/queue_client.cc | 2 +- streaming/src/queue/queue_client.h | 4 +- streaming/src/queue/queue_handler.cc | 5 +- streaming/src/queue/queue_handler.h | 2 +- streaming/src/queue/queue_item.h | 5 +- streaming/src/queue/transport.cc | 5 +- streaming/src/ring_buffer.cc | 1 + streaming/src/runtime_context.cc | 8 +- streaming/src/test/queue_tests_base.h | 2 + streaming/src/test/ring_buffer_tests.cc | 4 +- streaming/src/test/streaming_queue_tests.cc | 2 +- streaming/src/util/streaming_logging.cc | 2 +- streaming/src/util/streaming_util.cc | 4 +- 154 files changed, 433 insertions(+), 478 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 1449e2478..b9b11693f 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,7 +1,6 @@ # Bazel build # C/C++ documentation: https://docs.bazel.build/versions/master/be/c-cpp.html -load("@bazel_skylib//rules:copy_file.bzl", "copy_file") load("@rules_proto//proto:defs.bzl", "proto_library") load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_proto_library", "cc_test") load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") @@ -151,6 +150,7 @@ cc_library( "src/ray/rpc/*.h", ]), copts = COPTS, + strip_include_prefix = "src", deps = [ ":ray_common", "@boost//:asio", @@ -174,6 +174,7 @@ cc_library( "src/ray/rpc/node_manager/*.h", ]), copts = COPTS, + strip_include_prefix = "src", deps = [ ":grpc_common_lib", ":node_manager_cc_grpc", @@ -199,6 +200,7 @@ cc_library( "src/ray/rpc/gcs_server/gcs_rpc_client.h", ]), copts = COPTS, + strip_include_prefix = "src", deps = [ ":gcs_service_cc_grpc", ":grpc_common_lib", @@ -223,6 +225,7 @@ cc_library( "src/ray/rpc/object_manager/*.h", ]), copts = COPTS, + strip_include_prefix = "src", deps = [ ":grpc_common_lib", ":object_manager_cc_grpc", @@ -247,6 +250,7 @@ cc_library( "src/ray/rpc/worker/*.h", ]), copts = COPTS, + strip_include_prefix = "src", deps = [ ":grpc_common_lib", ":ray_common", @@ -272,6 +276,7 @@ cc_library( "src/ray/rpc/metrics_agent_client.h", ]), copts = COPTS, + strip_include_prefix = "src", deps = [ ":grpc_common_lib", ":ray_common", @@ -349,22 +354,6 @@ cc_library( ], ) -copy_file( - name = "copy_jni_h", - src = "@bazel_tools//tools/jdk:jni_header", - out = "jni.h", -) - -copy_file( - name = "copy_jni_md_h", - src = select({ - "@bazel_tools//src/conditions:windows": "@bazel_tools//tools/jdk:jni_md_header-windows", - "@bazel_tools//src/conditions:darwin": "@bazel_tools//tools/jdk:jni_md_header-darwin", - "//conditions:default": "@bazel_tools//tools/jdk:jni_md_header-linux", - }), - out = "jni_md.h", -) - cc_library( name = "ae", srcs = [ @@ -440,7 +429,6 @@ flatbuffer_cc_library( name = "plasma_fbs", srcs = ["src/ray/object_manager/plasma/plasma.fbs"], flatc_args = FLATC_ARGS, - includes = ["src/ray/object_manager/format/object_manager.fbs"], out_prefix = "src/ray/object_manager/plasma/", ) @@ -462,9 +450,7 @@ cc_library( ], ), copts = COPTS, - includes = [ - "@boost//:asio", - ], + strip_include_prefix = "src", visibility = ["//visibility:public"], deps = [ ":common_cc_proto", @@ -507,6 +493,7 @@ cc_library( ], ), copts = COPTS, + strip_include_prefix = "src", deps = [ ":gcs", ":ray_common", @@ -551,6 +538,7 @@ cc_library( ], ), copts = COPTS, + strip_include_prefix = "src", deps = [ ":gcs", ":gcs_pub_sub_lib", @@ -591,9 +579,6 @@ cc_library( ], ), copts = COPTS, - includes = [ - "src", - ], linkopts = select({ "@bazel_tools//src/conditions:windows": [ ], @@ -601,6 +586,7 @@ cc_library( "-lpthread", ], }), + strip_include_prefix = "src", deps = [ ":ray_util", ":reporter_rpc", @@ -641,6 +627,7 @@ cc_library( "-lpthread", ], }), + strip_include_prefix = "src", visibility = ["//streaming:__subpackages__"], deps = [ ":common_cc_proto", @@ -683,6 +670,7 @@ cc_library( "-lpthread", ], }), + strip_include_prefix = "src", visibility = ["//streaming:__subpackages__"], deps = [ ":gcs_cc_proto", @@ -716,6 +704,7 @@ cc_library( "src/ray/core_worker/transport/*.h", ]), copts = COPTS, + strip_include_prefix = "src", visibility = ["//visibility:public"], deps = [ ":gcs", @@ -739,6 +728,7 @@ cc_library( "src/ray/core_worker/test/*.h", ]), copts = COPTS, + strip_include_prefix = "src", deps = [ ":core_worker_lib", ], @@ -1035,6 +1025,7 @@ cc_library( "src/ray/gcs/test/gcs_test_util.h", ], copts = COPTS, + strip_include_prefix = "src", deps = [ ":gcs", ":gcs_service_rpc", @@ -1064,15 +1055,24 @@ cc_test( ], ) +cc_library( + name = "gcs_server_test_util", + hdrs = [ + "src/ray/gcs/gcs_server/test/gcs_server_test_util.h", + ], + copts = COPTS, + strip_include_prefix = "src", +) + cc_test( name = "gcs_node_manager_test", srcs = [ "src/ray/gcs/gcs_server/test/gcs_node_manager_test.cc", - "src/ray/gcs/gcs_server/test/gcs_server_test_util.h", ], copts = COPTS, deps = [ ":gcs_server_lib", + ":gcs_server_test_util", ":gcs_test_util_lib", "@com_google_googletest//:gtest_main", ], @@ -1082,11 +1082,11 @@ cc_test( name = "gcs_placement_group_manager_test", srcs = [ "src/ray/gcs/gcs_server/test/gcs_placement_group_manager_test.cc", - "src/ray/gcs/gcs_server/test/gcs_server_test_util.h", ], copts = COPTS, deps = [ ":gcs_server_lib", + ":gcs_server_test_util", ":gcs_test_util_lib", "@com_google_googletest//:gtest_main", ], @@ -1096,11 +1096,11 @@ cc_test( name = "gcs_placement_group_scheduler_test", srcs = [ "src/ray/gcs/gcs_server/test/gcs_placement_group_scheduler_test.cc", - "src/ray/gcs/gcs_server/test/gcs_server_test_util.h", ], copts = COPTS, deps = [ ":gcs_server_lib", + ":gcs_server_test_util", ":gcs_test_util_lib", "@com_google_googletest//:gtest_main", ], @@ -1110,11 +1110,11 @@ cc_test( name = "gcs_actor_scheduler_test", srcs = [ "src/ray/gcs/gcs_server/test/gcs_actor_scheduler_test.cc", - "src/ray/gcs/gcs_server/test/gcs_server_test_util.h", ], copts = COPTS, deps = [ ":gcs_server_lib", + ":gcs_server_test_util", ":gcs_test_util_lib", "@com_google_googletest//:gtest_main", ], @@ -1124,11 +1124,11 @@ cc_test( name = "gcs_actor_manager_test", srcs = [ "src/ray/gcs/gcs_server/test/gcs_actor_manager_test.cc", - "src/ray/gcs/gcs_server/test/gcs_server_test_util.h", ], copts = COPTS, deps = [ ":gcs_server_lib", + ":gcs_server_test_util", ":gcs_test_util_lib", "@com_google_googletest//:gtest_main", ], @@ -1147,6 +1147,7 @@ cc_library( ], ), copts = COPTS, + strip_include_prefix = "src", deps = [ ":gcs", ":gcs_in_memory_store_client", @@ -1161,6 +1162,7 @@ cc_library( "src/ray/gcs/gcs_server/test/gcs_table_storage_test_base.h", ], copts = COPTS, + strip_include_prefix = "src", deps = [ "redis_store_client", ], @@ -1219,6 +1221,7 @@ cc_library( ], ), copts = COPTS, + strip_include_prefix = "src", deps = [ ":gcs", ":gcs_pub_sub_lib", @@ -1240,6 +1243,7 @@ cc_library( ], ), copts = COPTS, + strip_include_prefix = "src", deps = [ ":service_based_gcs_client_lib", ], @@ -1298,11 +1302,11 @@ cc_test( name = "gcs_object_manager_test", srcs = [ "src/ray/gcs/gcs_server/test/gcs_object_manager_test.cc", - "src/ray/gcs/gcs_server/test/gcs_server_test_util.h", ], copts = COPTS, deps = [ ":gcs_server_lib", + ":gcs_server_test_util", ":gcs_test_util_lib", "@com_google_googletest//:gtest_main", ], @@ -1319,9 +1323,7 @@ cc_library( "src/ray/object_manager/notification/*.h", ]), copts = COPTS, - includes = [ - "src", - ], + strip_include_prefix = "src", deps = [ ":gcs", ":object_manager_fbs", @@ -1393,9 +1395,7 @@ cc_library( "src/ray/util/*.h", ]), copts = COPTS, - includes = [ - "src", - ], + strip_include_prefix = "src", visibility = ["//visibility:public"], deps = [ ":sha256", @@ -1447,7 +1447,7 @@ cc_library( "src/ray/thirdparty/sha256.h", ], copts = COPTS, - includes = ["src/ray/thirdparty"], + strip_include_prefix = "src", ) alias( @@ -1470,6 +1470,7 @@ cc_library( "src/ray/gcs/redis_context.h", ], copts = COPTS, + strip_include_prefix = "src", deps = [ ":hiredis", ":ray_common", @@ -1490,6 +1491,7 @@ cc_library( "src/ray/gcs/store_client/store_client.h", ], copts = COPTS, + strip_include_prefix = "src", deps = [ "redis_client", ], @@ -1506,6 +1508,7 @@ cc_library( "src/ray/gcs/store_client/store_client.h", ], copts = COPTS, + strip_include_prefix = "src", deps = [ ":ray_common", ":ray_util", @@ -1518,6 +1521,7 @@ cc_library( "src/ray/gcs/store_client/test/store_client_test_base.h", ], copts = COPTS, + strip_include_prefix = "src", deps = [ "redis_store_client", ], @@ -1569,6 +1573,7 @@ cc_library( "src/ray/gcs/*.h", ]), copts = COPTS, + strip_include_prefix = "src", deps = [ ":gcs_cc_proto", ":hiredis", @@ -1732,7 +1737,7 @@ flatbuffer_cc_library( name = "node_manager_fbs", srcs = ["src/ray/raylet/format/node_manager.fbs"], flatc_args = FLATC_ARGS, - out_prefix = "src/ray/raylet/format/", + out_prefix = "ray/raylet/format/", ) flatbuffer_cc_library( @@ -1808,25 +1813,8 @@ cc_binary( srcs = glob([ "src/ray/core_worker/lib/java/*.h", "src/ray/core_worker/lib/java/*.cc", - ]) + [ - "@bazel_tools//tools/jdk:jni_header", - ] + select({ - "@bazel_tools//src/conditions:windows": ["@bazel_tools//tools/jdk:jni_md_header-windows"], - "@bazel_tools//src/conditions:darwin": ["@bazel_tools//tools/jdk:jni_md_header-darwin"], - "//conditions:default": ["@bazel_tools//tools/jdk:jni_md_header-linux"], - }) + [ - ":jni.h", - ":jni_md.h", - ], + ]), copts = COPTS, - includes = [ - "src", - "external/bazel_tools/tools/jdk/include", - ] + select({ - "@bazel_tools//src/conditions:windows": ["external/bazel_tools/tools/jdk/include/windows"], - "@bazel_tools//src/conditions:darwin": ["external/bazel_tools/tools/jdk/include/darwin"], - "//conditions:default": ["external/bazel_tools/tools/jdk/include/linux"], - }), # Export ray ABI symbols, which can then be used by libstreaming_java.so. see `//:_raylet` linkopts = select({ "@bazel_tools//src/conditions:darwin": [ @@ -1845,7 +1833,7 @@ cc_binary( "//:global_state_accessor_lib", "//:src/ray/ray_exported_symbols.lds", "//:src/ray/ray_version_script.lds", - "//streaming:jni", + "@bazel_tools//tools/jdk:jni", ], ) @@ -1912,12 +1900,20 @@ alias( visibility = ["//visibility:public"], ) +cc_library( + name = "ray_redis_module", + hdrs = [ + "src/ray/gcs/redis_module/redis_string.h", + "src/ray/gcs/redis_module/redismodule.h", + ], + copts = COPTS, + strip_include_prefix = "src", +) + cc_binary( name = "libray_redis_module.so", srcs = [ "src/ray/gcs/redis_module/ray_redis_module.cc", - "src/ray/gcs/redis_module/redis_string.h", - "src/ray/gcs/redis_module/redismodule.h", ], copts = COPTS, linkshared = 1, @@ -1926,6 +1922,7 @@ cc_binary( deps = [ ":gcs_cc_proto", ":ray_common", + ":ray_redis_module", ], ) diff --git a/bazel/BUILD.msgpack b/bazel/BUILD.msgpack index 52800d952..b85d4d166 100644 --- a/bazel/BUILD.msgpack +++ b/bazel/BUILD.msgpack @@ -1,33 +1,16 @@ -filegroup( - name = "c_headers", - srcs = glob([ - "include/*.h", +# This library is for internal use, because the library assumes a +# different include prefix for itself than external libraries do. +cc_library( + name = "_msgpack", + hdrs = glob([ "include/**/*.h", - "include/**/**/*.h", - "include/**/**/**/*.h", - ], - exclude = [ - "include/msgpack.h", - ], - ), -) - -filegroup( - name = "cxx_headers", - srcs = glob([ - "include/*.hpp", "include/**/*.hpp", - "include/**/**/*.hpp", - "include/**/**/**/*.hpp", - ], - exclude = [ - "include/msgpack.hpp", - ], - ), + ]), + strip_include_prefix = "include", ) -filegroup( - name = "source_files", +cc_library( + name = "msgpack", srcs = [ "src/objectc.c", "src/unpack.c", @@ -35,25 +18,15 @@ filegroup( "src/vrefbuffer.c", "src/zone.c", ], -) - -cc_library( - name = "msgpack", - srcs = [ - ":c_headers", - ":cxx_headers", - ":source_files", - ], hdrs = [ "include/msgpack.h", "include/msgpack.hpp", ], - includes = [ - "include", - ], strip_include_prefix = "include", copts = [ - #"-std=c++11", + ], + deps = [ + ":_msgpack", ], visibility = ["//visibility:public"], ) \ No newline at end of file diff --git a/bazel/BUILD.redis b/bazel/BUILD.redis index 14cd7194e..2b5d396dd 100644 --- a/bazel/BUILD.redis +++ b/bazel/BUILD.redis @@ -35,6 +35,8 @@ cc_library( name = "_hiredis", hdrs = [ "deps/hiredis/dict.c", + "deps/hiredis/dict.h", + "deps/hiredis/fmacros.h", ], strip_include_prefix = "deps/hiredis", ) @@ -55,7 +57,6 @@ cc_library( "deps/hiredis/*.h", "deps/hiredis/adapters/*.h", ]), - includes = ["deps/hiredis"], strip_include_prefix = "deps", deps = [ ":_hiredis", diff --git a/java/BUILD.bazel b/java/BUILD.bazel index 5dd517f3e..f8c019aa9 100644 --- a/java/BUILD.bazel +++ b/java/BUILD.bazel @@ -1,4 +1,5 @@ load("//bazel:ray.bzl", "define_java_module") +load("@bazel_skylib//rules:copy_file.bzl", "copy_file") load("@rules_proto_grpc//java:defs.bzl", "java_proto_compile") exports_files([ @@ -144,24 +145,18 @@ filegroup( # plasma_store_server binary should be located in jar root path # and keep in sync with mvn resource -genrule( +copy_file( name = "cp_plasma_store_server", - srcs = [ - "//:plasma_store_server", - ], - outs = ["plasma_store_server"], - cmd = """ - cp -f $(location //:plasma_store_server) $@ - """, + src = "//:plasma_store_server", + out = "plasma_store_server", ) # `//:redis-server`'s full path is `external/com_github_antirez_redis/redis-server`, # This rule removes the prefix, and only keeps `redis-server`. -genrule( +copy_file( name = "redis-server-without-prefix", - srcs = ["//:redis-server"], - outs = ["redis-server"], - cmd = "cp $< $@", + src = "//:redis-server", + out = "redis-server", ) filegroup( diff --git a/python/ray/includes/common.pxd b/python/ray/includes/common.pxd index 6e4cd4c7b..18c3b8d81 100644 --- a/python/ray/includes/common.pxd +++ b/python/ray/includes/common.pxd @@ -135,7 +135,7 @@ cdef extern from "ray/common/id.h" namespace "ray" nogil: int parent_task_counter) -cdef extern from "ray/protobuf/common.pb.h" nogil: +cdef extern from "src/ray/protobuf/common.pb.h" nogil: cdef cppclass CLanguage "Language": pass cdef cppclass CWorkerType "ray::WorkerType": @@ -150,16 +150,16 @@ cdef extern from "ray/protobuf/common.pb.h" nogil: # This is a workaround for C++ enum class since Cython has no corresponding # representation. -cdef extern from "ray/protobuf/common.pb.h" nogil: +cdef extern from "src/ray/protobuf/common.pb.h" nogil: cdef CLanguage LANGUAGE_PYTHON "Language::PYTHON" cdef CLanguage LANGUAGE_CPP "Language::CPP" cdef CLanguage LANGUAGE_JAVA "Language::JAVA" -cdef extern from "ray/protobuf/common.pb.h" nogil: +cdef extern from "src/ray/protobuf/common.pb.h" nogil: cdef CWorkerType WORKER_TYPE_WORKER "ray::WorkerType::WORKER" cdef CWorkerType WORKER_TYPE_DRIVER "ray::WorkerType::DRIVER" -cdef extern from "ray/protobuf/common.pb.h" nogil: +cdef extern from "src/ray/protobuf/common.pb.h" nogil: cdef CTaskType TASK_TYPE_NORMAL_TASK "ray::TaskType::NORMAL_TASK" cdef CTaskType TASK_TYPE_ACTOR_CREATION_TASK "ray::TaskType::ACTOR_CREATION_TASK" # noqa: E501 cdef CTaskType TASK_TYPE_ACTOR_TASK "ray::TaskType::ACTOR_TASK" diff --git a/python/ray/includes/function_descriptor.pxd b/python/ray/includes/function_descriptor.pxd index c1d516511..464261f95 100644 --- a/python/ray/includes/function_descriptor.pxd +++ b/python/ray/includes/function_descriptor.pxd @@ -16,7 +16,7 @@ from ray.includes.unique_ids cimport ( CTaskID, ) -cdef extern from "ray/protobuf/common.pb.h" nogil: +cdef extern from "src/ray/protobuf/common.pb.h" nogil: cdef cppclass CFunctionDescriptorType \ "ray::FunctionDescriptorType": pass diff --git a/python/ray/includes/serialization.pxi b/python/ray/includes/serialization.pxi index a9f68f077..31a5f1e04 100644 --- a/python/ray/includes/serialization.pxi +++ b/python/ray/includes/serialization.pxi @@ -24,7 +24,7 @@ cdef extern from "google/protobuf/repeated_field.h" nogil: cdef cppclass RepeatedField[Element]: const Element* data() const -cdef extern from "ray/protobuf/serialization.pb.h" nogil: +cdef extern from "src/ray/protobuf/serialization.pb.h" nogil: cdef cppclass CPythonBuffer "ray::serialization::PythonBuffer": void set_address(uint64_t value) uint64_t address() const diff --git a/src/ray/common/bundle_spec.cc b/src/ray/common/bundle_spec.cc index 44c9a961e..d4a295584 100644 --- a/src/ray/common/bundle_spec.cc +++ b/src/ray/common/bundle_spec.cc @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "bundle_spec.h" +#include "ray/common/bundle_spec.h" + namespace ray { void BundleSpecification::ComputeResources() { diff --git a/src/ray/common/client_connection.cc b/src/ray/common/client_connection.cc index 361c66ce7..aa6eccd6e 100644 --- a/src/ray/common/client_connection.cc +++ b/src/ray/common/client_connection.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "client_connection.h" +#include "ray/common/client_connection.h" #include #include diff --git a/src/ray/common/common_protocol.cc b/src/ray/common/common_protocol.cc index f698fe748..c0348a294 100644 --- a/src/ray/common/common_protocol.cc +++ b/src/ray/common/common_protocol.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "common_protocol.h" +#include "ray/common/common_protocol.h" #include "ray/util/logging.h" diff --git a/src/ray/common/function_descriptor.h b/src/ray/common/function_descriptor.h index 4514e1863..17abcdc2c 100644 --- a/src/ray/common/function_descriptor.h +++ b/src/ray/common/function_descriptor.h @@ -17,7 +17,7 @@ #include #include "ray/common/grpc_util.h" -#include "ray/protobuf/common.pb.h" +#include "src/ray/protobuf/common.pb.h" namespace ray { /// See `common.proto` for definition of `FunctionDescriptor` oneof type. @@ -25,6 +25,8 @@ using FunctionDescriptorType = rpc::FunctionDescriptor::FunctionDescriptorCase; /// Wrap a protobuf message. class FunctionDescriptorInterface : public MessageWrapper { public: + virtual ~FunctionDescriptorInterface() {} + /// Construct an empty FunctionDescriptor. FunctionDescriptorInterface() : MessageWrapper() {} diff --git a/src/ray/common/grpc_util.h b/src/ray/common/grpc_util.h index 4b80c8272..e6d2e1c90 100644 --- a/src/ray/common/grpc_util.h +++ b/src/ray/common/grpc_util.h @@ -20,7 +20,7 @@ #include -#include "status.h" +#include "ray/common/status.h" namespace ray { diff --git a/src/ray/common/id.h b/src/ray/common/id.h index 39bc0ecd4..391162196 100644 --- a/src/ray/common/id.h +++ b/src/ray/common/id.h @@ -400,7 +400,7 @@ std::ostream &operator<<(std::ostream &os, const PlacementGroupID &id); } \ }; -#include "id_def.h" +#include "ray/common/id_def.h" #undef DEFINE_UNIQUE_ID @@ -482,7 +482,7 @@ std::string BaseID::Hex() const { constexpr char hex[] = "0123456789abcdef"; const uint8_t *id = Data(); std::string result; - for (int i = 0; i < T::Size(); i++) { + for (size_t i = 0; i < T::Size(); i++) { unsigned int val = id[i]; result.push_back(hex[val >> 4]); result.push_back(hex[val & 0xf]); @@ -510,7 +510,7 @@ DEFINE_UNIQUE_ID(ActorID); DEFINE_UNIQUE_ID(TaskID); DEFINE_UNIQUE_ID(ObjectID); DEFINE_UNIQUE_ID(PlacementGroupID); -#include "id_def.h" +#include "ray/common/id_def.h" #undef DEFINE_UNIQUE_ID } // namespace std diff --git a/src/ray/common/network_util.cc b/src/ray/common/network_util.cc index 857db87ed..44a52f6fb 100644 --- a/src/ray/common/network_util.cc +++ b/src/ray/common/network_util.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "network_util.h" +#include "ray/common/network_util.h" #include "ray/util/logging.h" diff --git a/src/ray/common/network_util.h b/src/ray/common/network_util.h index 03ce37659..8e035d057 100644 --- a/src/ray/common/network_util.h +++ b/src/ray/common/network_util.h @@ -20,7 +20,7 @@ #include #include -#include "constants.h" +#include "ray/common/constants.h" using boost::asio::deadline_timer; using boost::asio::io_service; diff --git a/src/ray/common/placement_group.h b/src/ray/common/placement_group.h index 44f340934..2b5b8550a 100644 --- a/src/ray/common/placement_group.h +++ b/src/ray/common/placement_group.h @@ -17,7 +17,7 @@ #include "ray/common/bundle_spec.h" #include "ray/common/grpc_util.h" #include "ray/common/id.h" -#include "ray/protobuf/common.pb.h" +#include "src/ray/protobuf/common.pb.h" namespace ray { @@ -71,7 +71,7 @@ class PlacementGroupSpecBuilder { message_->set_placement_group_id(placement_group_id.Binary()); message_->set_name(name); message_->set_strategy(strategy); - for (int i = 0; i < bundles.size(); i++) { + for (size_t i = 0; i < bundles.size(); i++) { auto resources = bundles[i]; auto message_bundle = message_->add_bundles(); auto mutable_bundle_id = message_bundle->mutable_bundle_id(); diff --git a/src/ray/common/ray_config.h b/src/ray/common/ray_config.h index 47a89125a..fc70beb62 100644 --- a/src/ray/common/ray_config.h +++ b/src/ray/common/ray_config.h @@ -37,7 +37,7 @@ class RayConfig { public: \ inline type name() { return name##_; } -#include "ray_config_def.h" +#include "ray/common/ray_config_def.h" /// ------------------------------------------------------------------------- #undef RAY_CONFIG @@ -71,7 +71,7 @@ class RayConfig { for (auto const &pair : config_map) { // We use a big chain of if else statements because C++ doesn't allow // switch statements on strings. -#include "ray_config_def.h" +#include "ray/common/ray_config_def.h" RAY_LOG(FATAL) << "Received unexpected config parameter " << pair.first; } } diff --git a/src/ray/common/ray_object.h b/src/ray/common/ray_object.h index 7f4b261ad..633a5d787 100644 --- a/src/ray/common/ray_object.h +++ b/src/ray/common/ray_object.h @@ -17,8 +17,8 @@ #include "absl/types/optional.h" #include "ray/common/buffer.h" #include "ray/common/id.h" -#include "ray/protobuf/gcs.pb.h" #include "ray/util/logging.h" +#include "src/ray/protobuf/gcs.pb.h" namespace ray { diff --git a/src/ray/common/task/scheduling_resources.cc b/src/ray/common/task/scheduling_resources.cc index 729dafddd..4ef60da27 100644 --- a/src/ray/common/task/scheduling_resources.cc +++ b/src/ray/common/task/scheduling_resources.cc @@ -1,4 +1,4 @@ -#include "scheduling_resources.h" +#include "ray/common/task/scheduling_resources.h" #include #include diff --git a/src/ray/common/task/scheduling_resources_test.cc b/src/ray/common/task/scheduling_resources_test.cc index 46553330f..8611aca5f 100644 --- a/src/ray/common/task/scheduling_resources_test.cc +++ b/src/ray/common/task/scheduling_resources_test.cc @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "ray/common/task/scheduling_resources.h" + #include #include "gtest/gtest.h" #include "ray/common/id.h" -#include "scheduling_resources.h" namespace ray { class SchedulingResourcesTest : public ::testing::Test { diff --git a/src/ray/common/task/task.cc b/src/ray/common/task/task.cc index 280c8e1d9..eae684550 100644 --- a/src/ray/common/task/task.cc +++ b/src/ray/common/task/task.cc @@ -1,6 +1,6 @@ -#include +#include "ray/common/task/task.h" -#include "task.h" +#include namespace ray { diff --git a/src/ray/common/task/task_common.h b/src/ray/common/task/task_common.h index a95fbaffb..1637e426c 100644 --- a/src/ray/common/task/task_common.h +++ b/src/ray/common/task/task_common.h @@ -1,6 +1,6 @@ #pragma once -#include "ray/protobuf/common.pb.h" +#include "src/ray/protobuf/common.pb.h" namespace ray { diff --git a/src/ray/common/task/task_util.h b/src/ray/common/task/task_util.h index f734b3767..c562d6d25 100644 --- a/src/ray/common/task/task_util.h +++ b/src/ray/common/task/task_util.h @@ -3,7 +3,7 @@ #include "ray/common/buffer.h" #include "ray/common/ray_object.h" #include "ray/common/task/task_spec.h" -#include "ray/protobuf/common.pb.h" +#include "src/ray/protobuf/common.pb.h" namespace ray { diff --git a/src/ray/common/test_util.cc b/src/ray/common/test_util.cc index c66298907..dec6d531e 100644 --- a/src/ray/common/test_util.cc +++ b/src/ray/common/test_util.cc @@ -19,11 +19,11 @@ #include "ray/common/buffer.h" #include "ray/common/ray_object.h" +#include "ray/common/test_util.h" #include "ray/util/filesystem.h" #include "ray/util/logging.h" #include "ray/util/process.h" #include "ray/util/util.h" -#include "test_util.h" namespace ray { diff --git a/src/ray/common/test_util.h b/src/ray/common/test_util.h index 529e94a4a..ffc721073 100644 --- a/src/ray/common/test_util.h +++ b/src/ray/common/test_util.h @@ -16,15 +16,14 @@ #include +#include #include #include -#include - #include "gtest/gtest.h" #include "ray/common/id.h" -#include "ray/protobuf/common.pb.h" #include "ray/util/util.h" +#include "src/ray/protobuf/common.pb.h" namespace ray { diff --git a/src/ray/core_worker/actor_handle.h b/src/ray/core_worker/actor_handle.h index 9ca4de445..892de4d19 100644 --- a/src/ray/core_worker/actor_handle.h +++ b/src/ray/core_worker/actor_handle.h @@ -21,8 +21,8 @@ #include "ray/core_worker/common.h" #include "ray/core_worker/context.h" #include "ray/gcs/redis_gcs_client.h" -#include "ray/protobuf/core_worker.pb.h" -#include "ray/protobuf/gcs.pb.h" +#include "src/ray/protobuf/core_worker.pb.h" +#include "src/ray/protobuf/gcs.pb.h" namespace ray { diff --git a/src/ray/core_worker/common.h b/src/ray/core_worker/common.h index 8f52907c7..95102198e 100644 --- a/src/ray/core_worker/common.h +++ b/src/ray/core_worker/common.h @@ -123,7 +123,7 @@ struct PlacementGroupCreationOptions { PlacementGroupCreationOptions( const std::string &name, PlacementStrategy strategy, const std::vector> &bundles) - : name(name), strategy(strategy), bundles(bundles) {} + : strategy(strategy), bundles(bundles), name(name) {} /// The strategy to place the bundle in Placement Group. const PlacementStrategy strategy = rpc::PACK; diff --git a/src/ray/core_worker/fiber.h b/src/ray/core_worker/fiber.h index ff0806da9..6ccefde3a 100644 --- a/src/ray/core_worker/fiber.h +++ b/src/ray/core_worker/fiber.h @@ -14,8 +14,9 @@ #pragma once -#include #include + +#include "ray/util/logging.h" namespace ray { /// Used by async actor mode. The fiber event will be used diff --git a/src/ray/core_worker/future_resolver.h b/src/ray/core_worker/future_resolver.h index 8c8b38e04..8160fa964 100644 --- a/src/ray/core_worker/future_resolver.h +++ b/src/ray/core_worker/future_resolver.h @@ -18,8 +18,8 @@ #include "ray/common/id.h" #include "ray/core_worker/store_provider/memory_store/memory_store.h" -#include "ray/protobuf/core_worker.pb.h" #include "ray/rpc/worker/core_worker_client.h" +#include "src/ray/protobuf/core_worker.pb.h" namespace ray { diff --git a/src/ray/core_worker/lib/java/io_ray_runtime_RayNativeRuntime.cc b/src/ray/core_worker/lib/java/io_ray_runtime_RayNativeRuntime.cc index 651395049..8f4b9d0ec 100644 --- a/src/ray/core_worker/lib/java/io_ray_runtime_RayNativeRuntime.cc +++ b/src/ray/core_worker/lib/java/io_ray_runtime_RayNativeRuntime.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "ray/core_worker/lib/java/io_ray_runtime_RayNativeRuntime.h" +#include "io_ray_runtime_RayNativeRuntime.h" #include @@ -21,7 +21,7 @@ #include "ray/common/id.h" #include "ray/core_worker/actor_handle.h" #include "ray/core_worker/core_worker.h" -#include "ray/core_worker/lib/java/jni_utils.h" +#include "jni_utils.h" thread_local JNIEnv *local_env = nullptr; jobject java_task_executor = nullptr; diff --git a/src/ray/core_worker/lib/java/io_ray_runtime_actor_NativeActorHandle.cc b/src/ray/core_worker/lib/java/io_ray_runtime_actor_NativeActorHandle.cc index ee13b5c51..b7b6d0ee1 100644 --- a/src/ray/core_worker/lib/java/io_ray_runtime_actor_NativeActorHandle.cc +++ b/src/ray/core_worker/lib/java/io_ray_runtime_actor_NativeActorHandle.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "ray/core_worker/lib/java/io_ray_runtime_actor_NativeActorHandle.h" +#include "io_ray_runtime_actor_NativeActorHandle.h" #include @@ -20,7 +20,7 @@ #include "ray/core_worker/actor_handle.h" #include "ray/core_worker/common.h" #include "ray/core_worker/core_worker.h" -#include "ray/core_worker/lib/java/jni_utils.h" +#include "jni_utils.h" #ifdef __cplusplus extern "C" { diff --git a/src/ray/core_worker/lib/java/io_ray_runtime_context_NativeWorkerContext.cc b/src/ray/core_worker/lib/java/io_ray_runtime_context_NativeWorkerContext.cc index 8107b4746..6edc03d80 100644 --- a/src/ray/core_worker/lib/java/io_ray_runtime_context_NativeWorkerContext.cc +++ b/src/ray/core_worker/lib/java/io_ray_runtime_context_NativeWorkerContext.cc @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "ray/core_worker/lib/java/io_ray_runtime_context_NativeWorkerContext.h" +#include "io_ray_runtime_context_NativeWorkerContext.h" #include #include "ray/common/id.h" #include "ray/core_worker/context.h" #include "ray/core_worker/core_worker.h" -#include "ray/core_worker/lib/java/jni_utils.h" +#include "jni_utils.h" #ifdef __cplusplus extern "C" { diff --git a/src/ray/core_worker/lib/java/io_ray_runtime_gcs_GlobalStateAccessor.cc b/src/ray/core_worker/lib/java/io_ray_runtime_gcs_GlobalStateAccessor.cc index 90a8d21d6..25101c4c0 100644 --- a/src/ray/core_worker/lib/java/io_ray_runtime_gcs_GlobalStateAccessor.cc +++ b/src/ray/core_worker/lib/java/io_ray_runtime_gcs_GlobalStateAccessor.cc @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "ray/core_worker/lib/java/io_ray_runtime_gcs_GlobalStateAccessor.h" +#include "io_ray_runtime_gcs_GlobalStateAccessor.h" #include #include "ray/core_worker/common.h" -#include "ray/core_worker/lib/java/jni_utils.h" +#include "jni_utils.h" #include "ray/gcs/gcs_client/global_state_accessor.h" #ifdef __cplusplus diff --git a/src/ray/core_worker/lib/java/io_ray_runtime_object_NativeObjectStore.cc b/src/ray/core_worker/lib/java/io_ray_runtime_object_NativeObjectStore.cc index c5cd904a0..7083db2f5 100644 --- a/src/ray/core_worker/lib/java/io_ray_runtime_object_NativeObjectStore.cc +++ b/src/ray/core_worker/lib/java/io_ray_runtime_object_NativeObjectStore.cc @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "ray/core_worker/lib/java/io_ray_runtime_object_NativeObjectStore.h" +#include "io_ray_runtime_object_NativeObjectStore.h" #include #include "ray/common/id.h" #include "ray/core_worker/common.h" #include "ray/core_worker/core_worker.h" -#include "ray/core_worker/lib/java/jni_utils.h" +#include "jni_utils.h" #ifdef __cplusplus extern "C" { diff --git a/src/ray/core_worker/lib/java/io_ray_runtime_task_NativeTaskExecutor.cc b/src/ray/core_worker/lib/java/io_ray_runtime_task_NativeTaskExecutor.cc index 1fdc00c17..851bb31c6 100644 --- a/src/ray/core_worker/lib/java/io_ray_runtime_task_NativeTaskExecutor.cc +++ b/src/ray/core_worker/lib/java/io_ray_runtime_task_NativeTaskExecutor.cc @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "ray/core_worker/lib/java/io_ray_runtime_task_NativeTaskExecutor.h" +#include "io_ray_runtime_task_NativeTaskExecutor.h" #include #include "ray/common/id.h" #include "ray/core_worker/common.h" #include "ray/core_worker/core_worker.h" -#include "ray/core_worker/lib/java/jni_utils.h" +#include "jni_utils.h" #include "ray/raylet_client/raylet_client.h" #ifdef __cplusplus diff --git a/src/ray/core_worker/lib/java/io_ray_runtime_task_NativeTaskSubmitter.cc b/src/ray/core_worker/lib/java/io_ray_runtime_task_NativeTaskSubmitter.cc index 33884f05a..0d2a052ab 100644 --- a/src/ray/core_worker/lib/java/io_ray_runtime_task_NativeTaskSubmitter.cc +++ b/src/ray/core_worker/lib/java/io_ray_runtime_task_NativeTaskSubmitter.cc @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "ray/core_worker/lib/java/io_ray_runtime_task_NativeTaskSubmitter.h" +#include "io_ray_runtime_task_NativeTaskSubmitter.h" #include #include "ray/common/id.h" #include "ray/core_worker/common.h" #include "ray/core_worker/core_worker.h" -#include "ray/core_worker/lib/java/jni_utils.h" +#include "jni_utils.h" /// Store C++ instances of ray function in the cache to avoid unnessesary JNI operations. thread_local std::unordered_map>> diff --git a/src/ray/core_worker/lib/java/jni_init.cc b/src/ray/core_worker/lib/java/jni_init.cc index b2c3065fd..504c05eca 100644 --- a/src/ray/core_worker/lib/java/jni_init.cc +++ b/src/ray/core_worker/lib/java/jni_init.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "ray/core_worker/lib/java/jni_utils.h" +#include "jni_utils.h" jclass java_boolean_class; jmethodID java_boolean_init; diff --git a/src/ray/core_worker/object_recovery_manager.h b/src/ray/core_worker/object_recovery_manager.h index fb19c4553..a4b04c004 100644 --- a/src/ray/core_worker/object_recovery_manager.h +++ b/src/ray/core_worker/object_recovery_manager.h @@ -46,12 +46,12 @@ class ObjectRecoveryManager { std::function reconstruction_failure_callback, bool lineage_reconstruction_enabled) - : rpc_address_(rpc_address), + : task_resubmitter_(task_resubmitter), + reference_counter_(reference_counter), + rpc_address_(rpc_address), client_factory_(client_factory), local_object_pinning_client_(local_object_pinning_client), object_lookup_(object_lookup), - task_resubmitter_(task_resubmitter), - reference_counter_(reference_counter), in_memory_store_(in_memory_store), reconstruction_failure_callback_(reconstruction_failure_callback), lineage_reconstruction_enabled_(lineage_reconstruction_enabled) {} diff --git a/src/ray/core_worker/reference_count.h b/src/ray/core_worker/reference_count.h index 39d09211b..639395cc6 100644 --- a/src/ray/core_worker/reference_count.h +++ b/src/ray/core_worker/reference_count.h @@ -21,10 +21,10 @@ #include "absl/container/flat_hash_set.h" #include "absl/synchronization/mutex.h" #include "ray/common/id.h" -#include "ray/protobuf/common.pb.h" #include "ray/rpc/grpc_server.h" #include "ray/rpc/worker/core_worker_client.h" #include "ray/util/logging.h" +#include "src/ray/protobuf/common.pb.h" namespace ray { @@ -370,8 +370,8 @@ class ReferenceCounter : public ReferenceCounterInterface { object_size(object_size), owned_by_us(true), owner_address(owner_address), - is_reconstructable(is_reconstructable), - pinned_at_raylet_id(pinned_at_raylet_id) {} + pinned_at_raylet_id(pinned_at_raylet_id), + is_reconstructable(is_reconstructable) {} /// Constructor from a protobuf. This is assumed to be a message from /// another process, so the object defaults to not being owned by us. diff --git a/src/ray/core_worker/store_provider/plasma_store_provider.cc b/src/ray/core_worker/store_provider/plasma_store_provider.cc index 654d3259d..ae54cda74 100644 --- a/src/ray/core_worker/store_provider/plasma_store_provider.cc +++ b/src/ray/core_worker/store_provider/plasma_store_provider.cc @@ -17,7 +17,7 @@ #include "ray/common/ray_config.h" #include "ray/core_worker/context.h" #include "ray/core_worker/core_worker.h" -#include "ray/protobuf/gcs.pb.h" +#include "src/ray/protobuf/gcs.pb.h" namespace ray { diff --git a/src/ray/core_worker/task_manager.h b/src/ray/core_worker/task_manager.h index c89c121cc..dbd56ea17 100644 --- a/src/ray/core_worker/task_manager.h +++ b/src/ray/core_worker/task_manager.h @@ -21,8 +21,8 @@ #include "ray/common/task/task.h" #include "ray/core_worker/actor_reporter.h" #include "ray/core_worker/store_provider/memory_store/memory_store.h" -#include "ray/protobuf/core_worker.pb.h" -#include "ray/protobuf/gcs.pb.h" +#include "src/ray/protobuf/core_worker.pb.h" +#include "src/ray/protobuf/gcs.pb.h" namespace ray { diff --git a/src/ray/core_worker/test/core_worker_test.cc b/src/ray/core_worker/test/core_worker_test.cc index b89e21abc..c699120d7 100644 --- a/src/ray/core_worker/test/core_worker_test.cc +++ b/src/ray/core_worker/test/core_worker_test.cc @@ -31,10 +31,10 @@ #include "ray/core_worker/context.h" #include "ray/core_worker/store_provider/memory_store/memory_store.h" #include "ray/core_worker/transport/direct_actor_transport.h" -#include "ray/protobuf/core_worker.pb.h" -#include "ray/protobuf/gcs.pb.h" #include "ray/raylet_client/raylet_client.h" #include "ray/util/filesystem.h" +#include "src/ray/protobuf/core_worker.pb.h" +#include "src/ray/protobuf/gcs.pb.h" namespace { diff --git a/src/ray/core_worker/transport/direct_actor_transport.h b/src/ray/core_worker/transport/direct_actor_transport.h index b71512013..b0571b810 100644 --- a/src/ray/core_worker/transport/direct_actor_transport.h +++ b/src/ray/core_worker/transport/direct_actor_transport.h @@ -14,6 +14,12 @@ #pragma once +#ifdef __clang__ +// TODO(mehrdadn): Remove this when the warnings are addressed +#pragma clang diagnostic push +#pragma clang diagnostic warning "-Wunused-result" +#endif + #include #include #include @@ -332,11 +338,11 @@ class SchedulingQueue { SchedulingQueue(boost::asio::io_service &main_io_service, DependencyWaiter &waiter, WorkerContext &worker_context, int64_t reorder_wait_seconds = kMaxReorderWaitSeconds) - : wait_timer_(main_io_service), - waiter_(waiter), + : worker_context_(worker_context), reorder_wait_seconds_(reorder_wait_seconds), + wait_timer_(main_io_service), main_thread_id_(boost::this_thread::get_id()), - worker_context_(worker_context) {} + waiter_(waiter) {} void Add(int64_t seq_no, int64_t client_processed_up_to, std::function accept_request, std::function reject_request, @@ -525,3 +531,7 @@ class CoreWorkerDirectTaskReceiver { }; } // namespace ray + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif diff --git a/src/ray/core_worker/transport/direct_task_transport.h b/src/ray/core_worker/transport/direct_task_transport.h index a7f9c2d27..b1dbec78d 100644 --- a/src/ray/core_worker/transport/direct_task_transport.h +++ b/src/ray/core_worker/transport/direct_task_transport.h @@ -66,9 +66,9 @@ class CoreWorkerDirectTaskSubmitter { resolver_(store, task_finisher), task_finisher_(task_finisher), lease_timeout_ms_(lease_timeout_ms), - max_tasks_in_flight_per_worker_(max_tasks_in_flight_per_worker), local_raylet_id_(local_raylet_id), actor_create_callback_(std::move(actor_create_callback)), + max_tasks_in_flight_per_worker_(max_tasks_in_flight_per_worker), cancel_retry_timer_(std::move(cancel_timer)) {} /// Schedule a task for direct submission to a worker. diff --git a/src/ray/gcs/accessor.h b/src/ray/gcs/accessor.h index cd87f0c79..fcba7bb59 100644 --- a/src/ray/gcs/accessor.h +++ b/src/ray/gcs/accessor.h @@ -19,7 +19,7 @@ #include "ray/common/task/task_spec.h" #include "ray/gcs/callback.h" #include "ray/gcs/entry_change_notification.h" -#include "ray/protobuf/gcs.pb.h" +#include "src/ray/protobuf/gcs.pb.h" namespace ray { @@ -714,6 +714,8 @@ class WorkerInfoAccessor { class PlacementGroupInfoAccessor { public: + virtual ~PlacementGroupInfoAccessor() = default; + // TODO(AlisaWu): fill the accessor. /// Create an placement group to GCS asynchronously. /// diff --git a/src/ray/gcs/asio.cc b/src/ray/gcs/asio.cc index d74ce0902..6157c2761 100644 --- a/src/ray/gcs/asio.cc +++ b/src/ray/gcs/asio.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "asio.h" +#include "ray/gcs/asio.h" #include "ray/util/logging.h" diff --git a/src/ray/gcs/entry_change_notification.h b/src/ray/gcs/entry_change_notification.h index 14458f8f8..ff6fc8597 100644 --- a/src/ray/gcs/entry_change_notification.h +++ b/src/ray/gcs/entry_change_notification.h @@ -14,9 +14,10 @@ #pragma once -#include #include +#include "src/ray/protobuf/gcs.pb.h" + namespace ray { namespace gcs { diff --git a/src/ray/gcs/gcs_client/global_state_accessor.cc b/src/ray/gcs/gcs_client/global_state_accessor.cc index bef6aa685..dc4549cb3 100644 --- a/src/ray/gcs/gcs_client/global_state_accessor.cc +++ b/src/ray/gcs/gcs_client/global_state_accessor.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "global_state_accessor.h" +#include "ray/gcs/gcs_client/global_state_accessor.h" #include diff --git a/src/ray/gcs/gcs_client/global_state_accessor.h b/src/ray/gcs/gcs_client/global_state_accessor.h index d6fff6387..f3d0597f5 100644 --- a/src/ray/gcs/gcs_client/global_state_accessor.h +++ b/src/ray/gcs/gcs_client/global_state_accessor.h @@ -14,8 +14,8 @@ #pragma once +#include "ray/gcs/gcs_client/service_based_gcs_client.h" #include "ray/rpc/server_call.h" -#include "service_based_gcs_client.h" namespace ray { namespace gcs { diff --git a/src/ray/gcs/gcs_client/service_based_accessor.h b/src/ray/gcs/gcs_client/service_based_accessor.h index d7af72c2f..5ee5f7464 100644 --- a/src/ray/gcs/gcs_client/service_based_accessor.h +++ b/src/ray/gcs/gcs_client/service_based_accessor.h @@ -14,8 +14,7 @@ #pragma once -#include - +#include "ray/common/task/task_spec.h" #include "ray/gcs/accessor.h" #include "ray/gcs/subscription_executor.h" #include "ray/util/sequencer.h" diff --git a/src/ray/gcs/gcs_server/error_info_handler_impl.cc b/src/ray/gcs/gcs_server/error_info_handler_impl.cc index c14881606..274970075 100644 --- a/src/ray/gcs/gcs_server/error_info_handler_impl.cc +++ b/src/ray/gcs/gcs_server/error_info_handler_impl.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "error_info_handler_impl.h" +#include "ray/gcs/gcs_server/error_info_handler_impl.h" namespace ray { namespace rpc { diff --git a/src/ray/gcs/gcs_server/gcs_actor_manager.cc b/src/ray/gcs/gcs_server/gcs_actor_manager.cc index ebfff8adb..7988cc502 100644 --- a/src/ray/gcs/gcs_server/gcs_actor_manager.cc +++ b/src/ray/gcs/gcs_server/gcs_actor_manager.cc @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "gcs_actor_manager.h" - -#include +#include "ray/gcs/gcs_server/gcs_actor_manager.h" #include +#include "ray/common/ray_config.h" + namespace ray { namespace gcs { diff --git a/src/ray/gcs/gcs_server/gcs_actor_manager.h b/src/ray/gcs/gcs_server/gcs_actor_manager.h index b4c6a2a32..a2721af80 100644 --- a/src/ray/gcs/gcs_server/gcs_actor_manager.h +++ b/src/ray/gcs/gcs_server/gcs_actor_manager.h @@ -14,19 +14,19 @@ #pragma once -#include -#include -#include -#include -#include #include #include "absl/container/flat_hash_map.h" -#include "gcs_actor_scheduler.h" -#include "gcs_table_storage.h" +#include "ray/common/id.h" +#include "ray/common/task/task_execution_spec.h" +#include "ray/common/task/task_spec.h" +#include "ray/gcs/gcs_server/gcs_actor_scheduler.h" +#include "ray/gcs/gcs_server/gcs_table_storage.h" #include "ray/gcs/pubsub/gcs_pub_sub.h" #include "ray/gcs/redis_gcs_client.h" #include "ray/rpc/gcs_server/gcs_rpc_server.h" +#include "ray/rpc/worker/core_worker_client.h" +#include "src/ray/protobuf/gcs_service.pb.h" namespace ray { namespace gcs { diff --git a/src/ray/gcs/gcs_server/gcs_actor_scheduler.cc b/src/ray/gcs/gcs_server/gcs_actor_scheduler.cc index 196b1d12a..44cceef7e 100644 --- a/src/ray/gcs/gcs_server/gcs_actor_scheduler.cc +++ b/src/ray/gcs/gcs_server/gcs_actor_scheduler.cc @@ -12,11 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "gcs_actor_scheduler.h" -#include -#include -#include -#include "gcs_actor_manager.h" +#include "ray/gcs/gcs_server/gcs_actor_scheduler.h" + +#include "ray/common/ray_config.h" +#include "ray/gcs/gcs_server/gcs_actor_manager.h" +#include "ray/util/asio_util.h" +#include "src/ray/protobuf/node_manager.pb.h" namespace ray { namespace gcs { diff --git a/src/ray/gcs/gcs_server/gcs_actor_scheduler.h b/src/ray/gcs/gcs_server/gcs_actor_scheduler.h index 61e729bef..fb94929ec 100644 --- a/src/ray/gcs/gcs_server/gcs_actor_scheduler.h +++ b/src/ray/gcs/gcs_server/gcs_actor_scheduler.h @@ -14,20 +14,20 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include -#include #include #include "absl/container/flat_hash_map.h" #include "absl/container/flat_hash_set.h" -#include "gcs_node_manager.h" -#include "gcs_table_storage.h" +#include "ray/common/id.h" +#include "ray/common/task/task_execution_spec.h" +#include "ray/common/task/task_spec.h" +#include "ray/gcs/accessor.h" +#include "ray/gcs/gcs_server/gcs_node_manager.h" +#include "ray/gcs/gcs_server/gcs_table_storage.h" +#include "ray/raylet_client/raylet_client.h" +#include "ray/rpc/node_manager/node_manager_client.h" +#include "ray/rpc/worker/core_worker_client.h" +#include "src/ray/protobuf/gcs_service.pb.h" namespace ray { namespace gcs { diff --git a/src/ray/gcs/gcs_server/gcs_job_manager.cc b/src/ray/gcs/gcs_server/gcs_job_manager.cc index b5d60f555..9b6cbf074 100644 --- a/src/ray/gcs/gcs_server/gcs_job_manager.cc +++ b/src/ray/gcs/gcs_server/gcs_job_manager.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "gcs_job_manager.h" +#include "ray/gcs/gcs_server/gcs_job_manager.h" #include "ray/gcs/pb_util.h" diff --git a/src/ray/gcs/gcs_server/gcs_job_manager.h b/src/ray/gcs/gcs_server/gcs_job_manager.h index db9f129a5..24d8f7dfe 100644 --- a/src/ray/gcs/gcs_server/gcs_job_manager.h +++ b/src/ray/gcs/gcs_server/gcs_job_manager.h @@ -14,8 +14,8 @@ #pragma once -#include "gcs_object_manager.h" -#include "gcs_table_storage.h" +#include "ray/gcs/gcs_server/gcs_object_manager.h" +#include "ray/gcs/gcs_server/gcs_table_storage.h" #include "ray/gcs/pubsub/gcs_pub_sub.h" #include "ray/gcs/redis_gcs_client.h" #include "ray/rpc/gcs_server/gcs_rpc_server.h" diff --git a/src/ray/gcs/gcs_server/gcs_node_manager.cc b/src/ray/gcs/gcs_server/gcs_node_manager.cc index b26423375..645e31661 100644 --- a/src/ray/gcs/gcs_server/gcs_node_manager.cc +++ b/src/ray/gcs/gcs_server/gcs_node_manager.cc @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "gcs_node_manager.h" +#include "ray/gcs/gcs_server/gcs_node_manager.h" -#include -#include -#include +#include "ray/common/ray_config.h" +#include "ray/gcs/pb_util.h" +#include "src/ray/protobuf/gcs.pb.h" namespace ray { namespace gcs { diff --git a/src/ray/gcs/gcs_server/gcs_node_manager.h b/src/ray/gcs/gcs_server/gcs_node_manager.h index 27ff5778f..f9b4124d0 100644 --- a/src/ray/gcs/gcs_server/gcs_node_manager.h +++ b/src/ray/gcs/gcs_server/gcs_node_manager.h @@ -14,16 +14,15 @@ #pragma once -#include -#include -#include -#include -#include - #include "absl/container/flat_hash_map.h" #include "absl/container/flat_hash_set.h" -#include "gcs_table_storage.h" +#include "ray/common/id.h" +#include "ray/gcs/accessor.h" +#include "ray/gcs/gcs_server/gcs_table_storage.h" #include "ray/gcs/pubsub/gcs_pub_sub.h" +#include "ray/rpc/client_call.h" +#include "ray/rpc/gcs_server/gcs_rpc_server.h" +#include "src/ray/protobuf/gcs.pb.h" namespace ray { namespace gcs { diff --git a/src/ray/gcs/gcs_server/gcs_object_manager.cc b/src/ray/gcs/gcs_server/gcs_object_manager.cc index ff162c168..48142c29a 100644 --- a/src/ray/gcs/gcs_server/gcs_object_manager.cc +++ b/src/ray/gcs/gcs_server/gcs_object_manager.cc @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "gcs_object_manager.h" +#include "ray/gcs/gcs_server/gcs_object_manager.h" + #include "ray/gcs/pb_util.h" namespace ray { diff --git a/src/ray/gcs/gcs_server/gcs_object_manager.h b/src/ray/gcs/gcs_server/gcs_object_manager.h index a0e1f31ed..f0e9c7a89 100644 --- a/src/ray/gcs/gcs_server/gcs_object_manager.h +++ b/src/ray/gcs/gcs_server/gcs_object_manager.h @@ -14,8 +14,8 @@ #pragma once -#include "gcs_node_manager.h" -#include "gcs_table_storage.h" +#include "ray/gcs/gcs_server/gcs_node_manager.h" +#include "ray/gcs/gcs_server/gcs_table_storage.h" #include "ray/gcs/pubsub/gcs_pub_sub.h" #include "ray/gcs/redis_gcs_client.h" diff --git a/src/ray/gcs/gcs_server/gcs_placement_group_manager.cc b/src/ray/gcs/gcs_server/gcs_placement_group_manager.cc index a38291cba..3550327f9 100644 --- a/src/ray/gcs/gcs_server/gcs_placement_group_manager.cc +++ b/src/ray/gcs/gcs_server/gcs_placement_group_manager.cc @@ -13,9 +13,10 @@ // limitations under the License. #include "ray/gcs/gcs_server/gcs_placement_group_manager.h" -#include -#include -#include + +#include "ray/common/ray_config.h" +#include "ray/gcs/pb_util.h" +#include "src/ray/protobuf/gcs.pb.h" namespace ray { namespace gcs { diff --git a/src/ray/gcs/gcs_server/gcs_placement_group_manager.h b/src/ray/gcs/gcs_server/gcs_placement_group_manager.h index 3c8bc6968..3a1cf0f17 100644 --- a/src/ray/gcs/gcs_server/gcs_placement_group_manager.h +++ b/src/ray/gcs/gcs_server/gcs_placement_group_manager.h @@ -13,18 +13,18 @@ // limitations under the License. #pragma once -#include -#include -#include -#include -#include #include #include "absl/container/flat_hash_map.h" #include "absl/container/flat_hash_set.h" -#include "gcs_placement_group_scheduler.h" -#include "gcs_table_storage.h" +#include "ray/common/id.h" +#include "ray/common/task/task_execution_spec.h" +#include "ray/common/task/task_spec.h" +#include "ray/gcs/gcs_server/gcs_placement_group_scheduler.h" +#include "ray/gcs/gcs_server/gcs_table_storage.h" #include "ray/gcs/pubsub/gcs_pub_sub.h" +#include "ray/rpc/worker/core_worker_client.h" +#include "src/ray/protobuf/gcs_service.pb.h" namespace ray { namespace gcs { diff --git a/src/ray/gcs/gcs_server/gcs_placement_group_scheduler.cc b/src/ray/gcs/gcs_server/gcs_placement_group_scheduler.cc index 9fac025ee..5b0e629ec 100644 --- a/src/ray/gcs/gcs_server/gcs_placement_group_scheduler.cc +++ b/src/ray/gcs/gcs_server/gcs_placement_group_scheduler.cc @@ -13,8 +13,9 @@ // limitations under the License. #include "ray/gcs/gcs_server/gcs_placement_group_scheduler.h" -#include + #include "ray/gcs/gcs_server/gcs_placement_group_manager.h" +#include "src/ray/protobuf/gcs.pb.h" namespace ray { namespace gcs { diff --git a/src/ray/gcs/gcs_server/gcs_placement_group_scheduler.h b/src/ray/gcs/gcs_server/gcs_placement_group_scheduler.h index 081281305..572703f9a 100644 --- a/src/ray/gcs/gcs_server/gcs_placement_group_scheduler.h +++ b/src/ray/gcs/gcs_server/gcs_placement_group_scheduler.h @@ -13,19 +13,19 @@ // limitations under the License. #pragma once -#include -#include -#include -#include -#include -#include #include #include #include "absl/container/flat_hash_map.h" #include "absl/container/flat_hash_set.h" -#include "gcs_node_manager.h" -#include "gcs_table_storage.h" +#include "ray/common/id.h" +#include "ray/gcs/accessor.h" +#include "ray/gcs/gcs_server/gcs_node_manager.h" +#include "ray/gcs/gcs_server/gcs_table_storage.h" +#include "ray/raylet_client/raylet_client.h" +#include "ray/rpc/node_manager/node_manager_client.h" +#include "ray/rpc/worker/core_worker_client.h" +#include "src/ray/protobuf/gcs_service.pb.h" namespace ray { namespace gcs { @@ -62,6 +62,7 @@ class GcsPlacementGroupSchedulerInterface { class GcsScheduleStrategy { public: + virtual ~GcsScheduleStrategy() {} virtual ScheduleMap Schedule( std::vector> &bundles, const GcsNodeManager &node_manager) = 0; diff --git a/src/ray/gcs/gcs_server/gcs_redis_failure_detector.cc b/src/ray/gcs/gcs_server/gcs_redis_failure_detector.cc index 24ab9dc45..2fd1179b1 100644 --- a/src/ray/gcs/gcs_server/gcs_redis_failure_detector.cc +++ b/src/ray/gcs/gcs_server/gcs_redis_failure_detector.cc @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "gcs_redis_failure_detector.h" +#include "ray/gcs/gcs_server/gcs_redis_failure_detector.h" + #include "ray/common/ray_config.h" extern "C" { diff --git a/src/ray/gcs/gcs_server/gcs_server.cc b/src/ray/gcs/gcs_server/gcs_server.cc index c745e045e..7fc705091 100644 --- a/src/ray/gcs/gcs_server/gcs_server.cc +++ b/src/ray/gcs/gcs_server/gcs_server.cc @@ -12,19 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "gcs_server.h" +#include "ray/gcs/gcs_server/gcs_server.h" -#include "error_info_handler_impl.h" -#include "gcs_actor_manager.h" -#include "gcs_job_manager.h" -#include "gcs_node_manager.h" -#include "gcs_object_manager.h" -#include "gcs_placement_group_manager.h" -#include "gcs_worker_manager.h" #include "ray/common/network_util.h" #include "ray/common/ray_config.h" -#include "stats_handler_impl.h" -#include "task_info_handler_impl.h" +#include "ray/gcs/gcs_server/error_info_handler_impl.h" +#include "ray/gcs/gcs_server/gcs_actor_manager.h" +#include "ray/gcs/gcs_server/gcs_job_manager.h" +#include "ray/gcs/gcs_server/gcs_node_manager.h" +#include "ray/gcs/gcs_server/gcs_object_manager.h" +#include "ray/gcs/gcs_server/gcs_placement_group_manager.h" +#include "ray/gcs/gcs_server/gcs_worker_manager.h" +#include "ray/gcs/gcs_server/stats_handler_impl.h" +#include "ray/gcs/gcs_server/task_info_handler_impl.h" namespace ray { namespace gcs { diff --git a/src/ray/gcs/gcs_server/gcs_server.h b/src/ray/gcs/gcs_server/gcs_server.h index 3c8b782cf..aa208750e 100644 --- a/src/ray/gcs/gcs_server/gcs_server.h +++ b/src/ray/gcs/gcs_server/gcs_server.h @@ -14,13 +14,13 @@ #pragma once -#include -#include -#include -#include #include "ray/gcs/gcs_server/gcs_object_manager.h" #include "ray/gcs/gcs_server/gcs_redis_failure_detector.h" #include "ray/gcs/gcs_server/gcs_table_storage.h" +#include "ray/gcs/pubsub/gcs_pub_sub.h" +#include "ray/gcs/redis_gcs_client.h" +#include "ray/rpc/client_call.h" +#include "ray/rpc/gcs_server/gcs_rpc_server.h" namespace ray { namespace gcs { diff --git a/src/ray/gcs/gcs_server/gcs_table_storage.cc b/src/ray/gcs/gcs_server/gcs_table_storage.cc index 4da49f71d..541f5a0fa 100644 --- a/src/ray/gcs/gcs_server/gcs_table_storage.cc +++ b/src/ray/gcs/gcs_server/gcs_table_storage.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "gcs_table_storage.h" +#include "ray/gcs/gcs_server/gcs_table_storage.h" #include "ray/common/id.h" #include "ray/common/status.h" diff --git a/src/ray/gcs/gcs_server/gcs_table_storage.h b/src/ray/gcs/gcs_server/gcs_table_storage.h index 2b605f748..eb5e806f2 100644 --- a/src/ray/gcs/gcs_server/gcs_table_storage.h +++ b/src/ray/gcs/gcs_server/gcs_table_storage.h @@ -18,7 +18,7 @@ #include "ray/gcs/store_client/in_memory_store_client.h" #include "ray/gcs/store_client/redis_store_client.h" -#include "ray/protobuf/gcs.pb.h" +#include "src/ray/protobuf/gcs.pb.h" namespace ray { namespace gcs { diff --git a/src/ray/gcs/gcs_server/gcs_worker_manager.cc b/src/ray/gcs/gcs_server/gcs_worker_manager.cc index 827976f00..35ca0769d 100644 --- a/src/ray/gcs/gcs_server/gcs_worker_manager.cc +++ b/src/ray/gcs/gcs_server/gcs_worker_manager.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "gcs_worker_manager.h" +#include "ray/gcs/gcs_server/gcs_worker_manager.h" namespace ray { namespace gcs { diff --git a/src/ray/gcs/gcs_server/gcs_worker_manager.h b/src/ray/gcs/gcs_server/gcs_worker_manager.h index 5013dd0c2..b81c787c6 100644 --- a/src/ray/gcs/gcs_server/gcs_worker_manager.h +++ b/src/ray/gcs/gcs_server/gcs_worker_manager.h @@ -14,7 +14,7 @@ #pragma once -#include "gcs_table_storage.h" +#include "ray/gcs/gcs_server/gcs_table_storage.h" #include "ray/gcs/pubsub/gcs_pub_sub.h" #include "ray/gcs/redis_gcs_client.h" #include "ray/rpc/gcs_server/gcs_rpc_server.h" diff --git a/src/ray/gcs/gcs_server/stats_handler_impl.cc b/src/ray/gcs/gcs_server/stats_handler_impl.cc index 7725f1081..ae48b0bdd 100644 --- a/src/ray/gcs/gcs_server/stats_handler_impl.cc +++ b/src/ray/gcs/gcs_server/stats_handler_impl.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "stats_handler_impl.h" +#include "ray/gcs/gcs_server/stats_handler_impl.h" namespace ray { namespace rpc { diff --git a/src/ray/gcs/gcs_server/stats_handler_impl.h b/src/ray/gcs/gcs_server/stats_handler_impl.h index 86599eb36..a73a717df 100644 --- a/src/ray/gcs/gcs_server/stats_handler_impl.h +++ b/src/ray/gcs/gcs_server/stats_handler_impl.h @@ -14,7 +14,7 @@ #pragma once -#include "gcs_table_storage.h" +#include "ray/gcs/gcs_server/gcs_table_storage.h" #include "ray/gcs/redis_gcs_client.h" #include "ray/rpc/gcs_server/gcs_rpc_server.h" diff --git a/src/ray/gcs/gcs_server/task_info_handler_impl.cc b/src/ray/gcs/gcs_server/task_info_handler_impl.cc index 6f634390b..9595cb0c9 100644 --- a/src/ray/gcs/gcs_server/task_info_handler_impl.cc +++ b/src/ray/gcs/gcs_server/task_info_handler_impl.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "task_info_handler_impl.h" +#include "ray/gcs/gcs_server/task_info_handler_impl.h" namespace ray { namespace rpc { diff --git a/src/ray/gcs/gcs_server/task_info_handler_impl.h b/src/ray/gcs/gcs_server/task_info_handler_impl.h index d84dbd185..0b6538a59 100644 --- a/src/ray/gcs/gcs_server/task_info_handler_impl.h +++ b/src/ray/gcs/gcs_server/task_info_handler_impl.h @@ -14,7 +14,7 @@ #pragma once -#include "gcs_table_storage.h" +#include "ray/gcs/gcs_server/gcs_table_storage.h" #include "ray/gcs/pubsub/gcs_pub_sub.h" #include "ray/gcs/redis_gcs_client.h" #include "ray/rpc/gcs_server/gcs_rpc_server.h" diff --git a/src/ray/gcs/gcs_server/test/gcs_actor_manager_test.cc b/src/ray/gcs/gcs_server/test/gcs_actor_manager_test.cc index fc0cd37b8..1506105b4 100644 --- a/src/ray/gcs/gcs_server/test/gcs_actor_manager_test.cc +++ b/src/ray/gcs/gcs_server/test/gcs_actor_manager_test.cc @@ -12,13 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include - #include #include "gtest/gtest.h" #include "ray/common/test_util.h" +#include "ray/gcs/gcs_server/test/gcs_server_test_util.h" +#include "ray/gcs/test/gcs_test_util.h" namespace ray { diff --git a/src/ray/gcs/gcs_server/test/gcs_actor_scheduler_test.cc b/src/ray/gcs/gcs_server/test/gcs_actor_scheduler_test.cc index d78b7ed19..427795d69 100644 --- a/src/ray/gcs/gcs_server/test/gcs_actor_scheduler_test.cc +++ b/src/ray/gcs/gcs_server/test/gcs_actor_scheduler_test.cc @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include - #include + #include "gtest/gtest.h" +#include "ray/gcs/gcs_server/test/gcs_server_test_util.h" +#include "ray/gcs/test/gcs_test_util.h" namespace ray { diff --git a/src/ray/gcs/gcs_server/test/gcs_node_manager_test.cc b/src/ray/gcs/gcs_server/test/gcs_node_manager_test.cc index 5ea44dfd5..2cce7d807 100644 --- a/src/ray/gcs/gcs_server/test/gcs_node_manager_test.cc +++ b/src/ray/gcs/gcs_server/test/gcs_node_manager_test.cc @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include - #include + #include "gtest/gtest.h" +#include "ray/gcs/gcs_server/test/gcs_server_test_util.h" +#include "ray/gcs/test/gcs_test_util.h" namespace ray { class GcsNodeManagerTest : public ::testing::Test { diff --git a/src/ray/gcs/gcs_server/test/gcs_object_manager_test.cc b/src/ray/gcs/gcs_server/test/gcs_object_manager_test.cc index ee91db7de..9515b51c8 100644 --- a/src/ray/gcs/gcs_server/test/gcs_object_manager_test.cc +++ b/src/ray/gcs/gcs_server/test/gcs_object_manager_test.cc @@ -13,9 +13,10 @@ // limitations under the License. #include "ray/gcs/gcs_server/gcs_object_manager.h" -#include -#include + #include "gtest/gtest.h" +#include "ray/gcs/gcs_server/test/gcs_server_test_util.h" +#include "ray/gcs/test/gcs_test_util.h" namespace ray { diff --git a/src/ray/gcs/gcs_server/test/gcs_placement_group_manager_test.cc b/src/ray/gcs/gcs_server/test/gcs_placement_group_manager_test.cc index 91ade0b2e..12fa81df6 100644 --- a/src/ray/gcs/gcs_server/test/gcs_placement_group_manager_test.cc +++ b/src/ray/gcs/gcs_server/test/gcs_placement_group_manager_test.cc @@ -12,12 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include - #include #include "gtest/gtest.h" +#include "ray/gcs/gcs_server/test/gcs_server_test_util.h" +#include "ray/gcs/test/gcs_test_util.h" namespace ray { diff --git a/src/ray/gcs/gcs_server/test/gcs_placement_group_scheduler_test.cc b/src/ray/gcs/gcs_server/test/gcs_placement_group_scheduler_test.cc index 42be7a5be..9d081a923 100644 --- a/src/ray/gcs/gcs_server/test/gcs_placement_group_scheduler_test.cc +++ b/src/ray/gcs/gcs_server/test/gcs_placement_group_scheduler_test.cc @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include -#include - #include + #include "gtest/gtest.h" +#include "ray/gcs/gcs_server/test/gcs_server_test_util.h" +#include "ray/gcs/test/gcs_test_util.h" namespace ray { diff --git a/src/ray/gcs/pb_util.h b/src/ray/gcs/pb_util.h index 988276bc2..f9adaa3e3 100644 --- a/src/ray/gcs/pb_util.h +++ b/src/ray/gcs/pb_util.h @@ -18,7 +18,7 @@ #include "ray/common/id.h" #include "ray/common/task/task_spec.h" -#include "ray/protobuf/gcs.pb.h" +#include "src/ray/protobuf/gcs.pb.h" namespace ray { diff --git a/src/ray/gcs/pubsub/gcs_pub_sub.cc b/src/ray/gcs/pubsub/gcs_pub_sub.cc index 579296db9..62a28dea7 100644 --- a/src/ray/gcs/pubsub/gcs_pub_sub.cc +++ b/src/ray/gcs/pubsub/gcs_pub_sub.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "gcs_pub_sub.h" +#include "ray/gcs/pubsub/gcs_pub_sub.h" namespace ray { namespace gcs { diff --git a/src/ray/gcs/pubsub/gcs_pub_sub.h b/src/ray/gcs/pubsub/gcs_pub_sub.h index 43e327281..3338eb224 100644 --- a/src/ray/gcs/pubsub/gcs_pub_sub.h +++ b/src/ray/gcs/pubsub/gcs_pub_sub.h @@ -16,11 +16,10 @@ #include "absl/container/flat_hash_map.h" #include "absl/synchronization/mutex.h" - #include "ray/gcs/callback.h" #include "ray/gcs/redis_client.h" #include "ray/gcs/redis_context.h" -#include "ray/protobuf/gcs.pb.h" +#include "src/ray/protobuf/gcs.pb.h" namespace ray { namespace gcs { diff --git a/src/ray/gcs/redis_accessor.h b/src/ray/gcs/redis_accessor.h index b02b464bd..6f5f7278d 100644 --- a/src/ray/gcs/redis_accessor.h +++ b/src/ray/gcs/redis_accessor.h @@ -14,9 +14,8 @@ #pragma once -#include - #include "ray/common/id.h" +#include "ray/common/task/task_spec.h" #include "ray/gcs/accessor.h" #include "ray/gcs/callback.h" #include "ray/gcs/subscription_executor.h" diff --git a/src/ray/gcs/redis_context.h b/src/ray/gcs/redis_context.h index 7dca6f01f..c254ec408 100644 --- a/src/ray/gcs/redis_context.h +++ b/src/ray/gcs/redis_context.h @@ -23,10 +23,9 @@ #include "ray/common/id.h" #include "ray/common/status.h" -#include "ray/util/logging.h" - #include "ray/gcs/redis_async_context.h" -#include "ray/protobuf/gcs.pb.h" +#include "ray/util/logging.h" +#include "src/ray/protobuf/gcs.pb.h" struct redisContext; struct redisAsyncContext; diff --git a/src/ray/gcs/redis_module/chain_module.h b/src/ray/gcs/redis_module/chain_module.h index c0d92a656..574d2325e 100644 --- a/src/ray/gcs/redis_module/chain_module.h +++ b/src/ray/gcs/redis_module/chain_module.h @@ -16,7 +16,7 @@ #include -#include "redismodule.h" +#include "ray/gcs/redis_module/redismodule.h" // NOTE(zongheng): this duplicated declaration serves as forward-declaration // only. The implementation is supposed to be linked in from credis. In diff --git a/src/ray/gcs/redis_module/ray_redis_module.cc b/src/ray/gcs/redis_module/ray_redis_module.cc index 36bfa6900..755732cf6 100644 --- a/src/ray/gcs/redis_module/ray_redis_module.cc +++ b/src/ray/gcs/redis_module/ray_redis_module.cc @@ -13,15 +13,16 @@ // limitations under the License. #include + #include #include "ray/common/common_protocol.h" #include "ray/common/id.h" #include "ray/common/status.h" -#include "ray/protobuf/gcs.pb.h" +#include "ray/gcs/redis_module/redis_string.h" +#include "ray/gcs/redis_module/redismodule.h" #include "ray/util/logging.h" -#include "redis_string.h" -#include "redismodule.h" +#include "src/ray/protobuf/gcs.pb.h" using ray::Status; using ray::rpc::GcsChangeMode; @@ -38,7 +39,7 @@ using ray::rpc::TablePubsub; // All commands in this file that depend on "module" must be wrapped by "#if // RAY_USE_NEW_GCS", until we switch to this launch configuration as the // default. -#include "chain_module.h" +#include "ray/gcs/redis_module/chain_module.h" extern RedisChainModule module; #endif diff --git a/src/ray/gcs/redis_module/redis_string.h b/src/ray/gcs/redis_module/redis_string.h index 7185ed59e..3242fb056 100644 --- a/src/ray/gcs/redis_module/redis_string.h +++ b/src/ray/gcs/redis_module/redis_string.h @@ -19,7 +19,7 @@ #include #include -#include "redismodule.h" +#include "ray/gcs/redis_module/redismodule.h" /* Format a RedisModuleString. * diff --git a/src/ray/gcs/store_client/in_memory_store_client.h b/src/ray/gcs/store_client/in_memory_store_client.h index 00a9fe25e..a75ca0723 100644 --- a/src/ray/gcs/store_client/in_memory_store_client.h +++ b/src/ray/gcs/store_client/in_memory_store_client.h @@ -17,7 +17,7 @@ #include "absl/container/flat_hash_map.h" #include "absl/synchronization/mutex.h" #include "ray/gcs/store_client/store_client.h" -#include "ray/protobuf/gcs.pb.h" +#include "src/ray/protobuf/gcs.pb.h" namespace ray { diff --git a/src/ray/gcs/store_client/redis_store_client.h b/src/ray/gcs/store_client/redis_store_client.h index 2a25b369f..ccf606cba 100644 --- a/src/ray/gcs/store_client/redis_store_client.h +++ b/src/ray/gcs/store_client/redis_store_client.h @@ -18,7 +18,7 @@ #include "ray/gcs/redis_client.h" #include "ray/gcs/redis_context.h" #include "ray/gcs/store_client/store_client.h" -#include "ray/protobuf/gcs.pb.h" +#include "src/ray/protobuf/gcs.pb.h" namespace ray { diff --git a/src/ray/gcs/store_client/store_client.h b/src/ray/gcs/store_client/store_client.h index a2dfd07fe..38e6e8ebd 100644 --- a/src/ray/gcs/store_client/store_client.h +++ b/src/ray/gcs/store_client/store_client.h @@ -16,12 +16,13 @@ #include #include + #include "ray/common/id.h" #include "ray/common/status.h" #include "ray/gcs/callback.h" -#include "ray/protobuf/gcs.pb.h" #include "ray/util/io_service_pool.h" #include "ray/util/logging.h" +#include "src/ray/protobuf/gcs.pb.h" namespace ray { diff --git a/src/ray/gcs/tables.h b/src/ray/gcs/tables.h index 90cb45fbf..b44653d2d 100644 --- a/src/ray/gcs/tables.h +++ b/src/ray/gcs/tables.h @@ -25,8 +25,8 @@ #include "ray/gcs/callback.h" #include "ray/gcs/entry_change_notification.h" #include "ray/gcs/redis_context.h" -#include "ray/protobuf/gcs.pb.h" #include "ray/util/logging.h" +#include "src/ray/protobuf/gcs.pb.h" struct redisAsyncContext; diff --git a/src/ray/gcs/test/gcs_test_util.h b/src/ray/gcs/test/gcs_test_util.h index c60c1200e..5ade2bb6e 100644 --- a/src/ray/gcs/test/gcs_test_util.h +++ b/src/ray/gcs/test/gcs_test_util.h @@ -18,12 +18,12 @@ #include #include "gmock/gmock.h" +#include "ray/common/placement_group.h" #include "ray/common/task/task.h" #include "ray/common/task/task_util.h" #include "ray/common/test_util.h" -#include "ray/protobuf/gcs_service.grpc.pb.h" #include "ray/util/asio_util.h" -#include "src/ray/common/placement_group.h" +#include "src/ray/protobuf/gcs_service.grpc.pb.h" namespace ray { diff --git a/src/ray/raylet/actor_registration.h b/src/ray/raylet/actor_registration.h index 0e156f0fd..34f88aaea 100644 --- a/src/ray/raylet/actor_registration.h +++ b/src/ray/raylet/actor_registration.h @@ -18,7 +18,7 @@ #include "ray/common/id.h" #include "ray/common/task/task.h" -#include "ray/protobuf/gcs.pb.h" +#include "src/ray/protobuf/gcs.pb.h" namespace ray { diff --git a/src/ray/raylet/lineage_cache.cc b/src/ray/raylet/lineage_cache.cc index 6730d9884..c48ea4790 100644 --- a/src/ray/raylet/lineage_cache.cc +++ b/src/ray/raylet/lineage_cache.cc @@ -12,8 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "lineage_cache.h" +#include "ray/raylet/lineage_cache.h" + #include + #include "ray/gcs/redis_gcs_client.h" #include "ray/stats/stats.h" diff --git a/src/ray/raylet/raylet.cc b/src/ray/raylet/raylet.cc index 4db107806..34995575a 100644 --- a/src/ray/raylet/raylet.cc +++ b/src/ray/raylet/raylet.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "raylet.h" +#include "ray/raylet/raylet.h" #include #include diff --git a/src/ray/raylet/reconstruction_policy.cc b/src/ray/raylet/reconstruction_policy.cc index ae488864a..b8a214939 100644 --- a/src/ray/raylet/reconstruction_policy.cc +++ b/src/ray/raylet/reconstruction_policy.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "reconstruction_policy.h" +#include "ray/raylet/reconstruction_policy.h" #include "ray/stats/stats.h" diff --git a/src/ray/raylet/scheduling/cluster_resource_scheduler.cc b/src/ray/raylet/scheduling/cluster_resource_scheduler.cc index 58e13c1d2..87d43ca1b 100644 --- a/src/ray/raylet/scheduling/cluster_resource_scheduler.cc +++ b/src/ray/raylet/scheduling/cluster_resource_scheduler.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "cluster_resource_scheduler.h" +#include "ray/raylet/scheduling/cluster_resource_scheduler.h" std::string VectorToString(const std::vector &vector) { std::stringstream buffer; diff --git a/src/ray/raylet/scheduling/cluster_task_manager.cc b/src/ray/raylet/scheduling/cluster_task_manager.cc index 932608dea..1ce8bb689 100644 --- a/src/ray/raylet/scheduling/cluster_task_manager.cc +++ b/src/ray/raylet/scheduling/cluster_task_manager.cc @@ -1,4 +1,4 @@ -#include "cluster_task_manager.h" +#include "ray/raylet/scheduling/cluster_task_manager.h" #include "ray/util/logging.h" diff --git a/src/ray/raylet/scheduling/fixed_point.cc b/src/ray/raylet/scheduling/fixed_point.cc index 24420ada3..d6f109b3b 100644 --- a/src/ray/raylet/scheduling/fixed_point.cc +++ b/src/ray/raylet/scheduling/fixed_point.cc @@ -1,4 +1,4 @@ -#include "fixed_point.h" +#include "ray/raylet/scheduling/fixed_point.h" #include diff --git a/src/ray/raylet/scheduling/scheduling_ids.cc b/src/ray/raylet/scheduling/scheduling_ids.cc index 3cf1a0fc5..345b854ee 100644 --- a/src/ray/raylet/scheduling/scheduling_ids.cc +++ b/src/ray/raylet/scheduling/scheduling_ids.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "scheduling_ids.h" +#include "ray/raylet/scheduling/scheduling_ids.h" int64_t StringIdMap::Get(const std::string &string_id) { auto it = string_to_int_.find(string_id); diff --git a/src/ray/raylet/scheduling_policy.cc b/src/ray/raylet/scheduling_policy.cc index 21e0ab608..775d57ff1 100644 --- a/src/ray/raylet/scheduling_policy.cc +++ b/src/ray/raylet/scheduling_policy.cc @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "ray/raylet/scheduling_policy.h" + #include #include #include -#include "scheduling_policy.h" - #include "ray/util/logging.h" namespace ray { diff --git a/src/ray/raylet/scheduling_queue.cc b/src/ray/raylet/scheduling_queue.cc index 934f92a93..77224e6b8 100644 --- a/src/ray/raylet/scheduling_queue.cc +++ b/src/ray/raylet/scheduling_queue.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "scheduling_queue.h" +#include "ray/raylet/scheduling_queue.h" #include diff --git a/src/ray/raylet/task_dependency_manager.cc b/src/ray/raylet/task_dependency_manager.cc index 0a1fe7fc2..8cf51631c 100644 --- a/src/ray/raylet/task_dependency_manager.cc +++ b/src/ray/raylet/task_dependency_manager.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "task_dependency_manager.h" +#include "ray/raylet/task_dependency_manager.h" #include "absl/time/clock.h" #include "ray/stats/stats.h" diff --git a/src/ray/raylet/worker.cc b/src/ray/raylet/worker.cc index 432d2ce80..2f744b6d6 100644 --- a/src/ray/raylet/worker.cc +++ b/src/ray/raylet/worker.cc @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "worker.h" +#include "ray/raylet/worker.h" #include -#include "ray/protobuf/core_worker.grpc.pb.h" -#include "ray/protobuf/core_worker.pb.h" #include "ray/raylet/format/node_manager_generated.h" #include "ray/raylet/raylet.h" +#include "src/ray/protobuf/core_worker.grpc.pb.h" +#include "src/ray/protobuf/core_worker.pb.h" namespace ray { diff --git a/src/ray/raylet_client/raylet_client.cc b/src/ray/raylet_client/raylet_client.cc index ec0b390be..2a2938a06 100644 --- a/src/ray/raylet_client/raylet_client.cc +++ b/src/ray/raylet_client/raylet_client.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "raylet_client.h" +#include "ray/raylet_client/raylet_client.h" #include "ray/common/client_connection.h" #include "ray/common/common_protocol.h" diff --git a/src/ray/raylet_client/raylet_client.h b/src/ray/raylet_client/raylet_client.h index d2c007540..bda70aa1b 100644 --- a/src/ray/raylet_client/raylet_client.h +++ b/src/ray/raylet_client/raylet_client.h @@ -14,8 +14,6 @@ #pragma once -#include - #include #include #include @@ -25,6 +23,7 @@ #include "ray/common/status.h" #include "ray/common/task/task_spec.h" #include "ray/rpc/node_manager/node_manager_client.h" +#include "src/ray/protobuf/gcs.pb.h" using ray::ActorCheckpointID; using ray::ActorID; diff --git a/src/ray/rpc/gcs_server/gcs_rpc_client.h b/src/ray/rpc/gcs_server/gcs_rpc_client.h index fcf5f4c7e..f671c0f1c 100644 --- a/src/ray/rpc/gcs_server/gcs_rpc_client.h +++ b/src/ray/rpc/gcs_server/gcs_rpc_client.h @@ -17,8 +17,8 @@ #include #include "ray/common/network_util.h" -#include "ray/protobuf/gcs_service.grpc.pb.h" #include "ray/rpc/grpc_client.h" +#include "src/ray/protobuf/gcs_service.grpc.pb.h" namespace ray { namespace rpc { diff --git a/src/ray/rpc/gcs_server/gcs_rpc_server.h b/src/ray/rpc/gcs_server/gcs_rpc_server.h index 3b5d1a5f3..4d460df21 100644 --- a/src/ray/rpc/gcs_server/gcs_rpc_server.h +++ b/src/ray/rpc/gcs_server/gcs_rpc_server.h @@ -14,9 +14,9 @@ #pragma once -#include "ray/protobuf/gcs_service.grpc.pb.h" #include "ray/rpc/grpc_server.h" #include "ray/rpc/server_call.h" +#include "src/ray/protobuf/gcs_service.grpc.pb.h" namespace ray { namespace rpc { diff --git a/src/ray/rpc/grpc_server.h b/src/ray/rpc/grpc_server.h index 9a1d74454..158a3d78d 100644 --- a/src/ray/rpc/grpc_server.h +++ b/src/ray/rpc/grpc_server.h @@ -133,7 +133,7 @@ class GrpcService { : main_service_(main_service) {} /// Destruct this gRPC service. - ~GrpcService() = default; + virtual ~GrpcService() = default; protected: /// Return the underlying grpc::Service object for this class. diff --git a/src/ray/rpc/metrics_agent_client.h b/src/ray/rpc/metrics_agent_client.h index 35eab574f..09cdd4ee1 100644 --- a/src/ray/rpc/metrics_agent_client.h +++ b/src/ray/rpc/metrics_agent_client.h @@ -19,10 +19,10 @@ #include #include "ray/common/status.h" -#include "ray/protobuf/reporter.grpc.pb.h" -#include "ray/protobuf/reporter.pb.h" #include "ray/rpc/grpc_client.h" #include "ray/util/logging.h" +#include "src/ray/protobuf/reporter.grpc.pb.h" +#include "src/ray/protobuf/reporter.pb.h" namespace ray { namespace rpc { @@ -36,8 +36,7 @@ class MetricsAgentClient { /// \param[in] port Port of the metrics agent server. /// \param[in] client_call_manager The `ClientCallManager` used for managing requests. MetricsAgentClient(const std::string &address, const int port, - ClientCallManager &client_call_manager) - : client_call_manager_(client_call_manager) { + ClientCallManager &client_call_manager) { grpc_client_ = std::unique_ptr>( new GrpcClient(address, port, client_call_manager)); }; @@ -51,9 +50,6 @@ class MetricsAgentClient { private: /// The RPC client. std::unique_ptr> grpc_client_; - - /// The `ClientCallManager` used for managing requests. - ClientCallManager &client_call_manager_; }; } // namespace rpc diff --git a/src/ray/rpc/node_manager/node_manager_client.h b/src/ray/rpc/node_manager/node_manager_client.h index 7dc3e42f1..8f2c26b19 100644 --- a/src/ray/rpc/node_manager/node_manager_client.h +++ b/src/ray/rpc/node_manager/node_manager_client.h @@ -19,10 +19,10 @@ #include #include "ray/common/status.h" -#include "ray/protobuf/node_manager.grpc.pb.h" -#include "ray/protobuf/node_manager.pb.h" #include "ray/rpc/grpc_client.h" #include "ray/util/logging.h" +#include "src/ray/protobuf/node_manager.grpc.pb.h" +#include "src/ray/protobuf/node_manager.pb.h" namespace ray { namespace rpc { @@ -36,8 +36,7 @@ class NodeManagerClient { /// \param[in] port Port of the node manager server. /// \param[in] client_call_manager The `ClientCallManager` used for managing requests. NodeManagerClient(const std::string &address, const int port, - ClientCallManager &client_call_manager) - : client_call_manager_(client_call_manager) { + ClientCallManager &client_call_manager) { grpc_client_ = std::unique_ptr>( new GrpcClient(address, port, client_call_manager)); }; @@ -59,9 +58,6 @@ class NodeManagerClient { private: /// The RPC client. std::unique_ptr> grpc_client_; - - /// The `ClientCallManager` used for managing requests. - ClientCallManager &client_call_manager_; }; /// Client used by workers for communicating with a node manager server. @@ -111,17 +107,13 @@ class NodeManagerWorkerClient /// \param[in] port Port of the node manager server. /// \param[in] client_call_manager The `ClientCallManager` used for managing requests. NodeManagerWorkerClient(const std::string &address, const int port, - ClientCallManager &client_call_manager) - : client_call_manager_(client_call_manager) { + ClientCallManager &client_call_manager) { grpc_client_ = std::unique_ptr>( new GrpcClient(address, port, client_call_manager)); }; /// The RPC client. std::unique_ptr> grpc_client_; - - /// The `ClientCallManager` used for managing requests. - ClientCallManager &client_call_manager_; }; } // namespace rpc diff --git a/src/ray/rpc/node_manager/node_manager_server.h b/src/ray/rpc/node_manager/node_manager_server.h index b8e1cf965..b3896de07 100644 --- a/src/ray/rpc/node_manager/node_manager_server.h +++ b/src/ray/rpc/node_manager/node_manager_server.h @@ -14,10 +14,10 @@ #pragma once -#include "ray/protobuf/node_manager.grpc.pb.h" -#include "ray/protobuf/node_manager.pb.h" #include "ray/rpc/grpc_server.h" #include "ray/rpc/server_call.h" +#include "src/ray/protobuf/node_manager.grpc.pb.h" +#include "src/ray/protobuf/node_manager.pb.h" namespace ray { namespace rpc { diff --git a/src/ray/rpc/object_manager/object_manager_client.h b/src/ray/rpc/object_manager/object_manager_client.h index c601d50d8..266be927b 100644 --- a/src/ray/rpc/object_manager/object_manager_client.h +++ b/src/ray/rpc/object_manager/object_manager_client.h @@ -21,10 +21,10 @@ #include #include "ray/common/status.h" -#include "ray/protobuf/object_manager.grpc.pb.h" -#include "ray/protobuf/object_manager.pb.h" #include "ray/rpc/grpc_client.h" #include "ray/util/logging.h" +#include "src/ray/protobuf/object_manager.grpc.pb.h" +#include "src/ray/protobuf/object_manager.pb.h" namespace ray { namespace rpc { @@ -39,7 +39,7 @@ class ObjectManagerClient { /// \param[in] client_call_manager The `ClientCallManager` used for managing requests. ObjectManagerClient(const std::string &address, const int port, ClientCallManager &client_call_manager, int num_connections = 4) - : client_call_manager_(client_call_manager), num_connections_(num_connections) { + : num_connections_(num_connections) { push_rr_index_ = rand() % num_connections_; pull_rr_index_ = rand() % num_connections_; freeobjects_rr_index_ = rand() % num_connections_; @@ -85,9 +85,6 @@ class ObjectManagerClient { /// The RPC clients. std::vector>> grpc_clients_; - - /// The `ClientCallManager` used for managing requests. - ClientCallManager &client_call_manager_; }; } // namespace rpc diff --git a/src/ray/rpc/object_manager/object_manager_server.h b/src/ray/rpc/object_manager/object_manager_server.h index 834f313c2..2abacfeb5 100644 --- a/src/ray/rpc/object_manager/object_manager_server.h +++ b/src/ray/rpc/object_manager/object_manager_server.h @@ -14,10 +14,10 @@ #pragma once -#include "ray/protobuf/object_manager.grpc.pb.h" -#include "ray/protobuf/object_manager.pb.h" #include "ray/rpc/grpc_server.h" #include "ray/rpc/server_call.h" +#include "src/ray/protobuf/object_manager.grpc.pb.h" +#include "src/ray/protobuf/object_manager.pb.h" namespace ray { namespace rpc { diff --git a/src/ray/rpc/worker/core_worker_client.h b/src/ray/rpc/worker/core_worker_client.h index 9cc235518..c3dd95658 100644 --- a/src/ray/rpc/worker/core_worker_client.h +++ b/src/ray/rpc/worker/core_worker_client.h @@ -14,6 +14,12 @@ #pragma once +#ifdef __clang__ +// TODO(mehrdadn): Remove this when the warnings are addressed +#pragma clang diagnostic push +#pragma clang diagnostic warning "-Wunused-result" +#endif + #include #include @@ -24,10 +30,10 @@ #include "absl/base/thread_annotations.h" #include "absl/hash/hash.h" #include "ray/common/status.h" -#include "ray/protobuf/core_worker.grpc.pb.h" -#include "ray/protobuf/core_worker.pb.h" #include "ray/rpc/grpc_client.h" #include "ray/util/logging.h" +#include "src/ray/protobuf/core_worker.grpc.pb.h" +#include "src/ray/protobuf/core_worker.pb.h" namespace ray { namespace rpc { @@ -213,7 +219,7 @@ class CoreWorkerClient : public std::enable_shared_from_this, /// \param[in] port Port of the worker server. /// \param[in] client_call_manager The `ClientCallManager` used for managing requests. CoreWorkerClient(const rpc::Address &address, ClientCallManager &client_call_manager) - : addr_(address), client_call_manager_(client_call_manager) { + : addr_(address) { grpc_client_ = std::unique_ptr>(new GrpcClient( addr_.ip_address(), addr_.port(), client_call_manager)); @@ -258,7 +264,7 @@ class CoreWorkerClient : public std::enable_shared_from_this, } { - std::lock_guard lock(mutex_); + absl::MutexLock lock(&mutex_); send_queue_.push_back(std::make_pair(std::move(request), callback)); } SendRequests(); @@ -278,7 +284,7 @@ class CoreWorkerClient : public std::enable_shared_from_this, /// sent at once. This prevents the server scheduling queue from being overwhelmed. /// See direct_actor.proto for a description of the ordering protocol. void SendRequests() { - std::lock_guard lock(mutex_); + absl::MutexLock lock(&mutex_); auto this_ptr = this->shared_from_this(); while (!send_queue_.empty() && rpc_bytes_in_flight_ < kMaxBytesInFlight) { @@ -295,7 +301,7 @@ class CoreWorkerClient : public std::enable_shared_from_this, auto rpc_callback = [this, this_ptr, seq_no, task_size, callback]( Status status, const rpc::PushTaskReply &reply) { { - std::lock_guard lock(mutex_); + absl::MutexLock lock(&mutex_); if (seq_no > max_finished_seq_no_) { max_finished_seq_no_ = seq_no; } @@ -316,7 +322,7 @@ class CoreWorkerClient : public std::enable_shared_from_this, private: /// Protects against unsafe concurrent access from the callback thread. - std::mutex mutex_; + absl::Mutex mutex_; /// Address of the remote worker. rpc::Address addr_; @@ -324,9 +330,6 @@ class CoreWorkerClient : public std::enable_shared_from_this, /// The RPC client. std::unique_ptr> grpc_client_; - /// The `ClientCallManager` used for managing requests. - ClientCallManager &client_call_manager_; - /// Queue of requests to send. std::deque, ClientCallback>> send_queue_ GUARDED_BY(mutex_); @@ -340,3 +343,7 @@ class CoreWorkerClient : public std::enable_shared_from_this, } // namespace rpc } // namespace ray + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif diff --git a/src/ray/rpc/worker/core_worker_server.h b/src/ray/rpc/worker/core_worker_server.h index a6da78276..abc3dfa23 100644 --- a/src/ray/rpc/worker/core_worker_server.h +++ b/src/ray/rpc/worker/core_worker_server.h @@ -14,10 +14,10 @@ #pragma once -#include "ray/protobuf/core_worker.grpc.pb.h" -#include "ray/protobuf/core_worker.pb.h" #include "ray/rpc/grpc_server.h" #include "ray/rpc/server_call.h" +#include "src/ray/protobuf/core_worker.grpc.pb.h" +#include "src/ray/protobuf/core_worker.pb.h" namespace ray { @@ -59,6 +59,7 @@ namespace rpc { /// Interface of the `CoreWorkerServiceHandler`, see `src/ray/protobuf/core_worker.proto`. class CoreWorkerServiceHandler { public: + virtual ~CoreWorkerServiceHandler() {} /// Handlers. For all of the following handlers, the implementations can /// handle the request asynchronously. When handling is done, the /// `send_reply_callback` should be called. See diff --git a/src/ray/stats/metric.h b/src/ray/stats/metric.h index 751bfd9b6..876526d48 100644 --- a/src/ray/stats/metric.h +++ b/src/ray/stats/metric.h @@ -20,7 +20,6 @@ #include "opencensus/stats/stats.h" #include "opencensus/stats/stats_exporter.h" #include "opencensus/tags/tag_key.h" - #include "ray/util/logging.h" namespace ray { @@ -28,7 +27,7 @@ namespace ray { namespace stats { /// Include tag_defs.h to define tag items -#include "tag_defs.h" +#include "ray/stats/tag_defs.h" class StatsConfig final { public: @@ -78,11 +77,11 @@ class Metric { public: Metric(const std::string &name, const std::string &description, const std::string &unit, const std::vector &tag_keys = {}) - : measure_(nullptr), - name_(name), + : name_(name), description_(description), unit_(unit), - tag_keys_(tag_keys){}; + tag_keys_(tag_keys), + measure_(nullptr) {} virtual ~Metric() { opencensus::stats::StatsExporter::RemoveView(name_); } diff --git a/src/ray/stats/stats.h b/src/ray/stats/stats.h index c0340d596..d1de95902 100644 --- a/src/ray/stats/stats.h +++ b/src/ray/stats/stats.h @@ -23,7 +23,6 @@ #include "opencensus/stats/internal/delta_producer.h" #include "opencensus/stats/stats.h" #include "opencensus/tags/tag_key.h" - #include "ray/common/ray_config.h" #include "ray/stats/metric.h" #include "ray/stats/metric_exporter.h" @@ -37,10 +36,10 @@ namespace stats { #include /// Include metric_defs.h to define measure items. -#include "metric_defs.h" +#include "ray/stats/metric_defs.h" /// Initialize stats. -static void Init( +static inline void Init( const TagsType &global_tags, const int metrics_agent_port, boost::asio::io_service &io_service, std::shared_ptr exporter_to_use = nullptr, diff --git a/src/ray/thirdparty/sha256.c b/src/ray/thirdparty/sha256.c index 8436e9e6e..0d8077964 100644 --- a/src/ray/thirdparty/sha256.c +++ b/src/ray/thirdparty/sha256.c @@ -15,7 +15,7 @@ /*************************** HEADER FILES ***************************/ #include #include -#include "sha256.h" +#include "ray/thirdparty/sha256.h" /****************************** MACROS ******************************/ #define ROTLEFT(a,b) (((a) << (b)) | ((a) >> (32-(b)))) diff --git a/src/ray/util/filesystem.h b/src/ray/util/filesystem.h index 4de558f29..48467f0db 100644 --- a/src/ray/util/filesystem.h +++ b/src/ray/util/filesystem.h @@ -9,10 +9,10 @@ namespace ray { /// \return The portable directory separator (slash on all OSes). -static char GetAltDirSep() { return '/'; } +static inline char GetAltDirSep() { return '/'; } /// \return The platform directory separator (backslash on Windows, slash on other OSes). -static char GetDirSep() { +static inline char GetDirSep() { char result; #ifdef _WIN32 result = '\\'; @@ -23,7 +23,7 @@ static char GetDirSep() { } /// \return The platform PATH separator (semicolon on Windows, colon on other OSes). -static char GetPathSep() { +static inline char GetPathSep() { char result; #ifdef _WIN32 result = ';'; @@ -48,7 +48,7 @@ std::string GetRayTempDir(); std::string GetUserTempDir(); /// \return Whether or not the given character is a directory separator on this platform. -static bool IsDirSep(char ch) { +static inline bool IsDirSep(char ch) { bool result = ch == GetDirSep(); #ifdef _WIN32 result |= ch == GetAltDirSep(); @@ -57,7 +57,7 @@ static bool IsDirSep(char ch) { } /// \return Whether or not the given character is a PATH separator on this platform. -static bool IsPathSep(char ch) { return ch == GetPathSep(); } +static inline bool IsPathSep(char ch) { return ch == GetPathSep(); } /// \return The result of joining multiple path components. template diff --git a/src/ray/util/util.h b/src/ray/util/util.h index 56327b0cd..2f0546ee7 100644 --- a/src/ray/util/util.h +++ b/src/ray/util/util.h @@ -161,7 +161,7 @@ void FillRandom(T *data) { std::lock_guard lock(random_engine_mutex); static std::mt19937 generator = randomly_seeded_mersenne_twister(); std::uniform_int_distribution dist(0, std::numeric_limits::max()); - for (int i = 0; i < data->size(); i++) { + for (size_t i = 0; i < data->size(); i++) { (*data)[i] = static_cast(dist(generator)); } } diff --git a/streaming/BUILD.bazel b/streaming/BUILD.bazel index 816a47813..c7744528d 100644 --- a/streaming/BUILD.bazel +++ b/streaming/BUILD.bazel @@ -1,24 +1,26 @@ # Bazel build # C/C++ documentation: https://docs.bazel.build/versions/master/be/c-cpp.html -load("@bazel_skylib//rules:copy_file.bzl", "copy_file") load("@rules_proto_grpc//python:defs.bzl", "python_proto_compile") load("//bazel:ray.bzl", "COPTS", "copy_to_workspace") proto_library( name = "streaming_proto", srcs = ["src/protobuf/streaming.proto"], + strip_import_prefix = "src", visibility = ["//visibility:public"], ) proto_library( name = "streaming_queue_proto", srcs = ["src/protobuf/streaming_queue.proto"], + strip_import_prefix = "src", ) proto_library( name = "remote_call_proto", srcs = ["src/protobuf/remote_call.proto"], + strip_import_prefix = "src", visibility = ["//visibility:public"], deps = ["streaming_proto"], ) @@ -68,9 +70,7 @@ cc_library( "src/util/*.h", ]), copts = COPTS, - includes = [ - "src", - ], + strip_include_prefix = "src", visibility = ["//visibility:public"], deps = [ "ray_util.so", @@ -88,6 +88,7 @@ cc_library( "src/config/*.h", ]), copts = COPTS, + strip_include_prefix = "src", deps = [ "ray_common.so", ":streaming_cc_proto", @@ -104,6 +105,7 @@ cc_library( "src/message/*.h", ]), copts = COPTS, + strip_include_prefix = "src", deps = [ "ray_common.so", ":streaming_config", @@ -120,6 +122,7 @@ cc_library( "src/queue/*.h", ]), copts = COPTS, + strip_include_prefix = "src", deps = [ "ray_common.so", "ray_util.so", @@ -151,7 +154,7 @@ cc_library( "src/test/*.h", ]), copts = COPTS, - includes = ["src"], + strip_include_prefix = "src", visibility = ["//visibility:public"], deps = [ "ray_common.so", @@ -178,9 +181,6 @@ cc_binary( "src/test/mock_actor.cc", ], copts = COPTS, - includes = [ - "streaming/src/test", - ], deps = test_common_deps, ) @@ -200,9 +200,6 @@ cc_test( "src/test/ring_buffer_tests.cc", ], copts = COPTS, - includes = [ - "streaming/src/test", - ], deps = test_common_deps, ) @@ -238,17 +235,18 @@ cc_test( srcs = [ "src/test/event_service_tests.cc", ], + copts = COPTS, deps = test_common_deps, ) python_proto_compile( name = "streaming_py_proto", - deps = ["//streaming:streaming_proto"], + deps = [":streaming_proto"], ) python_proto_compile( name = "remote_call_py_proto", - deps = ["//streaming:remote_call_proto"], + deps = [":remote_call_proto"], ) filegroup( @@ -284,37 +282,6 @@ genrule( visibility = ["//visibility:public"], ) -# Streaming java -copy_file( - name = "copy_jni_h", - src = "@bazel_tools//tools/jdk:jni_header", - out = "jni.h", -) - -copy_file( - name = "copy_jni_md_h", - src = select({ - "@bazel_tools//src/conditions:windows": "@bazel_tools//tools/jdk:jni_md_header-windows", - "@bazel_tools//src/conditions:darwin": "@bazel_tools//tools/jdk:jni_md_header-darwin", - "//conditions:default": "@bazel_tools//tools/jdk:jni_md_header-linux", - }), - out = "jni_md.h", - visibility = ["//visibility:public"], -) - -cc_library( - name = "jni", - hdrs = [ - ":jni.h", - ":jni_md.h", - ], - copts = COPTS, - includes = [ - ".", # needed for `include ` - ], - visibility = ["//visibility:public"], -) - cc_binary( name = "libstreaming_java.so", srcs = glob([ @@ -322,14 +289,11 @@ cc_binary( "src/lib/java/*.h", ]), copts = COPTS, - includes = [ - "src", - ], linkshared = 1, linkstatic = 1, visibility = ["//visibility:public"], deps = [ - ":jni", ":streaming_lib", + "@bazel_tools//tools/jdk:jni", ], ) diff --git a/streaming/src/channel.cc b/streaming/src/channel.cc index cbca454f1..a5652a7c7 100644 --- a/streaming/src/channel.cc +++ b/streaming/src/channel.cc @@ -1,4 +1,5 @@ #include "channel.h" + #include namespace ray { namespace streaming { diff --git a/streaming/src/config/streaming_config.cc b/streaming/src/config/streaming_config.cc index 90ad2e62c..da39eb960 100644 --- a/streaming/src/config/streaming_config.cc +++ b/streaming/src/config/streaming_config.cc @@ -1,6 +1,7 @@ +#include "config/streaming_config.h" + #include -#include "streaming_config.h" #include "util/streaming_logging.h" namespace ray { diff --git a/streaming/src/data_reader.cc b/streaming/src/data_reader.cc index 4a96b18d6..b1a98f8c0 100644 --- a/streaming/src/data_reader.cc +++ b/streaming/src/data_reader.cc @@ -1,3 +1,5 @@ +#include "data_reader.h" + #include #include #include @@ -5,12 +7,10 @@ #include #include +#include "message/message_bundle.h" #include "ray/util/logging.h" #include "ray/util/util.h" -#include "data_reader.h" -#include "message/message_bundle.h" - namespace ray { namespace streaming { diff --git a/streaming/src/data_writer.cc b/streaming/src/data_writer.cc index 6992b23e7..3c4ee64c4 100644 --- a/streaming/src/data_writer.cc +++ b/streaming/src/data_writer.cc @@ -1,15 +1,14 @@ -#include - -#include +#include "data_writer.h" #include #include + #include #include #include +#include #include -#include "data_writer.h" #include "util/streaming_util.h" namespace ray { diff --git a/streaming/src/event_service.cc b/streaming/src/event_service.cc index a6dd75744..926a4039b 100644 --- a/streaming/src/event_service.cc +++ b/streaming/src/event_service.cc @@ -1,8 +1,8 @@ +#include "event_service.h" + #include #include -#include "event_service.h" - namespace ray { namespace streaming { @@ -61,7 +61,8 @@ void EventQueue::WaitFor(std::unique_lock &lock) { // To avoid deadlock when EventQueue is empty but is_active is changed in other // thread, Event queue should awaken this condtion variable and check it again. while (is_active_ && Empty()) { - if (!no_empty_cv_.wait_for(lock, std::chrono::milliseconds(kConditionTimeoutMs), + int timeout = kConditionTimeoutMs; // This avoids const & to static (linking error) + if (!no_empty_cv_.wait_for(lock, std::chrono::milliseconds(timeout), [this]() { return !is_active_ || !Empty(); })) { STREAMING_LOG(DEBUG) << "No empty condition variable wait timeout." << " Empty => " << Empty() << ", is active " << is_active_; diff --git a/streaming/src/lib/java/io_ray_streaming_runtime_transfer_ChannelId.cc b/streaming/src/lib/java/io_ray_streaming_runtime_transfer_ChannelId.cc index 1666daf54..891d95e81 100644 --- a/streaming/src/lib/java/io_ray_streaming_runtime_transfer_ChannelId.cc +++ b/streaming/src/lib/java/io_ray_streaming_runtime_transfer_ChannelId.cc @@ -1,5 +1,7 @@ #include "io_ray_streaming_runtime_transfer_ChannelId.h" + #include "streaming_jni_common.h" + using namespace ray::streaming; JNIEXPORT jlong JNICALL Java_io_ray_streaming_runtime_transfer_ChannelId_createNativeId( diff --git a/streaming/src/lib/java/io_ray_streaming_runtime_transfer_DataReader.cc b/streaming/src/lib/java/io_ray_streaming_runtime_transfer_DataReader.cc index 260b50515..6431127df 100644 --- a/streaming/src/lib/java/io_ray_streaming_runtime_transfer_DataReader.cc +++ b/streaming/src/lib/java/io_ray_streaming_runtime_transfer_DataReader.cc @@ -1,4 +1,5 @@ #include "io_ray_streaming_runtime_transfer_DataReader.h" + #include #include "data_reader.h" #include "runtime_context.h" diff --git a/streaming/src/lib/java/io_ray_streaming_runtime_transfer_DataWriter.cc b/streaming/src/lib/java/io_ray_streaming_runtime_transfer_DataWriter.cc index f7aafc5d4..4c2fa8422 100644 --- a/streaming/src/lib/java/io_ray_streaming_runtime_transfer_DataWriter.cc +++ b/streaming/src/lib/java/io_ray_streaming_runtime_transfer_DataWriter.cc @@ -1,4 +1,5 @@ #include "io_ray_streaming_runtime_transfer_DataWriter.h" + #include "config/streaming_config.h" #include "data_writer.h" #include "streaming_jni_common.h" diff --git a/streaming/src/lib/java/io_ray_streaming_runtime_transfer_TransferHandler.cc b/streaming/src/lib/java/io_ray_streaming_runtime_transfer_TransferHandler.cc index 98acc36a1..39c8f539d 100644 --- a/streaming/src/lib/java/io_ray_streaming_runtime_transfer_TransferHandler.cc +++ b/streaming/src/lib/java/io_ray_streaming_runtime_transfer_TransferHandler.cc @@ -1,4 +1,5 @@ #include "io_ray_streaming_runtime_transfer_TransferHandler.h" + #include "queue/queue_client.h" #include "streaming_jni_common.h" diff --git a/streaming/src/message/message.cc b/streaming/src/message/message.cc index ca0de652b..cd44f76ee 100644 --- a/streaming/src/message/message.cc +++ b/streaming/src/message/message.cc @@ -1,9 +1,9 @@ -#include +#include "message/message.h" #include #include +#include -#include "message.h" #include "ray/common/status.h" #include "util/streaming_logging.h" diff --git a/streaming/src/message/message_bundle.cc b/streaming/src/message/message_bundle.cc index d9b92c203..13057c428 100644 --- a/streaming/src/message/message_bundle.cc +++ b/streaming/src/message/message_bundle.cc @@ -1,10 +1,10 @@ +#include "message/message_bundle.h" + #include #include -#include "ray/common/status.h" - #include "config/streaming_config.h" -#include "message_bundle.h" +#include "ray/common/status.h" #include "util/streaming_logging.h" namespace ray { diff --git a/streaming/src/message/message_bundle.h b/streaming/src/message/message_bundle.h index 6052a56a4..a5f8687ca 100644 --- a/streaming/src/message/message_bundle.h +++ b/streaming/src/message/message_bundle.h @@ -2,9 +2,11 @@ #include #include +#include #include +#include -#include "message.h" +#include "message/message.h" namespace ray { namespace streaming { diff --git a/streaming/src/protobuf/remote_call.proto b/streaming/src/protobuf/remote_call.proto index 7e3a9fea8..5e9e2a754 100644 --- a/streaming/src/protobuf/remote_call.proto +++ b/streaming/src/protobuf/remote_call.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ray.streaming.proto; -import "streaming/src/protobuf/streaming.proto"; +import "protobuf/streaming.proto"; option java_package = "io.ray.streaming.runtime.generated"; diff --git a/streaming/src/queue/message.cc b/streaming/src/queue/message.cc index 9c3f4fa4b..2cee9d203 100644 --- a/streaming/src/queue/message.cc +++ b/streaming/src/queue/message.cc @@ -1,4 +1,4 @@ -#include "message.h" +#include "queue/message.h" namespace ray { namespace streaming { diff --git a/streaming/src/queue/queue.cc b/streaming/src/queue/queue.cc index abd63723b..3f9e60585 100644 --- a/streaming/src/queue/queue.cc +++ b/streaming/src/queue/queue.cc @@ -1,7 +1,9 @@ -#include "queue.h" +#include "queue/queue.h" + #include #include -#include "queue_handler.h" + +#include "queue/queue_handler.h" #include "util/streaming_util.h" namespace ray { diff --git a/streaming/src/queue/queue.h b/streaming/src/queue/queue.h index f27472a53..f5625d0e2 100644 --- a/streaming/src/queue/queue.h +++ b/streaming/src/queue/queue.h @@ -4,13 +4,12 @@ #include #include +#include "queue/queue_item.h" +#include "queue/transport.h" +#include "queue/utils.h" #include "ray/common/id.h" #include "ray/util/util.h" - -#include "queue_item.h" -#include "transport.h" #include "util/streaming_logging.h" -#include "utils.h" namespace ray { namespace streaming { diff --git a/streaming/src/queue/queue_client.cc b/streaming/src/queue/queue_client.cc index b0518066a..df62e1caa 100644 --- a/streaming/src/queue/queue_client.cc +++ b/streaming/src/queue/queue_client.cc @@ -1,4 +1,4 @@ -#include "queue_client.h" +#include "queue/queue_client.h" namespace ray { namespace streaming { diff --git a/streaming/src/queue/queue_client.h b/streaming/src/queue/queue_client.h index 48eab09ad..fec23d665 100644 --- a/streaming/src/queue/queue_client.h +++ b/streaming/src/queue/queue_client.h @@ -1,7 +1,7 @@ #pragma once -#include "queue_handler.h" -#include "transport.h" +#include "queue/queue_handler.h" +#include "queue/transport.h" namespace ray { namespace streaming { diff --git a/streaming/src/queue/queue_handler.cc b/streaming/src/queue/queue_handler.cc index e0a4433a5..012442566 100644 --- a/streaming/src/queue/queue_handler.cc +++ b/streaming/src/queue/queue_handler.cc @@ -1,6 +1,7 @@ -#include "queue_handler.h" +#include "queue/queue_handler.h" + +#include "queue/utils.h" #include "util/streaming_util.h" -#include "utils.h" namespace ray { namespace streaming { diff --git a/streaming/src/queue/queue_handler.h b/streaming/src/queue/queue_handler.h index d778415c5..f05d71f05 100644 --- a/streaming/src/queue/queue_handler.h +++ b/streaming/src/queue/queue_handler.h @@ -5,7 +5,7 @@ #include #include -#include "queue.h" +#include "queue/queue.h" #include "util/streaming_logging.h" namespace ray { diff --git a/streaming/src/queue/queue_item.h b/streaming/src/queue/queue_item.h index e27066c0f..9265c5ef9 100644 --- a/streaming/src/queue/queue_item.h +++ b/streaming/src/queue/queue_item.h @@ -5,10 +5,9 @@ #include #include -#include "ray/common/id.h" - -#include "message.h" #include "message/message_bundle.h" +#include "queue/message.h" +#include "ray/common/id.h" #include "util/streaming_logging.h" namespace ray { diff --git a/streaming/src/queue/transport.cc b/streaming/src/queue/transport.cc index 3d788dfe2..01841b324 100644 --- a/streaming/src/queue/transport.cc +++ b/streaming/src/queue/transport.cc @@ -1,5 +1,6 @@ -#include "transport.h" -#include "utils.h" +#include "queue/transport.h" + +#include "queue/utils.h" namespace ray { namespace streaming { diff --git a/streaming/src/ring_buffer.cc b/streaming/src/ring_buffer.cc index 8418ece96..6012f4a05 100644 --- a/streaming/src/ring_buffer.cc +++ b/streaming/src/ring_buffer.cc @@ -1,4 +1,5 @@ #include "ring_buffer.h" + #include "util/streaming_logging.h" namespace ray { diff --git a/streaming/src/runtime_context.cc b/streaming/src/runtime_context.cc index 38f1bd0d9..52c0184d0 100644 --- a/streaming/src/runtime_context.cc +++ b/streaming/src/runtime_context.cc @@ -1,8 +1,8 @@ -#include "ray/common/id.h" -#include "ray/protobuf/common.pb.h" -#include "ray/util/util.h" - #include "runtime_context.h" + +#include "ray/common/id.h" +#include "ray/util/util.h" +#include "src/ray/protobuf/common.pb.h" #include "util/streaming_logging.h" namespace ray { diff --git a/streaming/src/test/queue_tests_base.h b/streaming/src/test/queue_tests_base.h index bd3f80373..beec76064 100644 --- a/streaming/src/test/queue_tests_base.h +++ b/streaming/src/test/queue_tests_base.h @@ -3,6 +3,8 @@ #include "ray/common/test_util.h" #include "ray/util/filesystem.h" +#include "hiredis/hiredis.h" + namespace ray { namespace streaming { diff --git a/streaming/src/test/ring_buffer_tests.cc b/streaming/src/test/ring_buffer_tests.cc index c419e4f3d..25320cd6a 100644 --- a/streaming/src/test/ring_buffer_tests.cc +++ b/streaming/src/test/ring_buffer_tests.cc @@ -41,7 +41,7 @@ TEST(StreamingRingBufferTest, spsc_test) { std::thread thread([&ring_buffer]() { for (size_t j = 0; j < data_n; ++j) { StreamingMessagePtr message = std::make_shared( - reinterpret_cast(&j), sizeof(size_t), j, + reinterpret_cast(&j), static_cast(sizeof(size_t)), j, StreamingMessageType::Message); while (ring_buffer.IsFull()) { } @@ -67,7 +67,7 @@ TEST(StreamingRingBufferTest, mutex_test) { std::thread thread([&ring_buffer]() { for (size_t j = 0; j < data_n; ++j) { StreamingMessagePtr message = std::make_shared( - reinterpret_cast(&j), sizeof(size_t), j, + reinterpret_cast(&j), static_cast(sizeof(size_t)), j, StreamingMessageType::Message); while (ring_buffer.IsFull()) { } diff --git a/streaming/src/test/streaming_queue_tests.cc b/streaming/src/test/streaming_queue_tests.cc index 75715acb7..2dfb2bf18 100644 --- a/streaming/src/test/streaming_queue_tests.cc +++ b/streaming/src/test/streaming_queue_tests.cc @@ -11,7 +11,7 @@ #include "message/message_bundle.h" #include "ring_buffer.h" -#include "queue_tests_base.h" +#include "test/queue_tests_base.h" using namespace std::placeholders; namespace ray { diff --git a/streaming/src/util/streaming_logging.cc b/streaming/src/util/streaming_logging.cc index 3b0a730c6..fda4824c2 100644 --- a/streaming/src/util/streaming_logging.cc +++ b/streaming/src/util/streaming_logging.cc @@ -1,4 +1,4 @@ -#include "streaming_logging.h" +#include "util/streaming_logging.h" namespace ray { namespace streaming {} // namespace streaming diff --git a/streaming/src/util/streaming_util.cc b/streaming/src/util/streaming_util.cc index 4ed99a190..95038f2a9 100644 --- a/streaming/src/util/streaming_util.cc +++ b/streaming/src/util/streaming_util.cc @@ -1,6 +1,6 @@ -#include +#include "util/streaming_util.h" -#include "streaming_util.h" +#include namespace ray { namespace streaming {