policer

package
v0.42.9 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuryFunc added in v0.37.0

type BuryFunc func(context.Context, oid.Address) error

BuryFunc is the function to bury (i.e. inhume) an object.

type KeySpaceIterator added in v0.37.0

type KeySpaceIterator interface {
	Next(context.Context, uint32) ([]objectcore.Info, error)
	Rewind()
}

KeySpaceIterator is the interface that allows iterating over the key space of local storage. Note that the underlying implementation might be circular: i.e. it can restart when the end of the key space is reached.

type LocalObjectGetFunc added in v0.40.0

type LocalObjectGetFunc func(context.Context, oid.Address) (*objectSDK.Object, error)

type LocalObjectHeaderFunc added in v0.40.0

type LocalObjectHeaderFunc func(context.Context, oid.Address) (*objectSDK.Object, error)

LocalObjectHeaderFunc is the function to obtain HEAD info from the current node.

type MetricsRegister added in v0.38.0

type MetricsRegister interface {
	IncProcessedObjects()
}

type Option

type Option func(*cfg)

Option is an option for Policer constructor.

func WithBuryFunc added in v0.37.0

func WithBuryFunc(f BuryFunc) Option

func WithContainerSource

func WithContainerSource(v container.Source) Option

WithContainerSource returns option to set container source of Policer.

func WithHeadTimeout

func WithHeadTimeout(v time.Duration) Option

WithHeadTimeout returns option to set Head timeout of Policer.

func WithKeySpaceIterator added in v0.37.0

func WithKeySpaceIterator(it KeySpaceIterator) Option

func WithKeyStorage added in v0.40.0

func WithKeyStorage(ks *util.KeyStorage) Option

func WithLocalObjectGetFunc added in v0.40.0

func WithLocalObjectGetFunc(v LocalObjectGetFunc) Option

func WithLocalObjectHeaderFunc added in v0.40.0

func WithLocalObjectHeaderFunc(v LocalObjectHeaderFunc) Option

WithLocalObjectHeaderFunc returns option to set local object header receiver of Policer.

func WithLogger

func WithLogger(v *logger.Logger) Option

WithLogger returns option to set Logger of Policer.

func WithMetrics added in v0.38.0

func WithMetrics(m MetricsRegister) Option

WithMetrics returns option to set metrics.

func WithNetmapKeys

func WithNetmapKeys(v netmap.AnnouncedKeys) Option

WithNetmapKeys returns option to set tool to work with announced public keys.

func WithPlacementBuilder

func WithPlacementBuilder(v placement.Builder) Option

WithPlacementBuilder returns option to set object placement builder of Policer.

func WithPool

func WithPool(p *ants.Pool) Option

WithPool returns option to set pool for policy and replication operations.

func WithRedundantCopyCallback

func WithRedundantCopyCallback(cb RedundantCopyCallback) Option

WithRedundantCopyCallback returns option to set callback to pass redundant local object copies detected by Policer.

func WithRemoteObjectGetFunc added in v0.40.0

func WithRemoteObjectGetFunc(v RemoteObjectGetFunc) Option

func WithRemoteObjectHeaderFunc added in v0.37.0

func WithRemoteObjectHeaderFunc(v RemoteObjectHeaderFunc) Option

WithRemoteObjectHeader returns option to set remote object header receiver of Policer.

func WithReplicator

func WithReplicator(v Replicator) Option

WithReplicator returns option to set object replicator of Policer.

type Policer

type Policer struct {
	// contains filtered or unexported fields
}

Policer represents the utility that verifies compliance with the object storage policy.

func New

func New(opts ...Option) *Policer

New creates, initializes and returns Policer instance.

func (*Policer) Run

func (p *Policer) Run(ctx context.Context)

type RedundantCopyCallback

type RedundantCopyCallback func(context.Context, oid.Address)

RedundantCopyCallback is a callback to pass the redundant local copy of the object.

type RemoteObjectGetFunc added in v0.40.0

type RemoteObjectGetFunc func(context.Context, netmapSDK.NodeInfo, oid.Address) (*objectSDK.Object, error)

type RemoteObjectHeaderFunc added in v0.37.0

type RemoteObjectHeaderFunc func(context.Context, netmapSDK.NodeInfo, oid.Address, bool) (*objectSDK.Object, error)

RemoteObjectHeaderFunc is the function to obtain HEAD info from a specific remote node.

type Replicator added in v0.37.0

type Replicator interface {
	HandleReplicationTask(ctx context.Context, task replicator.Task, res replicator.TaskResult)
	HandlePullTask(ctx context.Context, task replicator.Task)
	HandleLocalPutTask(ctx context.Context, task replicator.Task)
}

Replicator is the interface to a consumer of replication tasks.

Jump to

Keyboard shortcuts

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