Documentation ¶
Index ¶
- Constants
- Variables
- func LowestUtilizationWS(sh *Scheduler, queueLen int, acceptableWindows [][]int, windows []SchedWindow) int
- func SpreadWS(sh *Scheduler, queueLen int, acceptableWindows [][]int, windows []SchedWindow) int
- func WithPriority(ctx context.Context, priority int) context.Context
- type ActiveResources
- func (a *ActiveResources) Add(tt sealtasks.SealTaskType, wr storiface.WorkerResources, r storiface.Resources) float64
- func (a *ActiveResources) CanHandleRequest(tt sealtasks.SealTaskType, needRes storiface.Resources, wid storiface.WorkerID, ...) bool
- func (a *ActiveResources) Free(tt sealtasks.SealTaskType, wr storiface.WorkerResources, r storiface.Resources)
- type Assigner
- type AssignerCommon
- type Call
- type CallState
- type Config
- type EnvFunc
- type ExecutorFunc
- type FaultTracker
- type LocalWorker
- func (l *LocalWorker) AddPiece(ctx context.Context, sector storage.SectorRef, epcs []abi.UnpaddedPieceSize, ...) (storiface.CallID, error)
- func (l *LocalWorker) Close() error
- func (l *LocalWorker) DataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (storiface.CallID, error)
- func (l *LocalWorker) Fetch(ctx context.Context, sector storage.SectorRef, ...) (storiface.CallID, error)
- func (l *LocalWorker) FinalizeReplicaUpdate(ctx context.Context, sector storage.SectorRef, keepUnsealed []storage.Range) (storiface.CallID, error)
- func (l *LocalWorker) FinalizeSector(ctx context.Context, sector storage.SectorRef, keepUnsealed []storage.Range) (storiface.CallID, error)
- func (l *LocalWorker) GenerateSectorKeyFromData(ctx context.Context, sector storage.SectorRef, commD cid.Cid) (storiface.CallID, error)
- func (l *LocalWorker) GenerateWindowPoSt(ctx context.Context, ppt abi.RegisteredPoStProof, mid abi.ActorID, ...) (storiface.WindowPoStResult, error)
- func (l *LocalWorker) GenerateWinningPoSt(ctx context.Context, ppt abi.RegisteredPoStProof, mid abi.ActorID, ...) ([]proof.PoStProof, error)
- func (l *LocalWorker) Info(context.Context) (storiface.WorkerInfo, error)
- func (l *LocalWorker) MoveStorage(ctx context.Context, sector storage.SectorRef, types storiface.SectorFileType) (storiface.CallID, error)
- func (l *LocalWorker) NewSector(ctx context.Context, sector storage.SectorRef) error
- func (l *LocalWorker) Paths(ctx context.Context) ([]storiface.StoragePath, error)
- func (l *LocalWorker) ProveReplicaUpdate1(ctx context.Context, sector storage.SectorRef, ...) (storiface.CallID, error)
- func (l *LocalWorker) ProveReplicaUpdate2(ctx context.Context, sector storage.SectorRef, ...) (storiface.CallID, error)
- func (l *LocalWorker) ReleaseUnsealed(ctx context.Context, sector storage.SectorRef, safeToFree []storage.Range) (storiface.CallID, error)
- func (l *LocalWorker) Remove(ctx context.Context, sector abi.SectorID) error
- func (l *LocalWorker) ReplicaUpdate(ctx context.Context, sector storage.SectorRef, pieces []abi.PieceInfo) (storiface.CallID, error)
- func (l *LocalWorker) SealCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, ...) (storiface.CallID, error)
- func (l *LocalWorker) SealCommit2(ctx context.Context, sector storage.SectorRef, phase1Out storage.Commit1Out) (storiface.CallID, error)
- func (l *LocalWorker) SealPreCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, ...) (storiface.CallID, error)
- func (l *LocalWorker) SealPreCommit2(ctx context.Context, sector storage.SectorRef, phase1Out storage.PreCommit1Out) (storiface.CallID, error)
- func (l *LocalWorker) Session(ctx context.Context) (uuid.UUID, error)
- func (l *LocalWorker) TaskDisable(ctx context.Context, tt sealtasks.TaskType) error
- func (l *LocalWorker) TaskEnable(ctx context.Context, tt sealtasks.TaskType) error
- func (l *LocalWorker) TaskTypes(context.Context) (map[sealtasks.TaskType]struct{}, error)
- func (l *LocalWorker) UnsealPiece(ctx context.Context, sector storage.SectorRef, ...) (storiface.CallID, error)
- func (l *LocalWorker) WaitQuiet()
- type Manager
- func (m *Manager) Abort(ctx context.Context, call storiface.CallID) error
- func (m *Manager) AddLocalStorage(ctx context.Context, path string) error
- func (m *Manager) AddPiece(ctx context.Context, sector storage.SectorRef, ...) (abi.PieceInfo, error)
- func (m *Manager) AddWorker(ctx context.Context, w Worker) error
- func (m *Manager) CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef, ...) (map[abi.SectorID]string, error)
- func (m *Manager) Close(ctx context.Context) error
- func (m *Manager) DataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (abi.PieceInfo, error)
- func (m *Manager) FinalizeReplicaUpdate(ctx context.Context, sector storage.SectorRef, keepUnsealed []storage.Range) error
- func (m *Manager) FinalizeSector(ctx context.Context, sector storage.SectorRef, keepUnsealed []storage.Range) error
- func (m *Manager) FsStat(ctx context.Context, id storiface.ID) (fsutil.FsStat, error)
- func (m *Manager) GenerateSectorKeyFromData(ctx context.Context, sector storage.SectorRef, commD cid.Cid) error
- func (m *Manager) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, ...) (proof []proof.PoStProof, skipped []abi.SectorID, err error)
- func (m *Manager) GenerateWindowPoStWithVanilla(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, ...) (proof.PoStProof, error)
- func (m *Manager) GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID, ...) ([]proof.PoStProof, error)
- func (m *Manager) GenerateWinningPoStWithVanilla(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, ...) ([]proof.PoStProof, error)
- func (m *Manager) NewSector(ctx context.Context, sector storage.SectorRef) error
- func (m *Manager) ProveReplicaUpdate1(ctx context.Context, sector storage.SectorRef, ...) (out storage.ReplicaVanillaProofs, err error)
- func (m *Manager) ProveReplicaUpdate2(ctx context.Context, sector storage.SectorRef, ...) (out storage.ReplicaUpdateProof, err error)
- func (m *Manager) ReleaseReplicaUpgrade(ctx context.Context, sector storage.SectorRef) error
- func (m *Manager) ReleaseSectorKey(ctx context.Context, sector storage.SectorRef) error
- func (m *Manager) ReleaseUnsealed(ctx context.Context, sector storage.SectorRef, safeToFree []storage.Range) error
- func (m *Manager) Remove(ctx context.Context, sector storage.SectorRef) error
- func (m *Manager) ReplicaUpdate(ctx context.Context, sector storage.SectorRef, pieces []abi.PieceInfo) (out storage.ReplicaUpdateOut, err error)
- func (m *Manager) ReturnAddPiece(ctx context.Context, callID storiface.CallID, pi abi.PieceInfo, ...) error
- func (m *Manager) ReturnDataCid(ctx context.Context, callID storiface.CallID, pi abi.PieceInfo, ...) error
- func (m *Manager) ReturnFetch(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error
- func (m *Manager) ReturnFinalizeReplicaUpdate(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error
- func (m *Manager) ReturnFinalizeSector(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error
- func (m *Manager) ReturnGenerateSectorKeyFromData(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error
- func (m *Manager) ReturnMoveStorage(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error
- func (m *Manager) ReturnProveReplicaUpdate1(ctx context.Context, callID storiface.CallID, out storage.ReplicaVanillaProofs, ...) error
- func (m *Manager) ReturnProveReplicaUpdate2(ctx context.Context, callID storiface.CallID, proof storage.ReplicaUpdateProof, ...) error
- func (m *Manager) ReturnReadPiece(ctx context.Context, callID storiface.CallID, ok bool, ...) error
- func (m *Manager) ReturnReleaseUnsealed(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error
- func (m *Manager) ReturnReplicaUpdate(ctx context.Context, callID storiface.CallID, out storage.ReplicaUpdateOut, ...) error
- func (m *Manager) ReturnSealCommit1(ctx context.Context, callID storiface.CallID, out storage.Commit1Out, ...) error
- func (m *Manager) ReturnSealCommit2(ctx context.Context, callID storiface.CallID, proof storage.Proof, ...) error
- func (m *Manager) ReturnSealPreCommit1(ctx context.Context, callID storiface.CallID, p1o storage.PreCommit1Out, ...) error
- func (m *Manager) ReturnSealPreCommit2(ctx context.Context, callID storiface.CallID, sealed storage.SectorCids, ...) error
- func (m *Manager) ReturnUnsealPiece(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error
- func (m *Manager) SchedDiag(ctx context.Context, doSched bool) (interface{}, error)
- func (m *Manager) SealCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, ...) (out storage.Commit1Out, err error)
- func (m *Manager) SealCommit2(ctx context.Context, sector storage.SectorRef, phase1Out storage.Commit1Out) (out storage.Proof, err error)
- func (m *Manager) SealPreCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, ...) (out storage.PreCommit1Out, err error)
- func (m *Manager) SealPreCommit2(ctx context.Context, sector storage.SectorRef, phase1Out storage.PreCommit1Out) (out storage.SectorCids, err error)
- func (m *Manager) SectorsUnsealPiece(ctx context.Context, sector storage.SectorRef, ...) error
- func (m *Manager) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (m *Manager) StorageLocal(ctx context.Context) (map[storiface.ID]string, error)
- func (m *Manager) WorkerJobs() map[uuid.UUID][]storiface.WorkerJob
- func (m *Manager) WorkerStats(ctx context.Context) map[uuid.UUID]storiface.WorkerStats
- type ManagerStateStore
- type ManyBytes
- type PieceProvider
- type RequestQueue
- type ResourceFilteringStrategy
- type ReturnType
- type SchedDiagInfo
- type SchedDiagRequestInfo
- type SchedWindow
- type SchedWindowRequest
- type Scheduler
- type SectorManager
- type StorageAuth
- type Unsealer
- type WindowSelector
- type WorkID
- type WorkState
- type WorkStatus
- type Worker
- type WorkerAction
- type WorkerConfig
- type WorkerHandle
- type WorkerRequest
- type WorkerSelector
- type WorkerStateStore
Constants ¶
const ( // ResourceFilteringHardware specifies that available hardware resources // should be evaluated when scheduling a task against the worker. ResourceFilteringHardware = ResourceFilteringStrategy("hardware") // ResourceFilteringDisabled disables resource filtering against this // worker. The scheduler may assign any task to this worker. ResourceFilteringDisabled = ResourceFilteringStrategy("disabled") )
Variables ¶
var ClosedWorkerID = uuid.UUID{}
var DefaultSchedPriority = 0
var ErrNoWorkers = errors.New("no suitable workers found")
var InitWait = 3 * time.Second
var MaxPieceReaderBurnBytes int64 = 1 << 20 // 1M
For small read skips, it's faster to "burn" some bytes than to setup new sector reader. Assuming 1ms stream seek latency, and 1G/s stream rate, we're willing to discard up to 1 MiB.
var PostCheckTimeout = 160 * time.Second
var ReadBuf = 128 * (127 * 8) // unpadded(128k)
var SchedPriorityKey schedPrioCtxKey
var (
SchedWindows = 2
)
var SelectorTimeout = 5 * time.Second
Functions ¶
func LowestUtilizationWS ¶
func LowestUtilizationWS(sh *Scheduler, queueLen int, acceptableWindows [][]int, windows []SchedWindow) int
Types ¶
type ActiveResources ¶
type ActiveResources struct {
// contains filtered or unexported fields
}
func NewActiveResources ¶
func NewActiveResources() *ActiveResources
func (*ActiveResources) Add ¶
func (a *ActiveResources) Add(tt sealtasks.SealTaskType, wr storiface.WorkerResources, r storiface.Resources) float64
add task resources to ActiveResources and return utilization difference
func (*ActiveResources) CanHandleRequest ¶
func (a *ActiveResources) CanHandleRequest(tt sealtasks.SealTaskType, needRes storiface.Resources, wid storiface.WorkerID, caller string, info storiface.WorkerInfo) bool
CanHandleRequest evaluates if the worker has enough available resources to handle the request.
func (*ActiveResources) Free ¶
func (a *ActiveResources) Free(tt sealtasks.SealTaskType, wr storiface.WorkerResources, r storiface.Resources)
type Assigner ¶
type Assigner interface {
TrySched(sh *Scheduler)
}
func NewLowestUtilizationAssigner ¶
func NewLowestUtilizationAssigner() Assigner
func NewSpreadAssigner ¶
func NewSpreadAssigner() Assigner
type AssignerCommon ¶
type AssignerCommon struct {
WindowSel WindowSelector
}
AssignerCommon is a task assigner with customizable parts
func (*AssignerCommon) TrySched ¶
func (a *AssignerCommon) TrySched(sh *Scheduler)
type Call ¶
type Call struct { ID storiface.CallID RetType ReturnType State CallState Result *ManyBytes // json bytes }
type Config ¶
type Config struct { ParallelFetchLimit int // Local worker config AllowAddPiece bool AllowPreCommit1 bool AllowPreCommit2 bool AllowCommit bool AllowUnseal bool AllowReplicaUpdate bool AllowProveReplicaUpdate2 bool AllowRegenSectorKey bool // ResourceFiltering instructs the system which resource filtering strategy // to use when evaluating tasks against this worker. An empty value defaults // to "hardware". ResourceFiltering ResourceFilteringStrategy // PoSt config ParallelCheckLimit int DisallowRemoteFinalize bool Assigner string }
type ExecutorFunc ¶
type ExecutorFunc func() (ffiwrapper.Storage, error)
used do provide custom proofs impl (mostly used in testing)
type FaultTracker ¶
type FaultTracker interface {
CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef, rg storiface.RGetter) (map[abi.SectorID]string, error)
}
FaultTracker TODO: Track things more actively
type LocalWorker ¶
type LocalWorker struct {
// contains filtered or unexported fields
}
func NewLocalWorker ¶
func NewLocalWorker(wcfg WorkerConfig, store paths.Store, local *paths.Local, sindex paths.SectorIndex, ret storiface.WorkerReturn, cst *statestore.StateStore) *LocalWorker
func (*LocalWorker) AddPiece ¶
func (l *LocalWorker) AddPiece(ctx context.Context, sector storage.SectorRef, epcs []abi.UnpaddedPieceSize, sz abi.UnpaddedPieceSize, r io.Reader) (storiface.CallID, error)
func (*LocalWorker) Close ¶
func (l *LocalWorker) Close() error
func (*LocalWorker) DataCid ¶
func (l *LocalWorker) DataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (storiface.CallID, error)
func (*LocalWorker) Fetch ¶
func (l *LocalWorker) Fetch(ctx context.Context, sector storage.SectorRef, fileType storiface.SectorFileType, ptype storiface.PathType, am storiface.AcquireMode) (storiface.CallID, error)
func (*LocalWorker) FinalizeReplicaUpdate ¶
func (*LocalWorker) FinalizeSector ¶
func (*LocalWorker) GenerateSectorKeyFromData ¶
func (*LocalWorker) GenerateWindowPoSt ¶
func (l *LocalWorker) GenerateWindowPoSt(ctx context.Context, ppt abi.RegisteredPoStProof, mid abi.ActorID, sectors []storiface.PostSectorChallenge, partitionIdx int, randomness abi.PoStRandomness) (storiface.WindowPoStResult, error)
func (*LocalWorker) GenerateWinningPoSt ¶
func (l *LocalWorker) GenerateWinningPoSt(ctx context.Context, ppt abi.RegisteredPoStProof, mid abi.ActorID, sectors []storiface.PostSectorChallenge, randomness abi.PoStRandomness) ([]proof.PoStProof, error)
func (*LocalWorker) Info ¶
func (l *LocalWorker) Info(context.Context) (storiface.WorkerInfo, error)
func (*LocalWorker) MoveStorage ¶
func (l *LocalWorker) MoveStorage(ctx context.Context, sector storage.SectorRef, types storiface.SectorFileType) (storiface.CallID, error)
func (*LocalWorker) Paths ¶
func (l *LocalWorker) Paths(ctx context.Context) ([]storiface.StoragePath, error)
func (*LocalWorker) ProveReplicaUpdate1 ¶
func (*LocalWorker) ProveReplicaUpdate2 ¶
func (l *LocalWorker) ProveReplicaUpdate2(ctx context.Context, sector storage.SectorRef, sectorKey, newSealed, newUnsealed cid.Cid, vanillaProofs storage.ReplicaVanillaProofs) (storiface.CallID, error)
func (*LocalWorker) ReleaseUnsealed ¶
func (*LocalWorker) ReplicaUpdate ¶
func (*LocalWorker) SealCommit1 ¶
func (l *LocalWorker) SealCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storage.SectorCids) (storiface.CallID, error)
func (*LocalWorker) SealCommit2 ¶
func (l *LocalWorker) SealCommit2(ctx context.Context, sector storage.SectorRef, phase1Out storage.Commit1Out) (storiface.CallID, error)
func (*LocalWorker) SealPreCommit1 ¶
func (*LocalWorker) SealPreCommit2 ¶
func (l *LocalWorker) SealPreCommit2(ctx context.Context, sector storage.SectorRef, phase1Out storage.PreCommit1Out) (storiface.CallID, error)
func (*LocalWorker) TaskDisable ¶
func (*LocalWorker) TaskEnable ¶
func (*LocalWorker) UnsealPiece ¶
func (l *LocalWorker) UnsealPiece(ctx context.Context, sector storage.SectorRef, index storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, randomness abi.SealRandomness, cid cid.Cid) (storiface.CallID, error)
func (*LocalWorker) WaitQuiet ¶
func (l *LocalWorker) WaitQuiet()
WaitQuiet blocks as long as there are tasks running
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func New ¶
func New(ctx context.Context, lstor *paths.Local, stor paths.Store, ls paths.LocalStorage, si paths.SectorIndex, sc Config, wss WorkerStateStore, mss ManagerStateStore) (*Manager, error)
func (*Manager) AddLocalStorage ¶
func (*Manager) CheckProvable ¶
func (m *Manager) CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef, rg storiface.RGetter) (map[abi.SectorID]string, error)
CheckProvable returns unprovable sectors
func (*Manager) FinalizeReplicaUpdate ¶
func (*Manager) FinalizeSector ¶
func (*Manager) GenerateSectorKeyFromData ¶
func (*Manager) GenerateWindowPoSt ¶
func (*Manager) GenerateWindowPoStWithVanilla ¶
func (*Manager) GenerateWinningPoSt ¶
func (*Manager) GenerateWinningPoStWithVanilla ¶
func (*Manager) ProveReplicaUpdate1 ¶
func (*Manager) ProveReplicaUpdate2 ¶
func (m *Manager) ProveReplicaUpdate2(ctx context.Context, sector storage.SectorRef, sectorKey, newSealed, newUnsealed cid.Cid, vanillaProofs storage.ReplicaVanillaProofs) (out storage.ReplicaUpdateProof, err error)
func (*Manager) ReleaseReplicaUpgrade ¶
func (*Manager) ReleaseSectorKey ¶
func (*Manager) ReleaseUnsealed ¶
func (*Manager) ReplicaUpdate ¶
func (*Manager) ReturnAddPiece ¶
func (*Manager) ReturnDataCid ¶
func (*Manager) ReturnFetch ¶
func (*Manager) ReturnFinalizeReplicaUpdate ¶
func (*Manager) ReturnFinalizeSector ¶
func (*Manager) ReturnGenerateSectorKeyFromData ¶
func (*Manager) ReturnMoveStorage ¶
func (*Manager) ReturnProveReplicaUpdate1 ¶
func (*Manager) ReturnProveReplicaUpdate2 ¶
func (*Manager) ReturnReadPiece ¶
func (*Manager) ReturnReleaseUnsealed ¶
func (*Manager) ReturnReplicaUpdate ¶
func (*Manager) ReturnSealCommit1 ¶
func (*Manager) ReturnSealCommit2 ¶
func (*Manager) ReturnSealPreCommit1 ¶
func (*Manager) ReturnSealPreCommit2 ¶
func (*Manager) ReturnUnsealPiece ¶
func (*Manager) SealCommit1 ¶
func (m *Manager) SealCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storage.SectorCids) (out storage.Commit1Out, err error)
func (*Manager) SealCommit2 ¶
func (*Manager) SealPreCommit1 ¶
func (*Manager) SealPreCommit2 ¶
func (m *Manager) SealPreCommit2(ctx context.Context, sector storage.SectorRef, phase1Out storage.PreCommit1Out) (out storage.SectorCids, err error)
func (*Manager) SectorsUnsealPiece ¶
func (m *Manager) SectorsUnsealPiece(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed *cid.Cid) error
SectorsUnsealPiece will Unseal the Sealed sector file for the given sector. It will schedule the Unsealing task on a worker that either already has the sealed sector files or has space in one of it's sealing scratch spaces to store them after fetching them from another worker. If the chosen worker already has the Unsealed sector file, we will NOT Unseal the sealed sector file again.
func (*Manager) StorageLocal ¶
func (*Manager) WorkerStats ¶
type ManagerStateStore ¶
type ManagerStateStore *statestore.StateStore
type ManyBytes ¶
type ManyBytes struct {
// contains filtered or unexported fields
}
Ideally this would be a tag on the struct field telling cbor-gen to enforce higher max-len
type PieceProvider ¶
type PieceProvider interface { // ReadPiece is used to read an Unsealed piece at the given offset and of the given size from a Sector // pieceOffset + pieceSize specify piece bounds for unsealing (note: with SDR the entire sector will be unsealed by // default in most cases, but this might matter with future PoRep) // startOffset is added to the pieceOffset to get the starting reader offset. // The number of bytes that can be read is pieceSize-startOffset ReadPiece(ctx context.Context, sector storage.SectorRef, pieceOffset storiface.UnpaddedByteIndex, pieceSize abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) (mount.Reader, bool, error) IsUnsealed(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (bool, error) }
func NewPieceProvider ¶
func NewPieceProvider(storage *paths.Remote, index paths.SectorIndex, uns Unsealer) PieceProvider
type RequestQueue ¶
type RequestQueue []*WorkerRequest
func (RequestQueue) Len ¶
func (q RequestQueue) Len() int
func (RequestQueue) Less ¶
func (q RequestQueue) Less(i, j int) bool
func (*RequestQueue) Push ¶
func (q *RequestQueue) Push(x *WorkerRequest)
func (*RequestQueue) Remove ¶
func (q *RequestQueue) Remove(i int) *WorkerRequest
func (RequestQueue) Swap ¶
func (q RequestQueue) Swap(i, j int)
type ResourceFilteringStrategy ¶
type ResourceFilteringStrategy string
ResourceFilteringStrategy is an enum indicating the kinds of resource filtering strategies that can be configured for workers.
type ReturnType ¶
type ReturnType string
const ( DataCid ReturnType = "DataCid" AddPiece ReturnType = "AddPiece" SealPreCommit1 ReturnType = "SealPreCommit1" SealPreCommit2 ReturnType = "SealPreCommit2" SealCommit1 ReturnType = "SealCommit1" SealCommit2 ReturnType = "SealCommit2" FinalizeSector ReturnType = "FinalizeSector" FinalizeReplicaUpdate ReturnType = "FinalizeReplicaUpdate" ReplicaUpdate ReturnType = "ReplicaUpdate" ProveReplicaUpdate1 ReturnType = "ProveReplicaUpdate1" ProveReplicaUpdate2 ReturnType = "ProveReplicaUpdate2" GenerateSectorKey ReturnType = "GenerateSectorKey" ReleaseUnsealed ReturnType = "ReleaseUnsealed" MoveStorage ReturnType = "MoveStorage" UnsealPiece ReturnType = "UnsealPiece" Fetch ReturnType = "Fetch" )
type SchedDiagInfo ¶
type SchedDiagInfo struct { Requests []SchedDiagRequestInfo OpenWindows []string }
type SchedDiagRequestInfo ¶
type SchedWindow ¶
type SchedWindow struct { Allocated ActiveResources Todo []*WorkerRequest }
type SchedWindowRequest ¶
type SchedWindowRequest struct { Worker storiface.WorkerID Done chan *SchedWindow }
type Scheduler ¶
type Scheduler struct { Workers map[storiface.WorkerID]*WorkerHandle // owned by the sh.runSched goroutine SchedQueue *RequestQueue OpenWindows []*SchedWindowRequest // contains filtered or unexported fields }
func (*Scheduler) Schedule ¶
func (sh *Scheduler) Schedule(ctx context.Context, sector storage.SectorRef, taskType sealtasks.TaskType, sel WorkerSelector, prepare WorkerAction, work WorkerAction) error
type SectorManager ¶
type SectorManager interface { ffiwrapper.StorageSealer storage.Prover storiface.WorkerReturn FaultTracker }
type StorageAuth ¶
type Unsealer ¶
type Unsealer interface { // SectorsUnsealPiece will Unseal a Sealed sector file for the given sector. SectorsUnsealPiece(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, randomness abi.SealRandomness, commd *cid.Cid) error }
type WindowSelector ¶
type WindowSelector func(sh *Scheduler, queueLen int, acceptableWindows [][]int, windows []SchedWindow) int
type WorkState ¶
type WorkStatus ¶
type WorkStatus string
type Worker ¶
type Worker interface { storiface.WorkerCalls TaskTypes(context.Context) (map[sealtasks.TaskType]struct{}, error) // Returns paths accessible to the worker Paths(context.Context) ([]storiface.StoragePath, error) Info(context.Context) (storiface.WorkerInfo, error) Session(context.Context) (uuid.UUID, error) Close() error // TODO: do we need this? }
type WorkerConfig ¶
type WorkerConfig struct { TaskTypes []sealtasks.TaskType NoSwap bool // IgnoreResourceFiltering enables task distribution to happen on this // worker regardless of its currently available resources. Used in testing // with the local worker. IgnoreResourceFiltering bool MaxParallelChallengeReads int // 0 = no limit ChallengeReadTimeout time.Duration // 0 = no timeout }
type WorkerHandle ¶
type WorkerHandle struct { Info storiface.WorkerInfo Enabled bool // contains filtered or unexported fields }
func (*WorkerHandle) Utilization ¶
func (wh *WorkerHandle) Utilization() float64
type WorkerRequest ¶
type WorkerRequest struct { Sector storage.SectorRef TaskType sealtasks.TaskType Priority int // larger values more important Sel WorkerSelector IndexHeap int Ctx context.Context // contains filtered or unexported fields }
func (*WorkerRequest) SealTask ¶
func (r *WorkerRequest) SealTask() sealtasks.SealTaskType
type WorkerSelector ¶
type WorkerSelector interface { // Ok is true if worker is acceptable for performing a task. // If any worker is preferred for a task, other workers won't be considered for that task. Ok(ctx context.Context, task sealtasks.TaskType, spt abi.RegisteredSealProof, a *WorkerHandle) (ok, preferred bool, err error) Cmp(ctx context.Context, task sealtasks.TaskType, a, b *WorkerHandle) (bool, error) // true if a is preferred over b }
type WorkerStateStore ¶
type WorkerStateStore *statestore.StateStore
Source Files ¶
- cbor_gen.go
- cgroups_linux.go
- faults.go
- manager.go
- manager_calltracker.go
- manager_post.go
- piece_provider.go
- piece_reader.go
- request_queue.go
- roprov.go
- sched.go
- sched_assigner_common.go
- sched_assigner_spread.go
- sched_assigner_utilization.go
- sched_post.go
- sched_resources.go
- sched_worker.go
- selector_alloc.go
- selector_existing.go
- selector_move.go
- selector_task.go
- stats.go
- worker_calltracker.go
- worker_local.go
- worker_tracked.go