3030#include " ray/gcs/gcs_server/grpc_service_interfaces.h"
3131#include " ray/rpc/grpc_server.h"
3232#include " ray/rpc/server_call.h"
33+ #include " src/ray/protobuf/autoscaler.grpc.pb.h"
3334#include " src/ray/protobuf/gcs_service.grpc.pb.h"
3435
3536namespace ray {
@@ -242,11 +243,36 @@ class TaskInfoGrpcService : public GrpcService {
242243 int64_t max_active_rpcs_per_handler_;
243244};
244245
245- class RayEventExportGrpcService : public GrpcService {
246+ class PlacementGroupInfoGrpcService : public GrpcService {
246247 public:
247- explicit RayEventExportGrpcService (instrumented_io_context &io_service,
248- RayEventExportGcsServiceHandler &handler,
249- int64_t max_active_rpcs_per_handler)
248+ explicit PlacementGroupInfoGrpcService (instrumented_io_context &io_service,
249+ PlacementGroupInfoGcsServiceHandler &handler,
250+ int64_t max_active_rpcs_per_handler)
251+ : GrpcService(io_service),
252+ service_handler_(handler),
253+ max_active_rpcs_per_handler_(max_active_rpcs_per_handler) {}
254+
255+ protected:
256+ grpc::Service &GetGrpcService () override { return service_; }
257+
258+ void InitServerCallFactories (
259+ const std::unique_ptr<grpc::ServerCompletionQueue> &cq,
260+ std::vector<std::unique_ptr<ServerCallFactory>> *server_call_factories,
261+ const ClusterID &cluster_id) override ;
262+
263+ private:
264+ PlacementGroupInfoGcsService::AsyncService service_;
265+ PlacementGroupInfoGcsServiceHandler &service_handler_;
266+ int64_t max_active_rpcs_per_handler_;
267+ };
268+
269+ namespace autoscaler {
270+
271+ class AutoscalerStateGrpcService : public GrpcService {
272+ public:
273+ explicit AutoscalerStateGrpcService (instrumented_io_context &io_service,
274+ AutoscalerStateServiceHandler &handler,
275+ int64_t max_active_rpcs_per_handler)
250276 : GrpcService(io_service),
251277 service_handler_(handler),
252278 max_active_rpcs_per_handler_(max_active_rpcs_per_handler){};
@@ -260,19 +286,23 @@ class RayEventExportGrpcService : public GrpcService {
260286 const ClusterID &cluster_id) override ;
261287
262288 private:
263- RayEventExportGcsService ::AsyncService service_;
264- RayEventExportGcsServiceHandler &service_handler_;
289+ AutoscalerStateService ::AsyncService service_;
290+ AutoscalerStateServiceHandler &service_handler_;
265291 int64_t max_active_rpcs_per_handler_;
266292};
267293
268- class PlacementGroupInfoGrpcService : public GrpcService {
294+ } // namespace autoscaler
295+
296+ namespace events {
297+
298+ class RayEventExportGrpcService : public GrpcService {
269299 public:
270- explicit PlacementGroupInfoGrpcService (instrumented_io_context &io_service,
271- PlacementGroupInfoGcsServiceHandler &handler,
272- int64_t max_active_rpcs_per_handler)
300+ explicit RayEventExportGrpcService (instrumented_io_context &io_service,
301+ RayEventExportGcsServiceHandler &handler,
302+ int64_t max_active_rpcs_per_handler)
273303 : GrpcService(io_service),
274304 service_handler_(handler),
275- max_active_rpcs_per_handler_(max_active_rpcs_per_handler) {}
305+ max_active_rpcs_per_handler_(max_active_rpcs_per_handler){};
276306
277307 protected:
278308 grpc::Service &GetGrpcService () override { return service_; }
@@ -283,10 +313,12 @@ class PlacementGroupInfoGrpcService : public GrpcService {
283313 const ClusterID &cluster_id) override ;
284314
285315 private:
286- PlacementGroupInfoGcsService ::AsyncService service_;
287- PlacementGroupInfoGcsServiceHandler &service_handler_;
316+ RayEventExportGcsService ::AsyncService service_;
317+ RayEventExportGcsServiceHandler &service_handler_;
288318 int64_t max_active_rpcs_per_handler_;
289319};
290320
321+ } // namespace events
322+
291323} // namespace rpc
292324} // namespace ray
0 commit comments