pub trait SkipWatermarkState: Send {
// Required methods
fn has_watermark(&self) -> bool;
fn should_delete(
&mut self,
key: &FullKey<&[u8]>,
value: HummockValue<&[u8]>,
) -> bool;
fn reset_watermark(&mut self);
fn advance_watermark(
&mut self,
key: &FullKey<&[u8]>,
value: HummockValue<&[u8]>,
) -> bool;
}Expand description
This trait is used to maintain the state of whether the watermark has been skipped.
Required Methods§
Sourcefn has_watermark(&self) -> bool
fn has_watermark(&self) -> bool
Returns whether there are any unused watermarks in the state.
Sourcefn should_delete(
&mut self,
key: &FullKey<&[u8]>,
value: HummockValue<&[u8]>,
) -> bool
fn should_delete( &mut self, key: &FullKey<&[u8]>, value: HummockValue<&[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.
Sourcefn reset_watermark(&mut self)
fn reset_watermark(&mut self)
Resets the watermark state.
Sourcefn advance_watermark(
&mut self,
key: &FullKey<&[u8]>,
value: HummockValue<&[u8]>,
) -> bool
fn advance_watermark( &mut self, key: &FullKey<&[u8]>, value: HummockValue<&[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.