Skip to content

Commit

Permalink
[Core] Remove dead PlacementGroupScheduleTable and ResourceUsageBatch…
Browse files Browse the repository at this point in the history
…Table (ray-project#45918)

Not used in the code.
  • Loading branch information
jjyao authored Jun 13, 2024
1 parent 1248db6 commit 65b7255
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 75 deletions.
20 changes: 0 additions & 20 deletions src/mock/ray/gcs/gcs_server/gcs_table_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,26 +113,6 @@ class MockGcsNodeTable : public GcsNodeTable {
namespace ray {
namespace gcs {

class MockGcsPlacementGroupScheduleTable : public GcsPlacementGroupScheduleTable {
public:
};

} // namespace gcs
} // namespace ray

namespace ray {
namespace gcs {

class MockGcsResourceUsageBatchTable : public GcsResourceUsageBatchTable {
public:
};

} // namespace gcs
} // namespace ray

namespace ray {
namespace gcs {

class MockGcsWorkerTable : public GcsWorkerTable {
public:
};
Expand Down
19 changes: 2 additions & 17 deletions src/ray/gcs/gcs_server/gcs_placement_group_scheduler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ void GcsPlacementGroupScheduler::OnAllBundlePrepareRequestReturned(
<< "This method can be called only after all bundle scheduling requests are "
"returned.";
const auto &placement_group = lease_status_tracker->GetPlacementGroup();
const auto &bundles = lease_status_tracker->GetBundlesToSchedule();
const auto &prepared_bundle_locations =
lease_status_tracker->GetPreparedBundleLocations();
const auto &placement_group_id = placement_group->GetPlacementGroupID();
Expand All @@ -383,22 +382,8 @@ void GcsPlacementGroupScheduler::OnAllBundlePrepareRequestReturned(
->set_node_id(location.first.Binary());
}

// Store data to GCS.
rpc::ScheduleData data;
for (const auto &iter : bundles) {
// TODO(ekl) this is a hack to get a string key for the proto
auto key = iter->PlacementGroupId().Hex() + "_" + std::to_string(iter->Index());
data.mutable_schedule_plan()->insert(
{key, (*prepared_bundle_locations)[iter->BundleId()].first.Binary()});
}
RAY_CHECK_OK(gcs_table_storage_->PlacementGroupScheduleTable().Put(
placement_group_id,
data,
[this, schedule_success_handler, schedule_failure_handler, lease_status_tracker](
Status status) {
CommitAllBundles(
lease_status_tracker, schedule_failure_handler, schedule_success_handler);
}));
CommitAllBundles(
lease_status_tracker, schedule_failure_handler, schedule_success_handler);
}

void GcsPlacementGroupScheduler::OnAllBundleCommitRequestReturned(
Expand Down
1 change: 0 additions & 1 deletion src/ray/gcs/gcs_server/gcs_table_storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ template class GcsTable<UniqueID, StoredConfig>;
template class GcsTableWithJobId<ActorID, ActorTableData>;
template class GcsTableWithJobId<ActorID, TaskSpec>;
template class GcsTable<PlacementGroupID, PlacementGroupTableData>;
template class GcsTable<PlacementGroupID, ScheduleData>;

} // namespace gcs
} // namespace ray
33 changes: 0 additions & 33 deletions src/ray/gcs/gcs_server/gcs_table_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ using rpc::JobTableData;
using rpc::ObjectTableData;
using rpc::PlacementGroupTableData;
using rpc::ResourceUsageBatchData;
using rpc::ScheduleData;
using rpc::StoredConfig;
using rpc::TaskSpec;
using rpc::WorkerTableData;
Expand Down Expand Up @@ -203,22 +202,6 @@ class GcsNodeTable : public GcsTable<NodeID, GcsNodeInfo> {
}
};

class GcsPlacementGroupScheduleTable : public GcsTable<PlacementGroupID, ScheduleData> {
public:
explicit GcsPlacementGroupScheduleTable(std::shared_ptr<StoreClient> store_client)
: GcsTable(std::move(store_client)) {
table_name_ = TablePrefix_Name(TablePrefix::PLACEMENT_GROUP_SCHEDULE);
}
};

class GcsResourceUsageBatchTable : public GcsTable<NodeID, ResourceUsageBatchData> {
public:
explicit GcsResourceUsageBatchTable(std::shared_ptr<StoreClient> store_client)
: GcsTable(std::move(store_client)) {
table_name_ = TablePrefix_Name(TablePrefix::RESOURCE_USAGE_BATCH);
}
};

class GcsWorkerTable : public GcsTable<WorkerID, WorkerTableData> {
public:
explicit GcsWorkerTable(std::shared_ptr<StoreClient> store_client)
Expand Down Expand Up @@ -248,10 +231,6 @@ class GcsTableStorage {
actor_task_spec_table_ = std::make_unique<GcsActorTaskSpecTable>(store_client_);
placement_group_table_ = std::make_unique<GcsPlacementGroupTable>(store_client_);
node_table_ = std::make_unique<GcsNodeTable>(store_client_);
placement_group_schedule_table_ =
std::make_unique<GcsPlacementGroupScheduleTable>(store_client_);
resource_usage_batch_table_ =
std::make_unique<GcsResourceUsageBatchTable>(store_client_);
worker_table_ = std::make_unique<GcsWorkerTable>(store_client_);
system_config_table_ = std::make_unique<GcsInternalConfigTable>(store_client_);
}
Expand Down Expand Up @@ -283,16 +262,6 @@ class GcsTableStorage {
return *node_table_;
}

GcsPlacementGroupScheduleTable &PlacementGroupScheduleTable() {
RAY_CHECK(placement_group_schedule_table_ != nullptr);
return *placement_group_schedule_table_;
}

GcsResourceUsageBatchTable &ResourceUsageBatchTable() {
RAY_CHECK(resource_usage_batch_table_ != nullptr);
return *resource_usage_batch_table_;
}

GcsWorkerTable &WorkerTable() {
RAY_CHECK(worker_table_ != nullptr);
return *worker_table_;
Expand All @@ -315,8 +284,6 @@ class GcsTableStorage {
std::unique_ptr<GcsActorTaskSpecTable> actor_task_spec_table_;
std::unique_ptr<GcsPlacementGroupTable> placement_group_table_;
std::unique_ptr<GcsNodeTable> node_table_;
std::unique_ptr<GcsPlacementGroupScheduleTable> placement_group_schedule_table_;
std::unique_ptr<GcsResourceUsageBatchTable> resource_usage_batch_table_;
std::unique_ptr<GcsWorkerTable> worker_table_;
std::unique_ptr<GcsInternalConfigTable> system_config_table_;
};
Expand Down
4 changes: 0 additions & 4 deletions src/ray/protobuf/gcs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,6 @@ message ErrorTableData {
double timestamp = 4;
}

message ScheduleData {
map<string, bytes> schedule_plan = 1;
}

message ProfileEventEntry {
// The start timestamp of the event time.
int64 start_time = 1;
Expand Down

0 comments on commit 65b7255

Please sign in to comment.