replicator

package
v0.43.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricsRegister added in v0.37.0

type MetricsRegister interface {
	IncInFlightRequest()
	DecInFlightRequest()
	IncProcessedObjects()
	AddPayloadSize(size int64)
}

type Option

type Option func(*cfg)

Option is an option for Policer constructor.

func WithLocalStorage

func WithLocalStorage(v *engine.StorageEngine) Option

WithLocalStorage returns option to set local object storage of Replicator.

func WithLogger

func WithLogger(v *logger.Logger) Option

WithLogger returns option to set Logger of Replicator.

func WithMetrics added in v0.37.0

func WithMetrics(v MetricsRegister) Option

func WithPutTimeout

func WithPutTimeout(v time.Duration) Option

WithPutTimeout returns option to set Put timeout of Replicator.

func WithRemoteGetter added in v0.40.0

func WithRemoteGetter(v *getsvc.RemoteGetter) Option

func WithRemoteSender

func WithRemoteSender(v *objectwriter.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) HandleLocalPutTask added in v0.40.0

func (p *Replicator) HandleLocalPutTask(ctx context.Context, task Task)

func (*Replicator) HandlePullTask added in v0.40.0

func (p *Replicator) HandlePullTask(ctx context.Context, task Task)

func (*Replicator) HandleReplicationTask added in v0.40.0

func (p *Replicator) HandleReplicationTask(ctx context.Context, task Task, res TaskResult)

HandleReplicationTask executes replication task inside invoking goroutine. Passes all the nodes that accepted the replication to the TaskResult.

type Task

type Task struct {
	// NumCopies is the number of copies to replicate.
	NumCopies uint32
	// Addr is the address of the local object.
	Addr oid.Address
	// Obj is the object to avoid fetching it from the local storage.
	Obj *objectSDK.Object
	// Nodes is a list of potential object holders.
	Nodes []netmap.NodeInfo
}

Task represents group of Replicator task parameters.

type TaskResult

type TaskResult interface {
	// SubmitSuccessfulReplication submits the successful object replication
	// to the given node.
	SubmitSuccessfulReplication(netmap.NodeInfo)
}

TaskResult is a replication result interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL