Documentation ¶
Index ¶
- type Backend
- type Chore
- func (chore *Chore) Close() (err error)
- func (chore *Chore) Run(ctx context.Context) (err error)
- func (chore *Chore) SetMigrate(sat storj.NodeID, migrate, activeMigration bool)
- func (chore *Chore) Stats(cb func(key monkit.SeriesKey, field string, val float64))
- func (chore *Chore) TryMigrateOne(sat storj.NodeID, piece storj.PieceID)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶ added in v1.120.1
type Backend interface { Writer(context.Context, storj.NodeID, storj.PieceID, pb.PieceHashAlgorithm) (*pieces.Writer, error) Reader(context.Context, storj.NodeID, storj.PieceID) (*pieces.Reader, error) WalkSatellitePieces(context.Context, storj.NodeID, func(pieces.StoredPieceAccess) error) error Delete(context.Context, storj.NodeID, storj.PieceID) error }
Backend is the minimal interface that the old piece backend needs to implement for the migration to work.
TODO(artur): make at least OldPieceBackend implement this interface, or give up and just put the pieces' type for the old backend.
type Chore ¶
Chore migrates pieces.
architecture: Chore
func NewChore ¶
func NewChore(log *zap.Logger, config Config, store *satstore.SatelliteStore, old Backend, new piecestore.PieceBackend) *Chore
NewChore initializes and returns a new Chore instance.
func (*Chore) Close ¶
Close shuts down the chore's loop and releases associated resources. Always returns nil.
func (*Chore) SetMigrate ¶
SetMigrate enables or disables migration for the given satellite. If migrate is true, adds the satellite with its migration status to the active set; otherwise, removes it.
type Config ¶
type Config struct { BufferSize int `help:"how many pieces to buffer" default:"1"` Delay time.Duration `help:"constant delay between migration of two pieces. 0 means no delay" default:"0"` Jitter bool `help:"whether to add jitter to the delay; has no effect if delay is 0" default:"true"` Interval time.Duration `help:"how long to wait between pooling satellites for active migration" default:"10m"` MigrateRegardless bool `help:"whether to also migrate pieces for satellites outside currently set" default:"false"` MigrateExpired bool `help:"whether to also migrate expired pieces" default:"true"` DeleteExpired bool `help:"whether to also delete expired pieces; has no effect if expired are migrated" default:"true"` }
Config defines the configuration for the chore.