Documentation ¶
Index ¶
- Variables
- type BadgerMarkSet
- type BadgerMarkSetEnv
- type ChainAccessor
- type Config
- type MapMarkSet
- type MapMarkSetEnv
- type MarkSet
- type MarkSetEnv
- type MarkSetVisitor
- type ObjectVisitor
- type SplitStore
- func (s *SplitStore) AddProtector(protector func(func(cid.Cid) error) error)
- func (s *SplitStore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
- func (s *SplitStore) Check() error
- func (s *SplitStore) Close() error
- func (s *SplitStore) DeleteBlock(_ cid.Cid) error
- func (s *SplitStore) DeleteMany(_ []cid.Cid) error
- func (s *SplitStore) Expose() bstore.Blockstore
- func (s *SplitStore) Get(cid cid.Cid) (blocks.Block, error)
- func (s *SplitStore) GetSize(cid cid.Cid) (int, error)
- func (s *SplitStore) Has(cid cid.Cid) (bool, error)
- func (s *SplitStore) HashOnRead(enabled bool)
- func (s *SplitStore) HeadChange(_, apply []*types.TipSet) error
- func (s *SplitStore) Info() map[string]interface{}
- func (s *SplitStore) Put(blk blocks.Block) error
- func (s *SplitStore) PutMany(blks []blocks.Block) error
- func (s *SplitStore) Start(chain ChainAccessor) error
- func (s *SplitStore) View(cid cid.Cid, cb func([]byte) error) error
Constants ¶
This section is empty.
Variables ¶
var ( // CompactionThreshold is the number of epochs that need to have elapsed // from the previously compacted epoch to trigger a new compaction. // // |················· CompactionThreshold ··················| // | | // =======‖≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡‖------------------------» // | | chain --> ↑__ current epoch // | archived epochs ___↑ // ↑________ CompactionBoundary // // === :: cold (already archived) // ≡≡≡ :: to be archived in this compaction // --- :: hot CompactionThreshold = 5 * build.Finality // CompactionBoundary is the number of epochs from the current epoch at which // we will walk the chain for live objects. CompactionBoundary = 4 * build.Finality // SyncGapTime is the time delay from a tipset's min timestamp before we decide // there is a sync gap SyncGapTime = time.Minute )
var ( // WarmupBoundary is the number of epochs to load state during warmup. WarmupBoundary = build.Finality )
Functions ¶
This section is empty.
Types ¶
type BadgerMarkSet ¶ added in v1.11.1
type BadgerMarkSet struct {
// contains filtered or unexported fields
}
func (*BadgerMarkSet) Close ¶ added in v1.11.1
func (s *BadgerMarkSet) Close() error
func (*BadgerMarkSet) SetConcurrent ¶ added in v1.11.1
func (s *BadgerMarkSet) SetConcurrent()
type BadgerMarkSetEnv ¶ added in v1.11.1
type BadgerMarkSetEnv struct {
// contains filtered or unexported fields
}
func (*BadgerMarkSetEnv) Close ¶ added in v1.11.1
func (e *BadgerMarkSetEnv) Close() error
func (*BadgerMarkSetEnv) Create ¶ added in v1.11.1
func (e *BadgerMarkSetEnv) Create(name string, sizeHint int64) (MarkSet, error)
func (*BadgerMarkSetEnv) CreateVisitor ¶ added in v1.11.2
func (e *BadgerMarkSetEnv) CreateVisitor(name string, sizeHint int64) (MarkSetVisitor, error)
func (*BadgerMarkSetEnv) SupportsVisitor ¶ added in v1.11.2
func (e *BadgerMarkSetEnv) SupportsVisitor() bool
type ChainAccessor ¶
type ChainAccessor interface { GetTipsetByHeight(context.Context, abi.ChainEpoch, *types.TipSet, bool) (*types.TipSet, error) GetHeaviestTipSet() *types.TipSet SubscribeHeadChanges(change func(revert []*types.TipSet, apply []*types.TipSet) error) }
ChainAccessor allows the Splitstore to access the chain. It will most likely be a ChainStore at runtime.
type Config ¶
type Config struct { // MarkSetType is the type of mark set to use. // // The default value is "map", which uses an in-memory map-backed markset. // If you are constrained in memory (i.e. compaction runs out of memory), you // can use "badger", which will use a disk-backed markset using badger. // Note that compaction will take quite a bit longer when using the "badger" option, // but that shouldn't really matter (as long as it is under 7.5hrs). MarkSetType string // DiscardColdBlocks indicates whether to skip moving cold blocks to the coldstore. // If the splitstore is running with a noop coldstore then this option is set to true // which skips moving (as it is a noop, but still takes time to read all the cold objects) // and directly purges cold blocks. DiscardColdBlocks bool // HotstoreMessageRetention indicates the hotstore retention policy for messages. // It has the following semantics: // - a value of 0 will only retain messages within the compaction boundary (4 finalities) // - a positive integer indicates the number of finalities, outside the compaction boundary, // for which messages will be retained in the hotstore. HotStoreMessageRetention uint64 // HotstoreFullGCFrequency indicates how frequently (in terms of compactions) to garbage collect // the hotstore using full (moving) GC if supported by the hotstore. // A value of 0 disables full GC entirely. // A positive value is the number of compactions before a full GC is performed; // a value of 1 will perform full GC in every compaction. HotStoreFullGCFrequency uint64 }
type MapMarkSet ¶ added in v1.11.1
type MapMarkSet struct {
// contains filtered or unexported fields
}
func (*MapMarkSet) Close ¶ added in v1.11.1
func (s *MapMarkSet) Close() error
func (*MapMarkSet) SetConcurrent ¶ added in v1.11.1
func (s *MapMarkSet) SetConcurrent()
type MapMarkSetEnv ¶ added in v1.11.1
type MapMarkSetEnv struct{}
func NewMapMarkSetEnv ¶ added in v1.11.1
func NewMapMarkSetEnv() (*MapMarkSetEnv, error)
func (*MapMarkSetEnv) Close ¶ added in v1.11.1
func (e *MapMarkSetEnv) Close() error
func (*MapMarkSetEnv) Create ¶ added in v1.11.1
func (e *MapMarkSetEnv) Create(name string, sizeHint int64) (MarkSet, error)
func (*MapMarkSetEnv) CreateVisitor ¶ added in v1.11.2
func (e *MapMarkSetEnv) CreateVisitor(name string, sizeHint int64) (MarkSetVisitor, error)
func (*MapMarkSetEnv) SupportsVisitor ¶ added in v1.11.2
func (e *MapMarkSetEnv) SupportsVisitor() bool
type MarkSet ¶
type MarkSet interface { Mark(cid.Cid) error Has(cid.Cid) (bool, error) Close() error SetConcurrent() }
MarkSet is a utility to keep track of seen CID, and later query for them.
* If the expected dataset is large, it can be backed by a datastore (e.g. bbolt). * If a probabilistic result is acceptable, it can be backed by a bloom filter
type MarkSetEnv ¶
type MarkSetEnv interface { // Create creates a new markset within the environment. // name is a unique name for this markset, mapped to the filesystem in disk-backed environments // sizeHint is a hint about the expected size of the markset Create(name string, sizeHint int64) (MarkSet, error) // CreateVisitor is like Create, but returns a wider interface that supports atomic visits. // It may not be supported by some markset types (e.g. bloom). CreateVisitor(name string, sizeHint int64) (MarkSetVisitor, error) // SupportsVisitor returns true if the marksets created by this environment support the visitor interface. SupportsVisitor() bool Close() error }
func NewBadgerMarkSetEnv ¶ added in v1.11.1
func NewBadgerMarkSetEnv(path string) (MarkSetEnv, error)
func OpenMarkSetEnv ¶
func OpenMarkSetEnv(path string, mtype string) (MarkSetEnv, error)
type MarkSetVisitor ¶ added in v1.11.2
type MarkSetVisitor interface { MarkSet ObjectVisitor }
type ObjectVisitor ¶ added in v1.11.2
ObjectVisitor is an interface for deduplicating objects during walks
type SplitStore ¶
type SplitStore struct {
// contains filtered or unexported fields
}
func Open ¶
func Open(path string, ds dstore.Datastore, hot, cold bstore.Blockstore, cfg *Config) (*SplitStore, error)
Open opens an existing splistore, or creates a new splitstore. The splitstore is backed by the provided hot and cold stores. The returned SplitStore MUST be attached to the ChainStore with Start in order to trigger compaction.
func (*SplitStore) AddProtector ¶ added in v1.11.1
func (s *SplitStore) AddProtector(protector func(func(cid.Cid) error) error)
func (*SplitStore) AllKeysChan ¶
func (*SplitStore) Check ¶ added in v1.11.1
func (s *SplitStore) Check() error
performs an asynchronous health-check on the splitstore; results are appended to <splitstore-path>/check.txt
func (*SplitStore) Close ¶
func (s *SplitStore) Close() error
func (*SplitStore) DeleteBlock ¶
func (s *SplitStore) DeleteBlock(_ cid.Cid) error
Blockstore interface
func (*SplitStore) DeleteMany ¶
func (s *SplitStore) DeleteMany(_ []cid.Cid) error
func (*SplitStore) Expose ¶ added in v1.11.1
func (s *SplitStore) Expose() bstore.Blockstore
func (*SplitStore) HashOnRead ¶
func (s *SplitStore) HashOnRead(enabled bool)
func (*SplitStore) HeadChange ¶
func (s *SplitStore) HeadChange(_, apply []*types.TipSet) error
func (*SplitStore) Info ¶ added in v1.11.1
func (s *SplitStore) Info() map[string]interface{}
provides some basic information about the splitstore