policer

package
v0.41.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Network added in v0.36.0

type Network interface {
	// IsLocalNodeInNetmap checks whether the local node belongs to the current
	// network map. If it is impossible to check this fact, IsLocalNodeInNetmap
	// returns false.
	IsLocalNodeInNetmap() bool
}

Network provides information about the NeoFS network to Policer for work.

type Option

type Option func(*cfg)

Option is an option for Policer constructor.

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 WithLocalStorage

func WithLocalStorage(v *engine.StorageEngine) Option

WithLocalStorage returns option to set local object storage of Policer.

func WithLogger

func WithLogger(v *zap.Logger) Option

WithLogger returns option to set Logger of Policer.

func WithMaxCapacity added in v0.27.0

func WithMaxCapacity(capacity uint32) Option

WithMaxCapacity returns option to set max capacity that can be set to the pool.

func WithNetmapKeys added in v0.25.0

func WithNetmapKeys(v netmap.AnnouncedKeys) Option

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

func WithNetwork added in v0.36.0

func WithNetwork(n Network) Option

WithNetwork provides Network component.

func WithNodeLoader added in v0.27.0

func WithNodeLoader(l nodeLoader) Option

WithNodeLoader returns option to set NeoFS node load source.

func WithObjectBatchSize added in v0.39.0

func WithObjectBatchSize(s uint32) Option

WithObjectBatchSize returns option to set maximum objects read from the Storage at once.

func WithPlacementBuilder

func WithPlacementBuilder(v placement.Builder) Option

WithPlacementBuilder returns option to set object placement builder of Policer.

func WithPool added in v0.27.0

func WithPool(p *ants.Pool) Option

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

func WithRedundantCopyCallback added in v0.16.0

func WithRedundantCopyCallback(cb RedundantCopyCallback) Option

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

func WithRemoteHeader

func WithRemoteHeader(v *headsvc.RemoteHeader) Option

WithRemoteHeader returns option to set object header receiver of Policer.

func WithReplicationCooldown added in v0.39.0

func WithReplicationCooldown(d time.Duration) Option

WithReplicationCooldown returns option to set replication cooldown: the Policer will not submit more than one task per a provided time duration.

func WithReplicator

func WithReplicator(v *replicator.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) Reload added in v0.39.0

func (p *Policer) Reload(opts ...Option)

Reload allows runtime reconfiguration for the following parameters: - WithHeadTimeout; - [WithObjectCacheTime]; - WithReplicationCooldown; - WithMaxCapacity; - WithObjectBatchSize; - [WithObjectCacheSize].

func (*Policer) Run

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

type RedundantCopyCallback added in v0.16.0

type RedundantCopyCallback func(oid.Address)

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

Jump to

Keyboard shortcuts

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