Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewIndexBackedBlockstoreDagstore ¶ added in v1.6.1
func NewIndexBackedBlockstoreDagstore(ds dagstore.Interface) indexbs.IdxBstoreDagstore
Types ¶
type IndexBackedBlockstoreDagstore ¶ added in v1.6.1
IndexBackedBlockstoreDagstore implements the dagstore interface needed by the IndexBackedBlockstore. The implementation of ShardsContainingCid handles identity cids.
func (*IndexBackedBlockstoreDagstore) ShardsContainingCid ¶ added in v1.6.1
func (i *IndexBackedBlockstoreDagstore) ShardsContainingCid(ctx context.Context, c cid.Cid) ([]shard.Key, error)
ShardsContainingCid checks the dagstore for shards containing the given cid. If there are no shards with that cid, it checks if the shard is an identity cid, and gets the shards containing the identity cid's child cids. This is for the case where the identity cid was not stored in the original CAR file's index (but the identity cid's child cids are in the index).
type ShardSelector ¶
type ShardSelector struct {
// contains filtered or unexported fields
}
ShardSelector is used by the dagstore's index-backed blockstore to select the best shard from which to retrieve a particular cid. It chooses the first shard that is unsealed and free (zero cost). It caches the results per-shard.
func NewShardSelector ¶
func NewShardSelector(ctx context.Context, ps piecestore.PieceStore, sa retrievalmarket.SectorAccessor, rp retrievalmarket.RetrievalProvider) (*ShardSelector, error)
func (*ShardSelector) ShardSelectorF ¶
ShardSelectorF chooses the first shard that is unsealed and free (zero cost)