Documentation ¶
Index ¶
- type Manager
- func (m *Manager) GetOptions() types.PruningOptions
- func (m *Manager) GetPruningHeight(height int64) int64
- func (m *Manager) HandleSnapshotHeight(height int64)
- func (m *Manager) LoadSnapshotHeights(db dbm.DB) error
- func (m *Manager) SetOptions(opts types.PruningOptions)
- func (m *Manager) SetSnapshotInterval(snapshotInterval uint64)
- type NegativeHeightsError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is an abstraction to handle the logic needed for determining when to prune old heights of the store based on the strategy described by the pruning options.
func NewManager ¶
NewManager returns a new Manager with the given db and logger. The retuned manager uses a pruning strategy of "nothing" which keeps all heights. Users of the Manager may change the strategy by calling SetOptions.
func (*Manager) GetOptions ¶
func (m *Manager) GetOptions() types.PruningOptions
GetOptions fetches the pruning strategy from the manager.
func (*Manager) GetPruningHeight ¶
GetPruningHeight returns the height which can prune upto if it is able to prune at the given height.
func (*Manager) HandleSnapshotHeight ¶
HandleSnapshotHeight persists the snapshot height to be pruned at the next appropriate height defined by the pruning strategy. It flushes the update to disk and panics if the flush fails. The input height must be greater than 0, and the pruning strategy must not be set to pruning nothing. If either of these conditions is not met, this function does nothing.
func (*Manager) LoadSnapshotHeights ¶
LoadSnapshotHeights loads the snapshot heights from the database as a crash recovery.
func (*Manager) SetOptions ¶
func (m *Manager) SetOptions(opts types.PruningOptions)
SetOptions sets the pruning strategy on the manager.
func (*Manager) SetSnapshotInterval ¶
SetSnapshotInterval sets the interval at which the snapshots are taken.
type NegativeHeightsError ¶
type NegativeHeightsError struct {
Height int64
}
NegativeHeightsError is returned when a negative height is provided to the manager.
func (*NegativeHeightsError) Error ¶
func (e *NegativeHeightsError) Error() string