add interface on watermark

Signed-off-by: Alex Chi <iskyzh@gmail.com>
This commit is contained in:
Alex Chi
2024-01-29 21:19:18 +08:00
parent 1795647bad
commit 3cecf09d59
3 changed files with 12 additions and 2 deletions

View File

@@ -23,6 +23,10 @@ impl Watermark {
}
}
pub fn num_retained_snapshots(&self) -> usize {
self.readers.len()
}
pub fn watermark(&self) -> Option<u64> {
self.readers.first_key_value().map(|(ts, _)| *ts)
}