Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ pub mod cache;
pub mod config;
pub mod iterator;
pub mod reader;
pub mod sst_iterator;
pub mod wal;
9 changes: 7 additions & 2 deletions src/storage/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,12 @@ impl SstableReader {
Ok(metadata)
}

fn read_block(&self, block_meta: &BlockMeta) -> Result<Vec<u8>> {
/// Read and decompress a block by its metadata.
/// Results are cached in the shared `GlobalBlockCache`.
///
/// Exposed as `pub(crate)` so that `SstableIterator` can load blocks
/// without duplicating the decompression + cache logic.
pub(crate) fn read_block(&self, block_meta: &BlockMeta) -> Result<Vec<u8>> {
// Use block index as cache key (blocks are numbered 0, 1, 2...)
let block_idx = self
.metadata
Expand Down Expand Up @@ -393,7 +398,7 @@ mod tests {
// Read SSTable
let reader = SstableReader::open(path, config, cache).unwrap();

// Verify reads (note: now uses &self, not &mut self)
// Verify reads
let record1 = reader.get("key1").unwrap().unwrap();
assert_eq!(record1.value, b"value1");

Expand Down
Loading