Documentation ¶
Index ¶
- Variables
- type Checker
- func (checker *Checker) Close() error
- func (checker *Checker) IdentifyInjuredSegments(ctx context.Context) (err error)
- func (checker *Checker) IrreparableProcess(ctx context.Context) (err error)
- func (checker *Checker) RefreshReliabilityCache(ctx context.Context) error
- func (checker *Checker) Run(ctx context.Context) (err error)
- type Config
- type ReliabilityCache
Constants ¶
This section is empty.
Variables ¶
var (
Error = errs.Class("checker error")
)
Error is a standard error class for this package.
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker struct { Loop sync2.Cycle IrreparableLoop sync2.Cycle // contains filtered or unexported fields }
Checker contains the information needed to do checks for missing pieces
func NewChecker ¶
func NewChecker(metainfo *metainfo.Service, repairQueue queue.RepairQueue, overlay *overlay.Cache, irrdb irreparable.DB, limit int, logger *zap.Logger, config Config) *Checker
NewChecker creates a new instance of checker
func (*Checker) IdentifyInjuredSegments ¶
IdentifyInjuredSegments checks for missing pieces off of the metainfo and overlay cache
func (*Checker) IrreparableProcess ¶ added in v0.13.0
IrreparableProcess picks items from irrepairabledb and spawns a repair worker
func (*Checker) RefreshReliabilityCache ¶ added in v0.14.9
RefreshReliabilityCache forces refreshing node online status cache.
type Config ¶
type Config struct { Interval time.Duration `help:"how frequently checker should check for bad segments" releaseDefault:"30s" devDefault:"0h0m10s"` IrreparableInterval time.Duration `help:"how frequently irrepairable checker should check for lost pieces" releaseDefault:"30m" devDefault:"0h0m5s"` ReliabilityCacheStaleness time.Duration `help:"how stale reliable node cache can be" releaseDefault:"5m" devDefault:"5m"` }
Config contains configurable values for checker
type ReliabilityCache ¶ added in v0.14.9
type ReliabilityCache struct {
// contains filtered or unexported fields
}
ReliabilityCache caches the reliable nodes for the specified staleness duration and updates automatically from overlay.
ReliabilityCache is NOT safe for concurrent use.
func NewReliabilityCache ¶ added in v0.14.9
func NewReliabilityCache(overlay *overlay.Cache, staleness time.Duration) *ReliabilityCache
NewReliabilityCache creates a new reliability checking cache.
func (*ReliabilityCache) LastUpdate ¶ added in v0.14.9
func (cache *ReliabilityCache) LastUpdate() time.Time
LastUpdate returns when the cache was last updated.
func (*ReliabilityCache) MissingPieces ¶ added in v0.14.9
func (cache *ReliabilityCache) MissingPieces(ctx context.Context, created time.Time, pieces []*pb.RemotePiece) ([]int32, error)
MissingPieces returns piece indices that are unreliable with the given staleness period.