Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MaxPieceReaderBurnBytes int64 = 1 << 20 // 1M
MaxPieceReaderBurnBytes - For small read skips, it's faster to "burn" some bytes than to set up new sector reader. Assuming 1ms stream seek latency, and 1G/s stream rate, we're willing to discard up to 1 MiB.
var MinRandomReadSize = int64(1 << 20)
var ReadBuf = 128 * (127 * 8) // unpadded(128k)
Functions ¶
This section is empty.
Types ¶
type PieceParkReader ¶ added in v1.25.1
type PieceParkReader struct {
// contains filtered or unexported fields
}
func NewPieceParkReader ¶ added in v1.25.1
func NewPieceParkReader(storage *paths.Remote, index paths.SectorIndex) *PieceParkReader
type SectorReader ¶ added in v1.25.1
type SectorReader struct {
// contains filtered or unexported fields
}
func NewSectorReader ¶ added in v1.25.1
func NewSectorReader(storage *paths.Remote, index paths.SectorIndex) *SectorReader
func (*SectorReader) IsUnsealed ¶ added in v1.25.1
func (p *SectorReader) IsUnsealed(ctx context.Context, sector storiface.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (bool, error)
IsUnsealed checks if we have the unsealed piece at the given offset in an already existing unsealed file either locally or on any of the workers.
func (*SectorReader) ReadPiece ¶ added in v1.25.1
func (p *SectorReader) ReadPiece(ctx context.Context, sector storiface.SectorRef, pieceOffset storiface.UnpaddedByteIndex, pieceSize abi.UnpaddedPieceSize, pc cid.Cid) (storiface.Reader, error)
ReadPiece will try to read the unsealed piece from an existing unsealed sector file for the given sector from any worker that has it. It will NOT try to schedule an Unseal of a sealed sector file for the read.
Returns a nil reader if the piece does NOT exist in any unsealed file or there is no unsealed file for the given sector on any of the workers.