Documentation ¶
Index ¶
- Variables
- type BadgerMarkSet
- func (s *BadgerMarkSet) BeginCriticalSection() error
- func (s *BadgerMarkSet) Close() error
- func (s *BadgerMarkSet) EndCriticalSection()
- func (s *BadgerMarkSet) Has(c cid.Cid) (bool, error)
- func (s *BadgerMarkSet) Mark(c cid.Cid) error
- func (s *BadgerMarkSet) MarkMany(batch []cid.Cid) error
- func (s *BadgerMarkSet) Visit(c cid.Cid) (bool, error)
- type BadgerMarkSetEnv
- type ChainAccessor
- type Checkpoint
- type ColdSetReader
- type ColdSetWriter
- type Config
- type MapMarkSet
- func (s *MapMarkSet) BeginCriticalSection() error
- func (s *MapMarkSet) Close() error
- func (s *MapMarkSet) EndCriticalSection()
- func (s *MapMarkSet) Has(cid cid.Cid) (bool, error)
- func (s *MapMarkSet) Mark(c cid.Cid) error
- func (s *MapMarkSet) MarkMany(batch []cid.Cid) error
- func (s *MapMarkSet) Visit(c cid.Cid) (bool, error)
- type MapMarkSetEnv
- type MarkSet
- type MarkSetEnv
- 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(_ context.Context, _ cid.Cid) error
- func (s *SplitStore) DeleteMany(_ context.Context, _ []cid.Cid) error
- func (s *SplitStore) Expose() bstore.Blockstore
- func (s *SplitStore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error)
- func (s *SplitStore) GetSize(ctx context.Context, cid cid.Cid) (int, error)
- func (s *SplitStore) Has(ctx context.Context, 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(ctx context.Context, blk blocks.Block) error
- func (s *SplitStore) PutMany(ctx context.Context, blks []blocks.Block) error
- func (s *SplitStore) Start(chain ChainAccessor, us stmgr.UpgradeSchedule) error
- func (s *SplitStore) View(ctx context.Context, 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 // SyncWaitTime is the time delay from a tipset's min timestamp before we decide // we have synced. SyncWaitTime = 30 * time.Second )
var (
ReifyLimit = 16384
)
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) BeginCriticalSection ¶ added in v1.14.0
func (s *BadgerMarkSet) BeginCriticalSection() error
func (*BadgerMarkSet) Close ¶ added in v1.11.1
func (s *BadgerMarkSet) Close() error
func (*BadgerMarkSet) EndCriticalSection ¶ added in v1.14.0
func (s *BadgerMarkSet) EndCriticalSection()
func (*BadgerMarkSet) Has ¶ added in v1.11.1
func (s *BadgerMarkSet) Has(c cid.Cid) (bool, error)
func (*BadgerMarkSet) Mark ¶ added in v1.11.1
func (s *BadgerMarkSet) Mark(c cid.Cid) error
func (*BadgerMarkSet) MarkMany ¶ added in v1.14.0
func (s *BadgerMarkSet) MarkMany(batch []cid.Cid) error
func (*BadgerMarkSet) Visit ¶ added in v1.11.2
func (s *BadgerMarkSet) Visit(c cid.Cid) (bool, error)
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
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 Checkpoint ¶ added in v1.14.0
type Checkpoint struct {
// contains filtered or unexported fields
}
func NewCheckpoint ¶ added in v1.14.0
func NewCheckpoint(path string) (*Checkpoint, error)
func OpenCheckpoint ¶ added in v1.14.0
func OpenCheckpoint(path string) (*Checkpoint, cid.Cid, error)
func (*Checkpoint) Close ¶ added in v1.14.0
func (cp *Checkpoint) Close() error
func (*Checkpoint) Set ¶ added in v1.14.0
func (cp *Checkpoint) Set(c cid.Cid) error
type ColdSetReader ¶ added in v1.14.0
type ColdSetReader struct {
// contains filtered or unexported fields
}
func NewColdSetReader ¶ added in v1.14.0
func NewColdSetReader(path string) (*ColdSetReader, error)
func (*ColdSetReader) Close ¶ added in v1.14.0
func (s *ColdSetReader) Close() error
func (*ColdSetReader) ForEach ¶ added in v1.14.0
func (s *ColdSetReader) ForEach(f func(cid.Cid) error) error
func (*ColdSetReader) Reset ¶ added in v1.14.0
func (s *ColdSetReader) Reset() error
type ColdSetWriter ¶ added in v1.14.0
type ColdSetWriter struct {
// contains filtered or unexported fields
}
func NewColdSetWriter ¶ added in v1.14.0
func NewColdSetWriter(path string) (*ColdSetWriter, error)
func (*ColdSetWriter) Close ¶ added in v1.14.0
func (s *ColdSetWriter) Close() error
func (*ColdSetWriter) Write ¶ added in v1.14.0
func (s *ColdSetWriter) Write(c cid.Cid) error
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) BeginCriticalSection ¶ added in v1.14.0
func (s *MapMarkSet) BeginCriticalSection() error
func (*MapMarkSet) Close ¶ added in v1.11.1
func (s *MapMarkSet) Close() error
func (*MapMarkSet) EndCriticalSection ¶ added in v1.14.0
func (s *MapMarkSet) EndCriticalSection()
func (*MapMarkSet) Has ¶ added in v1.11.1
func (s *MapMarkSet) Has(cid cid.Cid) (bool, error)
func (*MapMarkSet) Mark ¶ added in v1.11.1
func (s *MapMarkSet) Mark(c cid.Cid) error
func (*MapMarkSet) MarkMany ¶ added in v1.14.0
func (s *MapMarkSet) MarkMany(batch []cid.Cid) error
func (*MapMarkSet) Visit ¶ added in v1.11.2
func (s *MapMarkSet) Visit(c cid.Cid) (bool, error)
type MapMarkSetEnv ¶ added in v1.11.1
type MapMarkSetEnv struct {
// contains filtered or unexported fields
}
func NewMapMarkSetEnv ¶ added in v1.11.1
func NewMapMarkSetEnv(path string) (*MapMarkSetEnv, error)
func (*MapMarkSetEnv) Close ¶ added in v1.11.1
func (e *MapMarkSetEnv) Close() error
type MarkSet ¶
type MarkSet interface { ObjectVisitor Mark(cid.Cid) error MarkMany([]cid.Cid) error Has(cid.Cid) (bool, error) Close() error // BeginCriticalSection ensures that the markset is persisted to disk for recovery in case // of abnormal termination during the critical section span. BeginCriticalSection() error // EndCriticalSection ends the critical section span. EndCriticalSection() }
MarkSet is an interface for tracking CIDs during chain and object walks
type MarkSetEnv ¶
type MarkSetEnv interface { // New creates a new markset within the environment. // name is a unique name for this markset, mapped to the filesystem for on-disk persistence. // sizeHint is a hint about the expected size of the markset New(name string, sizeHint int64) (MarkSet, error) // Recover recovers an existing markset persisted on-disk. Recover(name string) (MarkSet, error) // Close closes the markset 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 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 (s *SplitStore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
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(_ context.Context, _ cid.Cid) error
Blockstore interface
func (*SplitStore) DeleteMany ¶
func (s *SplitStore) DeleteMany(_ context.Context, _ []cid.Cid) error
func (*SplitStore) Expose ¶ added in v1.11.1
func (s *SplitStore) Expose() bstore.Blockstore
func (*SplitStore) GetSize ¶
func (s *SplitStore) GetSize(ctx context.Context, cid cid.Cid) (int, error)
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
func (*SplitStore) Start ¶
func (s *SplitStore) Start(chain ChainAccessor, us stmgr.UpgradeSchedule) error
State tracking