expireddeletion

package
v1.76.0-rc Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package expireddeletion contains the functions needed to run expired segment deletion

The expireddeletion.expiredDeleter implements the metainfo loop Observer interface allowing us to subscribe to the loop to get information for every segment in the metainfo database.

The expireddeletion chore will subscribe the deleter to the metainfo loop and delete any expired segments from metainfo.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Error defines the expireddeletion chore errors class.
	Error = errs.Class("expired deletion")
)

Functions

This section is empty.

Types

type Chore

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

Chore implements the expired segment cleanup chore.

architecture: Chore

func NewChore

func NewChore(log *zap.Logger, config Config, metabase *metabase.DB) *Chore

NewChore creates a new instance of the expireddeletion chore.

func (*Chore) Close added in v1.26.2

func (chore *Chore) Close() error

Close stops the expireddeletion chore.

func (*Chore) Run

func (chore *Chore) Run(ctx context.Context) (err error)

Run starts the expireddeletion loop service.

func (*Chore) SetNow added in v1.26.2

func (chore *Chore) SetNow(nowFn func() time.Time)

SetNow allows tests to have the server act as if the current time is whatever they want.

type Config

type Config struct {
	Interval  time.Duration `` /* 153-byte string literal not displayed */
	Enabled   bool          `help:"set if expired segment cleanup is enabled or not" releaseDefault:"true" devDefault:"true"`
	ListLimit int           `help:"how many expired objects to query in a batch" default:"100"`
}

Config contains configurable values for expired segment cleanup.

Jump to

Keyboard shortcuts

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