collector

package
v1.119.0-rc Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package collector implements expired piece deletion from storage node.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Interval              time.Duration `help:"how frequently expired pieces are collected" default:"1h0m0s"`
	ExpirationGracePeriod time.Duration `` /* 191-byte string literal not displayed */
	ExpirationBatchSize   int           `` /* 156-byte string literal not displayed */
	FlatFileBatchLimit    int           `help:"how many per hour flat files can be deleted in one batch." default:"5"`
	ReverseOrder          bool          `help:"delete expired pieces in reverse order (recently expired first)" default:"false"`
}

Config defines parameters for storage node Collector.

type RunOnce added in v1.116.3

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

RunOnce executes the collector only once.

func NewRunnerOnce added in v1.116.3

func NewRunnerOnce(log *zap.Logger, pieces *pieces.Store, usedSerials *usedserials.Table, config Config, stop *modular.StopTrigger) RunOnce

NewRunnerOnce creates a new RunOnce.

func (RunOnce) Run added in v1.116.3

func (r RunOnce) Run(ctx context.Context) error

Run implements Runner interface.

type Service

type Service struct {
	Loop *sync2.Cycle
	// contains filtered or unexported fields
}

Service implements collecting expired pieces on the storage node.

architecture: Chore

func NewService

func NewService(log *zap.Logger, pieceStore *pieces.Store, usedSerials *usedserials.Table, config Config) *Service

NewService creates a new collector service.

func (*Service) Close added in v0.11.0

func (service *Service) Close() (err error)

Close stops the collector service.

func (*Service) Collect added in v0.11.0

func (service *Service) Collect(ctx context.Context, now time.Time) (err error)

Collect collects pieces that have expired by now.

func (*Service) Run added in v0.11.0

func (service *Service) Run(ctx context.Context) (err error)

Run runs collector service.

Jump to

Keyboard shortcuts

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