[][src]Trait grin_chain::linked_list::PruneableListIndex

pub trait PruneableListIndex: ListIndex {
    pub fn clear(&self, batch: &Batch<'_>) -> Result<(), Error>;
pub fn prune(
        &self,
        batch: &Batch<'_>,
        commit: Commitment,
        cutoff_pos: u64
    ) -> Result<(), Error>;
pub fn pop_pos_back(
        &self,
        batch: &Batch<'_>,
        commit: Commitment
    ) -> Result<Option<<Self::Entry as ListIndexEntry>::Pos>, Error>; }

A pruneable list index supports pruning of old data from the index lists. This allows us to efficiently maintain an index of "recent" kernel data. We can maintain a window of 2 weeks of recent data, discarding anything older than this.

Required methods

pub fn clear(&self, batch: &Batch<'_>) -> Result<(), Error>[src]

Clear all data from the index. Used when rebuilding the index.

pub fn prune(
    &self,
    batch: &Batch<'_>,
    commit: Commitment,
    cutoff_pos: u64
) -> Result<(), Error>
[src]

Prune old data.

pub fn pop_pos_back(
    &self,
    batch: &Batch<'_>,
    commit: Commitment
) -> Result<Option<<Self::Entry as ListIndexEntry>::Pos>, Error>
[src]

Pop a pos off the back of the list (used for pruning old data).

Loading content...

Implementors

impl<T: PosEntry> PruneableListIndex for MultiIndex<T>[src]

pub fn prune(
    &self,
    _batch: &Batch<'_>,
    _commit: Commitment,
    _cutoff_pos: u64
) -> Result<(), Error>
[src]

Pruning will be more performant than full rebuild but not yet necessary.

pub fn pop_pos_back(
    &self,
    batch: &Batch<'_>,
    commit: Commitment
) -> Result<Option<T>, Error>
[src]

Pop off the back/tail of the linked list. Used when pruning old data.

Loading content...