dagstore

package
v1.13.2-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: Apache-2.0, MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxPieceReaderBurnBytes int64 = 1 << 20 // 1M

For small read skips, it's faster to "burn" some bytes than to setup 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 ReadBuf = 128 * (127 * 8) // unpadded(128k)

Functions

This section is empty.

Types

type Blockstore

type Blockstore struct {
	dagstore.ReadBlockstore
	io.Closer
}

Blockstore promotes a dagstore.ReadBlockstore to a full closeable Blockstore, stubbing out the write methods with erroring implementations.

func (*Blockstore) DeleteBlock

func (b *Blockstore) DeleteBlock(c cid.Cid) error

func (*Blockstore) Put

func (b *Blockstore) Put(block blocks.Block) error

func (*Blockstore) PutMany

func (b *Blockstore) PutMany(blocks []blocks.Block) error

type LotusMount

type LotusMount struct {
	API      MinerAPI
	PieceCid cid.Cid
}

LotusMount is a DAGStore mount implementation that fetches deal data from a PieceCID.

func NewLotusMount

func NewLotusMount(pieceCid cid.Cid, api MinerAPI) (*LotusMount, error)

func (*LotusMount) Close

func (l *LotusMount) Close() error

func (*LotusMount) Deserialize

func (l *LotusMount) Deserialize(u *url.URL) error

func (*LotusMount) Fetch

func (l *LotusMount) Fetch(ctx context.Context) (mount.Reader, error)

func (*LotusMount) Info

func (l *LotusMount) Info() mount.Info

func (*LotusMount) Serialize

func (l *LotusMount) Serialize() *url.URL

func (*LotusMount) Stat

func (l *LotusMount) Stat(ctx context.Context) (mount.Stat, error)

type MinerAPI

type MinerAPI interface {
	FetchUnsealedPiece(ctx context.Context, pieceCid cid.Cid, offset uint64) (io.ReadCloser, abi.UnpaddedPieceSize, error)
	GetUnpaddedCARSize(ctx context.Context, pieceCid cid.Cid) (uint64, error)
	IsUnsealed(ctx context.Context, pieceCid cid.Cid) (bool, error)
	Start(ctx context.Context) error
}

func NewMinerAPI

func NewMinerAPI(store piecestore.PieceStore, sa SectorAccessor, concurrency int) MinerAPI

type SectorAccessor added in v1.13.2

type SectorAccessor interface {
	retrievalmarket.SectorAccessor

	UnsealSectorAt(ctx context.Context, sectorID abi.SectorNumber, pieceOffset abi.UnpaddedPieceSize, startOffset uint64, length abi.UnpaddedPieceSize) (io.ReadCloser, error)
}

type Wrapper

type Wrapper struct {
	// contains filtered or unexported fields
}

func NewDAGStore

func NewDAGStore(cfg config.DAGStoreConfig, minerApi MinerAPI) (*dagstore.DAGStore, *Wrapper, error)

func (*Wrapper) Close

func (w *Wrapper) Close() error

func (*Wrapper) LoadShard

func (w *Wrapper) LoadShard(ctx context.Context, pieceCid cid.Cid) (stores.ClosableBlockstore, error)

func (*Wrapper) MigrateDeals

func (w *Wrapper) MigrateDeals(ctx context.Context, deals []storagemarket.MinerDeal) (bool, error)

func (*Wrapper) RegisterShard

func (w *Wrapper) RegisterShard(ctx context.Context, pieceCid cid.Cid, carPath string, eagerInit bool, resch chan dagstore.ShardResult) error

func (*Wrapper) Start

func (w *Wrapper) Start(ctx context.Context) error

Directories

Path Synopsis
Package mock_dagstore is a generated GoMock package.
Package mock_dagstore is a generated GoMock package.

Jump to

Keyboard shortcuts

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