finish week 1 day 7

Signed-off-by: Alex Chi <iskyzh@gmail.com>
This commit is contained in:
Alex Chi
2024-01-21 19:33:05 +08:00
parent 4e2f516b15
commit e8601433d6
8 changed files with 299 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
#![allow(unused_variables)] // TODO(you): remove this lint after implementing this mod
#![allow(dead_code)] // TODO(you): remove this lint after implementing this mod
pub(crate) mod bloom;
mod builder;
mod iterator;
@@ -16,6 +17,8 @@ pub use iterator::SsTableIterator;
use crate::block::Block;
use crate::lsm_storage::BlockCache;
use self::bloom::Bloom;
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct BlockMeta {
/// Offset of this data block.
@@ -91,6 +94,7 @@ pub struct SsTable {
block_cache: Option<Arc<BlockCache>>,
first_key: Bytes,
last_key: Bytes,
pub(crate) bloom: Option<Bloom>,
}
impl SsTable {
@@ -114,6 +118,7 @@ impl SsTable {
block_cache: None,
first_key,
last_key,
bloom: None,
}
}