[#243] object/delete: Implement new service processing

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-12-11 11:04:04 +03:00 committed by Alex Vanin
parent 510e9ff2ec
commit fe3906c295
11 changed files with 654 additions and 217 deletions

View file

@ -326,20 +326,6 @@ func initObjectService(c *cfg) {
searchsvcV2.WithKeyStorage(keyStorage),
)
sHead := headsvc.NewService(
headsvc.WithKeyStorage(keyStorage),
headsvc.WithClientCache(clientCache),
headsvc.WithLocalStorage(ls),
headsvc.WithContainerSource(c.cfgObject.cnrStorage),
headsvc.WithNetworkMapSource(c.cfgObject.netMapStorage),
headsvc.WithLocalAddressSource(c),
headsvc.WithWorkerPool(c.cfgObject.pool.head),
headsvc.WithLogger(c.log),
headsvc.WithClientOptions(
client.WithDialTimeout(c.viper.GetDuration(cfgObjectHeadDialTimeout)),
),
)
sGet := getsvc.New(
getsvc.WithLogger(c.log),
getsvc.WithLocalStorageEngine(ls),
@ -359,19 +345,16 @@ func initObjectService(c *cfg) {
getsvcV2.WithKeyStorage(keyStorage),
)
sDelete := deletesvc.NewService(
deletesvc.WithKeyStorage(keyStorage),
deletesvc.WitHeadService(sHead),
deletesvc.WithPutService(sPut),
deletesvc.WithOwnerID(nodeOwner),
deletesvc.WithLinkingHeader(
headsvc.NewRelationHeader(nil, sHead),
),
sDelete := deletesvc.New(
deletesvc.WithLogger(c.log),
deletesvc.WithHeadService(sGet),
deletesvc.WithSearchService(sSearch),
deletesvc.WithPutService(sPut),
)
sDeleteV2 := deletesvcV2.NewService(
deletesvcV2.WithInternalService(sDelete),
deletesvcV2.WithKeyStorage(keyStorage),
)
objectGRPC.RegisterObjectServiceServer(c.cfgGRPC.server,