risingwave_storage::hummock::iterator

Trait SkipWatermarkState

source
pub trait SkipWatermarkState: Send {
    // Required methods
    fn has_watermark(&self) -> bool;
    fn should_delete(&mut self, key: &FullKey<&[u8]>) -> bool;
    fn reset_watermark(&mut self);
    fn advance_watermark(&mut self, key: &FullKey<&[u8]>) -> bool;
}
Expand description

This trait is used to maintain the state of whether the watermark has been skipped.

Required Methods§

source

fn has_watermark(&self) -> bool

Returns whether there are any unused watermarks in the state.

source

fn should_delete(&mut self, key: &FullKey<&[u8]>) -> bool

Returns whether the incoming key needs to be deleted after watermark filtering. Note: Each table_id has multiple watermarks, and state defaults to forward traversal of vnodes, so you must use forward traversal of the incoming key for it to be filtered correctly.

source

fn reset_watermark(&mut self)

Resets the watermark state.

source

fn advance_watermark(&mut self, key: &FullKey<&[u8]>) -> bool

Determines if the current watermark is exhausted by the passed-in key, advances to the next watermark, and returns whether the key needs to be deleted.

Implementors§