lib

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0, MIT Imports: 14 Imported by: 1

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

type IndexBackedBlockstoreDagstore struct {
	dagstore.Interface
}

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 (*ShardSelector) ShardSelectorF

func (s *ShardSelector) ShardSelectorF(c cid.Cid, shards []shard.Key) (shard.Key, error)

ShardSelectorF chooses the first shard that is unsealed and free (zero cost)

Jump to

Keyboard shortcuts

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