pieceprovider

package
v1.24.3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0, MIT Imports: 16 Imported by: 0

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

Jump to

Keyboard shortcuts

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