Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chore ¶
type Chore struct {
Loop *sync2.Cycle
// contains filtered or unexported fields
}
Chore migrates pieces.
architecture: Chore
func NewChore ¶
func NewChore(log *zap.Logger, config Config, old, new piecestore.PieceBackend) *Chore
NewChore initializes and returns a new Chore instance.
func (*Chore) Close ¶
func (chore *Chore) Close() (err error)
Close shuts down the chore's loop and releases associated resources. Always returns nil.
func (*Chore) Run ¶
func (chore *Chore) Run(ctx context.Context) (err error)
Run starts the chore loop to migrate pieces based on the configuration.
func (*Chore) RunOnce ¶
func (chore *Chore) RunOnce(ctx context.Context) (err error)
RunOnce executes a single iteration of the chore to migrate pieces based on the configuration.
func (*Chore) SetMigrate ¶
func (chore *Chore) SetMigrate(sat storj.NodeID, migrate bool)
SetMigrate enables or disables migration for the given satellite. Adds the satellite to the active set if migrate is true; otherwise, removes it.
func (*Chore) TryMigrateOne ¶
func (chore *Chore) TryMigrateOne(sat storj.NodeID, piece storj.PieceID)
TryMigrateOne enqueues a migration item for the given satellite and piece if the queue has capacity. Fails silently if the queue is full.