[#401] control: Serve DropObjects RPC

Re-compile protobuf definition of Control service. Implement required
messages on DropObjects RPC request and response messages. Implement
`DropObjects` method on Control service server of the node. Use
`StorageEngine.Delete` method as a deleted object handler on server.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-02-21 11:30:32 +03:00 committed by Alex Vanin
parent f2337baedc
commit aa24702ebe
6 changed files with 624 additions and 79 deletions

View file

@ -5,7 +5,9 @@ import (
"encoding/hex"
"net"
"github.com/nspcc-dev/neofs-api-go/pkg/object"
crypto "github.com/nspcc-dev/neofs-crypto"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine"
"github.com/nspcc-dev/neofs-node/pkg/services/control"
controlSvc "github.com/nspcc-dev/neofs-node/pkg/services/control/server"
"github.com/pkg/errors"
@ -44,6 +46,13 @@ func initControlService(c *cfg) {
controlSvc.WithHealthChecker(c),
controlSvc.WithNetMapSource(c.cfgNetmap.wrapper),
controlSvc.WithNodeState(c),
controlSvc.WithDeletedObjectHandler(func(addrList []*object.Address) error {
prm := new(engine.DeletePrm).WithAddresses(addrList...)
_, err := c.cfgObject.cfgLocalStorage.localStorage.Delete(prm)
return err
}),
)
var (