prunable

package
v1.0.0-alpha.21 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithMaxOpenDBs

func WithMaxOpenDBs(optsMaxOpenDBs int) options.Option[BucketManager]

WithMaxOpenDBs sets the maximum concurrently open DBs.

Types

type BucketManager

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

func NewBucketManager

func NewBucketManager(dbConfig database.Config, errorHandler func(error), opts ...options.Option[BucketManager]) *BucketManager

func (*BucketManager) BucketSize

func (b *BucketManager) BucketSize(epoch iotago.EpochIndex) (int64, error)

func (*BucketManager) CloseWithoutLocking

func (b *BucketManager) CloseWithoutLocking()

func (*BucketManager) DeleteBucket

func (b *BucketManager) DeleteBucket(epoch iotago.EpochIndex) (deleted bool)

DeleteBucket deletes directory that stores the data for the given bucket and returns boolean flag indicating whether a directory for that bucket existed.

func (*BucketManager) Flush

func (b *BucketManager) Flush() error

func (*BucketManager) Get

func (b *BucketManager) Get(epoch iotago.EpochIndex, realm kvstore.Realm) (kvstore.KVStore, error)

func (*BucketManager) IsTooOld

func (b *BucketManager) IsTooOld(epoch iotago.EpochIndex) (isTooOld bool)

IsTooOld checks if the index is in a pruned epoch.

func (*BucketManager) LastPrunedEpoch

func (b *BucketManager) LastPrunedEpoch() (epoch iotago.EpochIndex, hasPruned bool)

func (*BucketManager) Lock

func (b *BucketManager) Lock()

func (*BucketManager) Prune

func (b *BucketManager) Prune(epoch iotago.EpochIndex) error

func (*BucketManager) PruneSlots

func (b *BucketManager) PruneSlots(epoch iotago.EpochIndex, startPruneRange iotago.SlotIndex, endPruneRange iotago.SlotIndex) error

PruneSlots prunes the data of all slots in the range [from, to] in the given epoch.

func (*BucketManager) RestoreFromDisk

func (b *BucketManager) RestoreFromDisk() (lastPrunedEpoch iotago.EpochIndex)

func (*BucketManager) Shutdown

func (b *BucketManager) Shutdown()

func (*BucketManager) TotalSize

func (b *BucketManager) TotalSize() int64

TotalSize returns the size of the prunable storage containing all db instances.

func (*BucketManager) Unlock

func (b *BucketManager) Unlock()

type Prunable

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

func Clone

func Clone(source *Prunable, dbConfig database.Config, apiProvider iotago.APIProvider, errorHandler func(error), opts ...options.Option[BucketManager]) (*Prunable, error)

func New

func New(dbConfig database.Config, apiProvider iotago.APIProvider, errorHandler func(error), opts ...options.Option[BucketManager]) *Prunable

func (*Prunable) AccountDiffs

func (p *Prunable) AccountDiffs(slot iotago.SlotIndex) (*slotstore.AccountDiffs, error)

func (*Prunable) Attestations

func (p *Prunable) Attestations(slot iotago.SlotIndex) (kvstore.KVStore, error)

func (*Prunable) BlockMetadata

func (p *Prunable) BlockMetadata(slot iotago.SlotIndex) (*slotstore.BlockMetadataStore, error)

func (*Prunable) Blocks

func (p *Prunable) Blocks(slot iotago.SlotIndex) (*slotstore.Blocks, error)

func (*Prunable) BucketSize

func (p *Prunable) BucketSize(epoch iotago.EpochIndex) (int64, error)

func (*Prunable) Committee

func (*Prunable) CommitteeCandidates

func (p *Prunable) CommitteeCandidates(epoch iotago.EpochIndex) (*kvstore.TypedStore[iotago.AccountID, iotago.SlotIndex], error)

func (*Prunable) DecidedUpgradeSignals

func (p *Prunable) DecidedUpgradeSignals() *epochstore.BaseStore[model.VersionAndHash]

func (*Prunable) Flush

func (p *Prunable) Flush()

func (*Prunable) Mutations

func (p *Prunable) Mutations(slot iotago.SlotIndex) (kvstore.KVStore, error)

func (*Prunable) PoolStats

func (p *Prunable) PoolStats() *epochstore.BaseStore[*model.PoolsStats]

func (*Prunable) Prune

func (p *Prunable) Prune(epoch iotago.EpochIndex, defaultPruningDelay iotago.EpochIndex) error

func (*Prunable) RestoreFromDisk

func (p *Prunable) RestoreFromDisk() (lastPrunedEpoch iotago.EpochIndex)

func (*Prunable) Rewards

func (p *Prunable) Rewards() *epochstore.EpochKVStore

func (*Prunable) RewardsForEpoch

func (p *Prunable) RewardsForEpoch(epoch iotago.EpochIndex) (kvstore.KVStore, error)

func (*Prunable) Rollback

func (p *Prunable) Rollback(targetEpoch iotago.EpochIndex, startPruneRange iotago.SlotIndex, endPruneRange iotago.SlotIndex) error

func (*Prunable) RootBlocks

func (*Prunable) Roots

func (*Prunable) Shutdown

func (p *Prunable) Shutdown()

func (*Prunable) Size

func (p *Prunable) Size() int64

func (*Prunable) UpgradeSignals

func (*Prunable) ValidatorPerformances

func (p *Prunable) ValidatorPerformances(slot iotago.SlotIndex) (*slotstore.Store[iotago.AccountID, *model.ValidatorPerformance], error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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