Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalNodeKey ¶ added in v0.52.0
type LocalNodeKey interface {
// IsLocalNodePublicKey checks whether given binary-encoded public key is
// assigned in the network map to a local storage node running [Replicator].
IsLocalNodePublicKey([]byte) bool
}
LocalNodeKey provides information about the NeoFS network to Replicator for work.
type Option ¶
type Option func(*cfg)
Option is an option for Policer constructor.
func WithLocalNodeKey ¶ added in v0.52.0
func WithLocalNodeKey(n LocalNodeKey) Option
WithLocalNodeKey provides LocalNodeKey component.
func WithLocalStorage ¶
func WithLocalStorage(v *engine.StorageEngine) Option
WithLocalStorage returns option to set local object storage of Replicator.
func WithLogger ¶
WithLogger returns option to set Logger of Replicator.
func WithPutTimeout ¶
WithPutTimeout returns option to set Put timeout of Replicator.
func WithRemoteSender ¶
func WithRemoteSender(v *putsvc.RemoteSender) Option
WithRemoteSender returns option to set remote object sender of Replicator.
type Replicator ¶
type Replicator struct {
// contains filtered or unexported fields
}
Replicator represents the utility that replicates local objects to remote nodes.
func New ¶
func New(opts ...Option) *Replicator
New creates, initializes and returns Replicator instance.
func (*Replicator) EnqueueTask ¶ added in v0.53.0
func (p *Replicator) EnqueueTask(task Task) error
EnqueueTask submits replication task for asynchronous execution.
func (*Replicator) HandleTask ¶ added in v0.27.0
func (p *Replicator) HandleTask(ctx context.Context, task Task, res TaskResult)
HandleTask executes replication task inside invoking goroutine. Passes all the nodes that accepted the replication to the TaskResult.
func (*Replicator) Run ¶
func (p *Replicator) Run(ctx context.Context)
Run processes queued replication tasks until the context is canceled.
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
Task represents group of Replicator task parameters.
func (*Task) SetCopiesNumber ¶ added in v0.33.0
SetCopiesNumber sets number of copies to replicate.
func (*Task) SetObject ¶ added in v0.33.0
SetObject sets object to avoid fetching it from the local storage.
func (*Task) SetObjectAddress ¶ added in v0.33.0
SetObjectAddress sets address of local object.
type TaskResult ¶ added in v0.29.0
type TaskResult interface {
// SubmitSuccessfulReplication submits the successful object replication
// to the given node.
SubmitSuccessfulReplication(netmap.NodeInfo)
}
TaskResult is a replication result interface.