checkin initial MVCC codebase

Signed-off-by: Alex Chi <iskyzh@gmail.com>
This commit is contained in:
Alex Chi
2024-01-25 12:07:53 +08:00
committed by Alex Chi Z
parent 3211af8d74
commit 753e6d4f9e
43 changed files with 3889 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
pub mod concat_iterator;
pub mod merge_iterator;
pub mod two_merge_iterator;
pub trait StorageIterator {
type KeyType<'a>: PartialEq + Eq + PartialOrd + Ord
where
Self: 'a;
/// Get the current value.
fn value(&self) -> &[u8];
/// Get the current key.
fn key(&self) -> Self::KeyType<'_>;
/// Check if the current iterator is valid.
fn is_valid(&self) -> bool;
/// Move to the next position.
fn next(&mut self) -> anyhow::Result<()>;
/// Number of underlying active iterators for this iterator.
fn num_active_iterators(&self) -> usize {
1
}
}