diff --git a/cmd/neofs-node/container.go b/cmd/neofs-node/container.go index 65d889e8b5..891212fe91 100644 --- a/cmd/neofs-node/container.go +++ b/cmd/neofs-node/container.go @@ -124,9 +124,13 @@ func initContainerService(c *cfg) { containerService.NewSignService( c.key, containerService.NewResponseService( - containerService.NewExecutionService( - containerMorph.NewExecutor(cnrClient), - ), + &usedSpaceService{ + Service: containerService.NewExecutionService(containerMorph.NewExecutor(cnrClient)), + loadWriterProvider: loadRouter, + loadPlacementBuilder: loadPlacementBuilder, + routeBuilder: routeBuilder, + cfg: c, + }, c.respSvc, ), ), diff --git a/pkg/services/container/executor.go b/pkg/services/container/executor.go index 8e573d056e..72934f2751 100644 --- a/pkg/services/container/executor.go +++ b/pkg/services/container/executor.go @@ -17,6 +17,8 @@ type ServiceExecutor interface { } type executorSvc struct { + container.Service + exec ServiceExecutor } diff --git a/pkg/services/container/response.go b/pkg/services/container/response.go index 6b0d484400..93160215f2 100644 --- a/pkg/services/container/response.go +++ b/pkg/services/container/response.go @@ -100,3 +100,16 @@ func (s *responseService) GetExtendedACL(ctx context.Context, req *container.Get return resp.(*container.GetExtendedACLResponse), nil } + +func (s *responseService) AnnounceUsedSpace(ctx context.Context, req *container.AnnounceUsedSpaceRequest) (*container.AnnounceUsedSpaceResponse, error) { + resp, err := s.respSvc.HandleUnaryRequest(ctx, req, + func(ctx context.Context, req interface{}) (util.ResponseMessage, error) { + return s.svc.AnnounceUsedSpace(ctx, req.(*container.AnnounceUsedSpaceRequest)) + }, + ) + if err != nil { + return nil, err + } + + return resp.(*container.AnnounceUsedSpaceResponse), nil +} diff --git a/pkg/services/container/sign.go b/pkg/services/container/sign.go index f8a4700f23..47658ad709 100644 --- a/pkg/services/container/sign.go +++ b/pkg/services/container/sign.go @@ -98,3 +98,16 @@ func (s *signService) GetExtendedACL(ctx context.Context, req *container.GetExte return resp.(*container.GetExtendedACLResponse), nil } + +func (s *signService) AnnounceUsedSpace(ctx context.Context, req *container.AnnounceUsedSpaceRequest) (*container.AnnounceUsedSpaceResponse, error) { + resp, err := s.sigSvc.HandleUnaryRequest(ctx, req, + func(ctx context.Context, req interface{}) (util.ResponseMessage, error) { + return s.svc.AnnounceUsedSpace(ctx, req.(*container.AnnounceUsedSpaceRequest)) + }, + ) + if err != nil { + return nil, err + } + + return resp.(*container.AnnounceUsedSpaceResponse), nil +}