Skip to content

Commit 63261b9

Browse files
committed
rename gcs_callback_types.h to grpc_callback_types.h
Signed-off-by: yuchao-wang <wyc984872769@hotmail.com>
1 parent dde70e7 commit 63261b9

22 files changed

+78
-80
lines changed

src/ray/common/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ ray_cc_library(
390390
)
391391

392392
ray_cc_library(
393-
name = "gcs_callback_types",
394-
hdrs = ["gcs_callback_types.h"],
393+
name = "grpc_callback_types",
394+
hdrs = ["grpc_callback_types.h"],
395395
deps = [
396396
"//src/ray/common:status",
397397
],

src/ray/common/gcs_callback_types.h renamed to src/ray/common/grpc_callback_types.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "ray/common/status.h"
2121

2222
namespace ray {
23-
namespace gcs {
2423

2524
/// This callback is used to notify when a write/subscribe to GCS completes.
2625
/// \param status Status indicates whether the write/subscribe was successful.
@@ -51,5 +50,4 @@ using SubscribeCallback = std::function<void(const ID &id, Data &&result)>;
5150
template <typename Data>
5251
using ItemCallback = std::function<void(Data &&result)>;
5352

54-
} // namespace gcs
5553
} // namespace ray

src/ray/core_worker/actor_creator.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ Status ActorCreator::RegisterActor(const TaskSpecification &task_spec) const {
3333
}
3434

3535
void ActorCreator::AsyncRegisterActor(const TaskSpecification &task_spec,
36-
gcs::StatusCallback callback) {
36+
StatusCallback callback) {
3737
auto actor_id = task_spec.ActorCreationId();
3838
(*registering_actors_)[actor_id] = {};
3939
if (callback != nullptr) {
4040
(*registering_actors_)[actor_id].emplace_back(std::move(callback));
4141
}
4242
actor_client_.AsyncRegisterActor(task_spec, [actor_id, this](Status status) {
43-
std::vector<ray::gcs::StatusCallback> cbs;
43+
std::vector<ray::StatusCallback> cbs;
4444
cbs = std::move((*registering_actors_)[actor_id]);
4545
registering_actors_->erase(actor_id);
4646
for (auto &cb : cbs) {
@@ -52,15 +52,15 @@ void ActorCreator::AsyncRegisterActor(const TaskSpecification &task_spec,
5252
void ActorCreator::AsyncRestartActorForLineageReconstruction(
5353
const ActorID &actor_id,
5454
uint64_t num_restarts_due_to_lineage_reconstructions,
55-
gcs::StatusCallback callback) {
55+
StatusCallback callback) {
5656
actor_client_.AsyncRestartActorForLineageReconstruction(
5757
actor_id, num_restarts_due_to_lineage_reconstructions, callback);
5858
}
5959

6060
void ActorCreator::AsyncReportActorOutOfScope(
6161
const ActorID &actor_id,
6262
uint64_t num_restarts_due_to_lineage_reconstruction,
63-
gcs::StatusCallback callback) {
63+
StatusCallback callback) {
6464
actor_client_.AsyncReportActorOutOfScope(
6565
actor_id, num_restarts_due_to_lineage_reconstruction, callback);
6666
}
@@ -70,7 +70,7 @@ bool ActorCreator::IsActorInRegistering(const ActorID &actor_id) const {
7070
}
7171

7272
void ActorCreator::AsyncWaitForActorRegisterFinish(const ActorID &actor_id,
73-
gcs::StatusCallback callback) {
73+
StatusCallback callback) {
7474
auto iter = registering_actors_->find(actor_id);
7575
RAY_CHECK(iter != registering_actors_->end());
7676
iter->second.emplace_back(std::move(callback));

src/ray/core_worker/actor_creator.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ class ActorCreatorInterface {
3838
/// \param callback Callback that will be called after the actor info is registered to
3939
/// GCS
4040
virtual void AsyncRegisterActor(const TaskSpecification &task_spec,
41-
gcs::StatusCallback callback) = 0;
41+
StatusCallback callback) = 0;
4242

4343
virtual void AsyncRestartActorForLineageReconstruction(
4444
const ActorID &actor_id,
4545
uint64_t num_restarts_due_to_lineage_reconstructions,
46-
gcs::StatusCallback callback) = 0;
46+
StatusCallback callback) = 0;
4747

4848
virtual void AsyncReportActorOutOfScope(
4949
const ActorID &actor_id,
5050
uint64_t num_restarts_due_to_lineage_reconstructions,
51-
gcs::StatusCallback callback) = 0;
51+
StatusCallback callback) = 0;
5252

5353
/// Asynchronously request GCS to create the actor.
5454
///
@@ -63,7 +63,7 @@ class ActorCreatorInterface {
6363
/// \param actor_id The actor id to wait
6464
/// \param callback The callback that will be called after actor registered
6565
virtual void AsyncWaitForActorRegisterFinish(const ActorID &actor_id,
66-
gcs::StatusCallback callback) = 0;
66+
StatusCallback callback) = 0;
6767

6868
/// Check whether actor is activately under registering
6969
///
@@ -80,21 +80,21 @@ class ActorCreator : public ActorCreatorInterface {
8080
Status RegisterActor(const TaskSpecification &task_spec) const override;
8181

8282
void AsyncRegisterActor(const TaskSpecification &task_spec,
83-
gcs::StatusCallback callback) override;
83+
StatusCallback callback) override;
8484

8585
void AsyncRestartActorForLineageReconstruction(
8686
const ActorID &actor_id,
8787
uint64_t num_restarts_due_to_lineage_reconstructions,
88-
gcs::StatusCallback callback) override;
88+
StatusCallback callback) override;
8989

9090
void AsyncReportActorOutOfScope(const ActorID &actor_id,
9191
uint64_t num_restarts_due_to_lineage_reconstruction,
92-
gcs::StatusCallback callback) override;
92+
StatusCallback callback) override;
9393

9494
bool IsActorInRegistering(const ActorID &actor_id) const override;
9595

9696
void AsyncWaitForActorRegisterFinish(const ActorID &actor_id,
97-
gcs::StatusCallback callback) override;
97+
StatusCallback callback) override;
9898

9999
void AsyncCreateActor(
100100
const TaskSpecification &task_spec,
@@ -103,7 +103,7 @@ class ActorCreator : public ActorCreatorInterface {
103103
private:
104104
gcs::ActorInfoAccessor &actor_client_;
105105
using RegisteringActorType =
106-
absl::flat_hash_map<ActorID, std::vector<ray::gcs::StatusCallback>>;
106+
absl::flat_hash_map<ActorID, std::vector<ray::StatusCallback>>;
107107
ThreadPrivate<RegisteringActorType> registering_actors_;
108108
};
109109

src/ray/core_worker/fake_actor_creator.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,31 +31,31 @@ class FakeActorCreator : public ActorCreatorInterface {
3131
};
3232

3333
void AsyncRegisterActor(const TaskSpecification &task_spec,
34-
gcs::StatusCallback callback) override {}
34+
StatusCallback callback) override {}
3535

3636
void AsyncRestartActorForLineageReconstruction(
3737
const ActorID &actor_id,
3838
uint64_t num_restarts_due_to_lineage_reconstructions,
39-
gcs::StatusCallback callback) override {}
39+
StatusCallback callback) override {}
4040

4141
void AsyncReportActorOutOfScope(const ActorID &actor_id,
4242
uint64_t num_restarts_due_to_lineage_reconstruction,
43-
gcs::StatusCallback callback) override {}
43+
StatusCallback callback) override {}
4444

4545
void AsyncCreateActor(
4646
const TaskSpecification &task_spec,
4747
const rpc::ClientCallback<rpc::CreateActorReply> &callback) override {}
4848

4949
void AsyncWaitForActorRegisterFinish(const ActorID &,
50-
gcs::StatusCallback callback) override {
50+
StatusCallback callback) override {
5151
callbacks.push_back(callback);
5252
}
5353

5454
[[nodiscard]] bool IsActorInRegistering(const ActorID &actor_id) const override {
5555
return actor_pending;
5656
}
5757

58-
std::list<gcs::StatusCallback> callbacks;
58+
std::list<StatusCallback> callbacks;
5959
bool actor_pending = false;
6060
};
6161

src/ray/core_worker/tests/actor_manager_test.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class MockActorInfoAccessor : public gcs::ActorInfoAccessor {
3939

4040
void AsyncSubscribe(
4141
const ActorID &actor_id,
42-
const gcs::SubscribeCallback<ActorID, rpc::ActorTableData> &subscribe,
43-
const gcs::StatusCallback &done) {
42+
const SubscribeCallback<ActorID, rpc::ActorTableData> &subscribe,
43+
const StatusCallback &done) {
4444
auto callback_entry = std::make_pair(actor_id, subscribe);
4545
callback_map_.emplace(actor_id, subscribe);
4646
subscribe_finished_callback_map_[actor_id] = done;
@@ -81,9 +81,9 @@ class MockActorInfoAccessor : public gcs::ActorInfoAccessor {
8181
return true;
8282
}
8383

84-
absl::flat_hash_map<ActorID, gcs::SubscribeCallback<ActorID, rpc::ActorTableData>>
84+
absl::flat_hash_map<ActorID, SubscribeCallback<ActorID, rpc::ActorTableData>>
8585
callback_map_;
86-
absl::flat_hash_map<ActorID, gcs::StatusCallback> subscribe_finished_callback_map_;
86+
absl::flat_hash_map<ActorID, StatusCallback> subscribe_finished_callback_map_;
8787
absl::flat_hash_map<ActorID, uint32_t> actor_subscribed_times_;
8888
};
8989

src/ray/core_worker/tests/core_worker_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ TEST_P(HandleWaitForActorRefDeletedWhileRegisteringRetriesTest,
10731073
actor_creation_spec->set_max_task_retries(0);
10741074
TaskSpecification task_spec(task_spec_msg);
10751075

1076-
gcs::StatusCallback register_callback;
1076+
StatusCallback register_callback;
10771077
EXPECT_CALL(*mock_gcs_client_->mock_actor_accessor,
10781078
AsyncRegisterActor(::testing::_, ::testing::_, ::testing::_))
10791079
.WillOnce(::testing::SaveArg<1>(&register_callback));

src/ray/core_worker/tests/task_event_buffer_test.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ TEST_P(TaskEventBufferTestDifferentDestination, TestFlushEvents) {
462462
if (to_gcs) {
463463
EXPECT_CALL(*task_gcs_accessor, AsyncAddTaskEventData(_, _))
464464
.WillOnce([&](std::unique_ptr<rpc::TaskEventData> actual_data,
465-
ray::gcs::StatusCallback callback) {
465+
ray::StatusCallback callback) {
466466
CompareTaskEventData(*actual_data, expected_task_event_data);
467467
return Status::OK();
468468
});
@@ -518,12 +518,12 @@ TEST_P(TaskEventBufferTestDifferentDestination, TestFailedFlush) {
518518
EXPECT_CALL(*task_gcs_accessor, AsyncAddTaskEventData)
519519
.Times(2)
520520
.WillOnce([&](std::unique_ptr<rpc::TaskEventData> actual_data,
521-
ray::gcs::StatusCallback callback) {
521+
ray::StatusCallback callback) {
522522
callback(Status::RpcError("grpc error", grpc::StatusCode::UNKNOWN));
523523
return Status::OK();
524524
})
525525
.WillOnce([&](std::unique_ptr<rpc::TaskEventData> actual_data,
526-
ray::gcs::StatusCallback callback) {
526+
ray::StatusCallback callback) {
527527
callback(Status::OK());
528528
return Status::OK();
529529
});
@@ -678,7 +678,7 @@ TEST_P(TaskEventBufferTestBatchSendDifferentDestination, TestBatchedSend) {
678678
EXPECT_CALL(*task_gcs_accessor, AsyncAddTaskEventData)
679679
.Times(num_events / batch_size)
680680
.WillRepeatedly([&batch_size](std::unique_ptr<rpc::TaskEventData> actual_data,
681-
ray::gcs::StatusCallback callback) {
681+
ray::StatusCallback callback) {
682682
EXPECT_EQ(actual_data->events_by_task_size(), batch_size);
683683
callback(Status::OK());
684684
return Status::OK();
@@ -785,7 +785,7 @@ TEST_P(TaskEventBufferTestLimitBufferDifferentDestination,
785785
if (to_gcs) {
786786
EXPECT_CALL(*task_gcs_accessor, AsyncAddTaskEventData(_, _))
787787
.WillOnce([&](std::unique_ptr<rpc::TaskEventData> actual_data,
788-
ray::gcs::StatusCallback callback) {
788+
ray::StatusCallback callback) {
789789
// Sort and compare
790790
CompareTaskEventData(*actual_data, expected_data);
791791
return Status::OK();
@@ -860,7 +860,7 @@ TEST_F(TaskEventBufferTestLimitProfileEvents, TestBufferSizeLimitProfileEvents)
860860

861861
EXPECT_CALL(*task_gcs_accessor, AsyncAddTaskEventData(_, _))
862862
.WillOnce([&](std::unique_ptr<rpc::TaskEventData> actual_data,
863-
ray::gcs::StatusCallback callback) {
863+
ray::StatusCallback callback) {
864864
EXPECT_EQ(actual_data->num_profile_events_dropped(), num_profile_dropped);
865865
EXPECT_EQ(actual_data->events_by_task_size(), num_limit_profile_events);
866866
return Status::OK();
@@ -1107,7 +1107,7 @@ TEST_P(TaskEventBufferTestDifferentDestination,
11071107
if (to_gcs) {
11081108
EXPECT_CALL(*task_gcs_accessor, AsyncAddTaskEventData(_, _))
11091109
.WillOnce([&](std::unique_ptr<rpc::TaskEventData> actual_data,
1110-
ray::gcs::StatusCallback callback) {
1110+
ray::StatusCallback callback) {
11111111
CompareTaskEventData(*actual_data, expected_task_event_data);
11121112
return Status::OK();
11131113
});

src/ray/gcs/store_client/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ray_cc_library(
55
hdrs = ["store_client.h"],
66
deps = [
77
"//src/ray/common:asio",
8-
"//src/ray/common:gcs_callback_types",
8+
"//src/ray/common:grpc_callback_types",
99
"//src/ray/common:id",
1010
"//src/ray/common:status",
1111
],

src/ray/gcs/store_client/store_client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "ray/common/asio/io_service_pool.h"
2222
#include "ray/common/asio/postable.h"
23-
#include "ray/common/gcs_callback_types.h"
23+
#include "ray/common/grpc_callback_types.h"
2424
#include "ray/common/id.h"
2525
#include "ray/common/status.h"
2626

0 commit comments

Comments
 (0)