@@ -5,22 +5,13 @@ mod builder;
|
||||
mod iterator;
|
||||
|
||||
pub use builder::BlockBuilder;
|
||||
/// You may want to check `bytes::BufMut` out when manipulating continuous chunks of memory
|
||||
use bytes::Bytes;
|
||||
pub use iterator::BlockIterator;
|
||||
|
||||
/// A block is the smallest unit of read and caching in LSM tree.
|
||||
/// It is a collection of sorted key-value pairs.
|
||||
/// The `actual` storage format is as below (After `Block::encode`):
|
||||
///
|
||||
/// ----------------------------------------------------------------------------------------------------
|
||||
/// | Data Section | Offset Section | Extra |
|
||||
/// ----------------------------------------------------------------------------------------------------
|
||||
/// | Entry #1 | Entry #2 | ... | Entry #N | Offset #1 | Offset #2 | ... | Offset #N | num_of_elements |
|
||||
/// ----------------------------------------------------------------------------------------------------
|
||||
/// A block is the smallest unit of read and caching in LSM tree. It is a collection of sorted key-value pairs.
|
||||
pub struct Block {
|
||||
data: Vec<u8>,
|
||||
offsets: Vec<u16>,
|
||||
pub(crate) data: Vec<u8>,
|
||||
pub(crate) offsets: Vec<u16>,
|
||||
}
|
||||
|
||||
impl Block {
|
||||
@@ -35,6 +26,3 @@ impl Block {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
Reference in New Issue
Block a user