pieceprovider

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 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 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

func (*PieceParkReader) ReadPiece added in v1.25.1

func (p *PieceParkReader) ReadPiece(ctx context.Context, pieceParkID storiface.PieceNumber, pieceSize int64, pc cid.Cid) (storiface.Reader, error)

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

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.

Jump to

Keyboard shortcuts

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