collector

package
v1.77.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 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"`
}

Config defines parameters for storage node Collector.

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, pieces *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