pub struct PrunerWatermark {
pub wait_for_ms: i64,
pub reader_lo: u64,
pub pruner_hi: u64,
}
Expand description
A watermark that represents the bounds for the region that the pruner is allowed to prune, and the time in milliseconds the pruner must wait before it can begin pruning data.
Fields§
§wait_for_ms: i64
The remaining time in milliseconds that the pruner must wait before it can begin pruning.
This is calculated by finding the difference between the time when it becomes safe to prune
and the current time: (pruner_timestamp + delay) - current_time
.
The pruner will wait for this duration before beginning to delete data if it is positive. When this value is zero or negative, it means the waiting period has already passed and pruning can begin immediately.
reader_lo: u64
The pruner can delete up to this checkpoint (exclusive).
pruner_hi: u64
The pruner has already deleted up to this checkpoint (exclusive), so can continue from this point.
Implementations§
Source§impl PrunerWatermark
impl PrunerWatermark
Sourcepub fn wait_for(&self) -> Option<Duration>
pub fn wait_for(&self) -> Option<Duration>
Returns the duration that the pruner must wait before it can begin pruning data.
Sourcepub fn next_chunk(&mut self, size: u64) -> Option<(u64, u64)>
pub fn next_chunk(&mut self, size: u64) -> Option<(u64, u64)>
The next chunk of checkpoints that the pruner should work on, to advance the watermark. If
no more checkpoints to prune, returns None
. Otherwise, returns a tuple (from,
to_exclusive) where from
is inclusive and to_exclusive
is exclusive. Advance the
watermark as well.
Trait Implementations§
Source§impl Clone for PrunerWatermark
impl Clone for PrunerWatermark
Source§fn clone(&self) -> PrunerWatermark
fn clone(&self) -> PrunerWatermark
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more