Documentation
¶
Index ¶
- type MetricsRegister
- type Option
- type Replicator
- func (p *Replicator) HandleLocalPutTask(ctx context.Context, task Task)
- func (p *Replicator) HandlePullTask(ctx context.Context, task Task)
- func (p *Replicator) HandleReplicationTask(ctx context.Context, task Task, res TaskResult)
- func (p *Replicator) PullObject(ctx context.Context, addr oid.Address, nodes []netmapSDK.NodeInfo) (*objectSDK.Object, error)
- type Task
- type TaskResult
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 ¶
WithLogger returns option to set Logger of Replicator.
func WithMetrics ¶ added in v0.37.0
func WithMetrics(v MetricsRegister) Option
func WithPutTimeout ¶
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
Container containerSDK.Container
}
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.