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(logger *zap.Logger, repairQueue queue.RepairQueue, irrdb irreparable.DB, metainfo *metainfo.Service, metaLoop *metainfo.Loop, overlay *overlay.Service, config Config) *Checker
NewChecker creates a new instance of checker
func (*Checker) IdentifyInjuredSegments ¶
IdentifyInjuredSegments checks for missing pieces off of the metainfo and overlay.
func (*Checker) IrreparableProcess ¶
IrreparableProcess iterates over all items in the irreparabledb. If an item can now be repaired then it is added to a worker queue.
func (*Checker) RefreshReliabilityCache ¶
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 ¶
type ReliabilityCache struct {
// contains filtered or unexported fields
}
ReliabilityCache caches the reliable nodes for the specified staleness duration and updates automatically from overlay.
func NewReliabilityCache ¶
func NewReliabilityCache(overlay *overlay.Service, staleness time.Duration) *ReliabilityCache
NewReliabilityCache creates a new reliability checking cache.
func (*ReliabilityCache) LastUpdate ¶
func (cache *ReliabilityCache) LastUpdate() time.Time
LastUpdate returns when the cache was last updated.
func (*ReliabilityCache) MissingPieces ¶
func (cache *ReliabilityCache) MissingPieces(ctx context.Context, created time.Time, pieces []*pb.RemotePiece) (_ []int32, err error)
MissingPieces returns piece indices that are unreliable with the given staleness period.