forked from TrueCloudLab/frostfs-node
[#243] object/delete: Implement new service processing
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
510e9ff2ec
commit
fe3906c295
11 changed files with 654 additions and 217 deletions
53
pkg/services/object/delete/local.go
Normal file
53
pkg/services/object/delete/local.go
Normal file
|
@ -0,0 +1,53 @@
|
|||
package deletesvc
|
||||
|
||||
import (
|
||||
objectSDK "github.com/nspcc-dev/neofs-api-go/pkg/object"
|
||||
)
|
||||
|
||||
func (exec *execCtx) executeLocal() {
|
||||
exec.log.Debug("forming tombstone structure...")
|
||||
|
||||
ok := exec.formTombstone()
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
exec.log.Debug("tombstone structure successfully formed, saving...")
|
||||
|
||||
ok = exec.saveTombstone()
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
exec.log.Debug("tombstone successfilly saved, broadcasting...")
|
||||
|
||||
exec.broadcastTombstone()
|
||||
}
|
||||
|
||||
func (exec *execCtx) formTombstone() (ok bool) {
|
||||
exec.tombstone = objectSDK.NewTombstone()
|
||||
exec.addMembers([]*objectSDK.ID{exec.address().ObjectID()})
|
||||
|
||||
exec.log.Debug("forming split info...")
|
||||
|
||||
ok = exec.formSplitInfo()
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
exec.log.Debug("split info successfully formed, collecting members...")
|
||||
|
||||
ok = exec.collectMembers()
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
exec.log.Debug("members successfully collected")
|
||||
|
||||
ok = exec.initTombstoneObject()
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue