dagstore

package
v1.16.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: Apache-2.0, MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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(context.Context, cid.Cid) error

func (*Blockstore) Put

func (*Blockstore) PutMany

func (b *Blockstore) PutMany(context.Context, []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) (mount.Reader, 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, unsealConcurrency int) MinerAPI

type SectorAccessor added in v1.13.2

type SectorAccessor interface {
	retrievalmarket.SectorAccessor

	UnsealSectorAt(ctx context.Context, sectorID abi.SectorNumber, pieceOffset abi.UnpaddedPieceSize, length abi.UnpaddedPieceSize) (mount.Reader, error)
}

type Wrapper

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

func NewDAGStore

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

func (*Wrapper) Close

func (w *Wrapper) Close() error

func (*Wrapper) GetIterableIndexForPiece added in v1.15.1

func (w *Wrapper) GetIterableIndexForPiece(pieceCid cid.Cid) (carindex.IterableIndex, error)

func (*Wrapper) GetPiecesContainingBlock added in v1.15.1

func (w *Wrapper) GetPiecesContainingBlock(blockCID cid.Cid) ([]cid.Cid, error)

Get all the pieces that contain a block

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