storiface

package
v1.10.0-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2021 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RWRetWait  = -1
	RWReturned = -2
	RWRetDone  = -3
)
View Source
const FSOverheadDen = 10

Variables

View Source
var ErrSectorNotFound = errors.New("sector not found")

Functions

func ParseSectorID added in v1.1.3

func ParseSectorID(baseName string) (abi.SectorID, error)

func PathByType added in v1.1.3

func PathByType(sps SectorPaths, fileType SectorFileType) string

func SectorName added in v1.1.3

func SectorName(sid abi.SectorID) string

func SetPathByType added in v1.1.3

func SetPathByType(sps *SectorPaths, fileType SectorFileType, p string)

Types

type AcquireMode added in v1.1.3

type AcquireMode string
const (
	AcquireMove AcquireMode = "move"
	AcquireCopy AcquireMode = "copy"
)

type CallError added in v1.2.0

type CallError struct {
	Code    ErrorCode
	Message string
	// contains filtered or unexported fields
}

func Err added in v1.2.0

func Err(code ErrorCode, sub error) *CallError

func (*CallError) Error added in v1.2.0

func (c *CallError) Error() string

func (*CallError) Unwrap added in v1.2.0

func (c *CallError) Unwrap() error

type CallID added in v1.1.3

type CallID struct {
	Sector abi.SectorID
	ID     uuid.UUID
}
var UndefCall CallID

func (*CallID) MarshalCBOR added in v1.1.3

func (t *CallID) MarshalCBOR(w io.Writer) error

func (CallID) String added in v1.1.3

func (c CallID) String() string

func (*CallID) UnmarshalCBOR added in v1.1.3

func (t *CallID) UnmarshalCBOR(r io.Reader) error

type ErrorCode added in v1.2.0

type ErrorCode int
const (
	// Temp Errors
	ErrTempUnknown ErrorCode = iota + 100
	ErrTempWorkerRestart
	ErrTempAllocateSpace
)
const (
	ErrUnknown ErrorCode = iota
)

type PaddedByteIndex

type PaddedByteIndex uint64

type PathType added in v1.1.3

type PathType string
const (
	PathStorage PathType = "storage"
	PathSealing PathType = "sealing"
)

type RGetter added in v1.2.2

type RGetter func(ctx context.Context, id abi.SectorID) (cid.Cid, error)

type SectorFileType added in v1.1.3

type SectorFileType int
const (
	FTUnsealed SectorFileType = 1 << iota
	FTSealed
	FTCache

	FileTypes = iota
)
const (
	FTNone SectorFileType = 0
)

func (SectorFileType) All added in v1.1.3

func (t SectorFileType) All() [FileTypes]bool

func (SectorFileType) Has added in v1.1.3

func (t SectorFileType) Has(singleType SectorFileType) bool

func (SectorFileType) SealSpaceUse added in v1.1.3

func (t SectorFileType) SealSpaceUse(ssize abi.SectorSize) (uint64, error)

func (SectorFileType) String added in v1.1.3

func (t SectorFileType) String() string

type SectorPaths added in v1.1.3

type SectorPaths struct {
	ID abi.SectorID

	Unsealed string
	Sealed   string
	Cache    string
}

type UnpaddedByteIndex

type UnpaddedByteIndex uint64

func (UnpaddedByteIndex) Padded

type WorkerCalls added in v1.1.3

type WorkerCalls interface {
	AddPiece(ctx context.Context, sector storage.SectorRef, pieceSizes []abi.UnpaddedPieceSize, newPieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (CallID, error)
	SealPreCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, pieces []abi.PieceInfo) (CallID, error)
	SealPreCommit2(ctx context.Context, sector storage.SectorRef, pc1o storage.PreCommit1Out) (CallID, error)
	SealCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storage.SectorCids) (CallID, error)
	SealCommit2(ctx context.Context, sector storage.SectorRef, c1o storage.Commit1Out) (CallID, error)
	FinalizeSector(ctx context.Context, sector storage.SectorRef, keepUnsealed []storage.Range) (CallID, error)
	ReleaseUnsealed(ctx context.Context, sector storage.SectorRef, safeToFree []storage.Range) (CallID, error)
	MoveStorage(ctx context.Context, sector storage.SectorRef, types SectorFileType) (CallID, error)
	UnsealPiece(context.Context, storage.SectorRef, UnpaddedByteIndex, abi.UnpaddedPieceSize, abi.SealRandomness, cid.Cid) (CallID, error)
	ReadPiece(context.Context, io.Writer, storage.SectorRef, UnpaddedByteIndex, abi.UnpaddedPieceSize) (CallID, error)
	Fetch(context.Context, storage.SectorRef, SectorFileType, PathType, AcquireMode) (CallID, error)
}

type WorkerInfo

type WorkerInfo struct {
	Hostname string

	Resources WorkerResources
}

type WorkerJob

type WorkerJob struct {
	ID     CallID
	Sector abi.SectorID
	Task   sealtasks.TaskType

	// 1+ - assigned
	// 0  - running
	// -1 - ret-wait
	// -2 - returned
	// -3 - ret-done
	RunWait int
	Start   time.Time

	Hostname string `json:",omitempty"` // optional, set for ret-wait jobs
}

type WorkerResources

type WorkerResources struct {
	MemPhysical uint64
	MemSwap     uint64

	MemReserved uint64 // Used by system / other processes

	CPUs uint64 // Logical cores
	GPUs []string
}

type WorkerReturn added in v1.1.3

type WorkerReturn interface {
	ReturnAddPiece(ctx context.Context, callID CallID, pi abi.PieceInfo, err *CallError) error
	ReturnSealPreCommit1(ctx context.Context, callID CallID, p1o storage.PreCommit1Out, err *CallError) error
	ReturnSealPreCommit2(ctx context.Context, callID CallID, sealed storage.SectorCids, err *CallError) error
	ReturnSealCommit1(ctx context.Context, callID CallID, out storage.Commit1Out, err *CallError) error
	ReturnSealCommit2(ctx context.Context, callID CallID, proof storage.Proof, err *CallError) error
	ReturnFinalizeSector(ctx context.Context, callID CallID, err *CallError) error
	ReturnReleaseUnsealed(ctx context.Context, callID CallID, err *CallError) error
	ReturnMoveStorage(ctx context.Context, callID CallID, err *CallError) error
	ReturnUnsealPiece(ctx context.Context, callID CallID, err *CallError) error
	ReturnReadPiece(ctx context.Context, callID CallID, ok bool, err *CallError) error
	ReturnFetch(ctx context.Context, callID CallID, err *CallError) error
}

type WorkerStats

type WorkerStats struct {
	Info    WorkerInfo
	Enabled bool

	MemUsedMin uint64
	MemUsedMax uint64
	GpuUsed    bool   // nolint
	CpuUse     uint64 // nolint
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL