Documentation ¶
Index ¶
- Constants
- Variables
- func PruningMetricsCaller(handler interface{}, params ...interface{})
- type Events
- type Manager
- func (p *Manager) HandleNewConfirmedMilestoneEvent(ctx context.Context, confirmedMilestoneIndex iotago.MilestoneIndex)
- func (p *Manager) IsPruning() bool
- func (p *Manager) PruneDatabaseByDepth(ctx context.Context, depth iotago.MilestoneIndex) (iotago.MilestoneIndex, error)
- func (p *Manager) PruneDatabaseBySize(ctx context.Context, targetSizeBytes int64) (iotago.MilestoneIndex, error)
- func (p *Manager) PruneDatabaseByTargetIndex(ctx context.Context, targetIndex iotago.MilestoneIndex) (iotago.MilestoneIndex, error)
- type PruningMetrics
Constants ¶
View Source
const ( // AdditionalPruningThreshold is the additional threshold (to BMD), which is needed, because the blocks in the getMilestoneParents call in solidEntryPoints // can reference older blocks as well AdditionalPruningThreshold = 5 )
Variables ¶
View Source
var ( ErrNotEnoughHistory = errors.New("not enough history") ErrNoPruningNeeded = errors.New("no pruning needed") ErrPruningAborted = errors.New("pruning was aborted") ErrDatabaseCompactionNotSupported = errors.New("database compaction not supported") ErrDatabaseCompactionRunning = errors.New("database compaction is running") ErrExistingDeltaSnapshotWrongFullSnapshotTargetMilestoneID = errors.New("existing delta ledger snapshot has wrong full snapshot target milestone ID") )
Functions ¶
func PruningMetricsCaller ¶
func PruningMetricsCaller(handler interface{}, params ...interface{})
PruningMetricsCaller is used to signal updated pruning metrics.
Types ¶
type Manager ¶
type Manager struct { // the logger used to log events. *logger.WrappedLogger Events *Events // contains filtered or unexported fields }
Manager handles pruning of the database.
func NewPruningManager ¶
func NewPruningManager( log *logger.Logger, storage *storagepkg.Storage, syncManager *syncmanager.SyncManager, tangleDatabase *database.Database, utxoDatabase *database.Database, getMinimumTangleHistory getMinimumTangleHistoryFunc, pruningMilestonesEnabled bool, pruningMilestonesMaxMilestonesToKeep syncmanager.MilestoneIndexDelta, pruningSizeEnabled bool, pruningSizeTargetSizeBytes int64, pruningSizeThresholdPercentage float64, pruningSizeCooldownTime time.Duration, pruneReceipts bool) *Manager
NewPruningManager creates a new pruning manager instance.
func (*Manager) HandleNewConfirmedMilestoneEvent ¶
func (p *Manager) HandleNewConfirmedMilestoneEvent(ctx context.Context, confirmedMilestoneIndex iotago.MilestoneIndex)
HandleNewConfirmedMilestoneEvent handles new confirmed milestone events which may trigger a snapshot creation.
func (*Manager) PruneDatabaseByDepth ¶
func (p *Manager) PruneDatabaseByDepth(ctx context.Context, depth iotago.MilestoneIndex) (iotago.MilestoneIndex, error)
func (*Manager) PruneDatabaseBySize ¶
func (*Manager) PruneDatabaseByTargetIndex ¶
func (p *Manager) PruneDatabaseByTargetIndex(ctx context.Context, targetIndex iotago.MilestoneIndex) (iotago.MilestoneIndex, error)
type PruningMetrics ¶
type PruningMetrics struct { DurationPruneUnreferencedBlocks time.Duration DurationTraverseMilestoneCone time.Duration DurationPruneMilestone time.Duration DurationPruneBlocks time.Duration DurationSetSnapshotInfo time.Duration DurationPruningMilestoneIndexChanged time.Duration DurationTotal time.Duration }
PruningMetrics holds metrics about a database pruning run.
Click to show internal directories.
Click to hide internal directories.