Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
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.
View Source
var MinRandomReadSize = int64(1 << 20)
View Source
var ReadBuf = 128 * (127 * 8) // unpadded(128k)
Functions ¶
This section is empty.
Types ¶
type PieceProvider ¶
type PieceProvider struct {
// contains filtered or unexported fields
}
func NewPieceProvider ¶
func NewPieceProvider(storage *paths.Remote, index paths.SectorIndex) *PieceProvider
func (*PieceProvider) ReadPiece ¶
func (p *PieceProvider) ReadPiece(ctx context.Context, sector storiface.SectorRef, pieceOffset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, pieceCid cid.Cid) (storiface.Reader, error)
ReadPiece is used to read an Unsealed piece at the given offset and of the given size from a Sector If an Unsealed sector file exists with the Piece Unsealed in it, we'll use that for the read. Otherwise, an error is returned
Click to show internal directories.
Click to hide internal directories.