frostfs-node/pkg/services/replicator/task.go
Pavel Karpy df8a3807fe [#1508] node: Remove unused replicator code
The node does not support asynchronous object replication anymore, so it
does not need to have replicator worker, channel and `AddTask` function.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2022-06-15 20:33:04 +03:00

42 lines
717 B
Go

package replicator
import (
"github.com/nspcc-dev/neofs-sdk-go/netmap"
oid "github.com/nspcc-dev/neofs-sdk-go/object/id"
)
// Task represents group of Replicator task parameters.
type Task struct {
quantity uint32
addr oid.Address
nodes netmap.Nodes
}
// WithCopiesNumber sets number of copies to replicate.
func (t *Task) WithCopiesNumber(v uint32) *Task {
if t != nil {
t.quantity = v
}
return t
}
// WithObjectAddress sets address of local object.
func (t *Task) WithObjectAddress(v oid.Address) *Task {
if t != nil {
t.addr = v
}
return t
}
// WithNodes sets a list of potential object holders.
func (t *Task) WithNodes(v netmap.Nodes) *Task {
if t != nil {
t.nodes = v
}
return t
}