Skip to content

Commit

Permalink
chore: move overflow to ops
Browse files Browse the repository at this point in the history
  • Loading branch information
rphmeier committed Dec 18, 2024
1 parent 5515bb7 commit 428a25d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion nomt/src/beatree/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ impl CurrentLeaf {
let key = self.leaf.key(index);
let (cell, overflow) = self.leaf.value(index);
if overflow {
let (_, value_hash, _) = super::leaf::overflow::decode_cell(cell);
let (_, value_hash, _) = super::ops::overflow::decode_cell(cell);
IterOutput::OverflowItem(key, value_hash, cell)
} else {
IterOutput::Item(key, cell)
Expand Down
1 change: 0 additions & 1 deletion nomt/src/beatree/leaf/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@
// be required to access the data again.

pub mod node;
pub mod overflow;
5 changes: 3 additions & 2 deletions nomt/src/beatree/ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ use super::{
allocator::{PageNumber, StoreReader},
branch::{node::get_key, BranchNode},
index::Index,
leaf::{self, node::LeafNode},
leaf::node::LeafNode,
leaf_cache::LeafCache,
Key,
};

pub(crate) mod bit_ops;
pub mod overflow;
mod reconstruction;
mod update;

Expand All @@ -35,7 +36,7 @@ pub fn partial_lookup(key: Key, bbn_index: &Index) -> Option<PageNumber> {
pub fn finish_lookup(key: Key, leaf: &LeafNode, leaf_store: &StoreReader) -> Option<Vec<u8>> {
leaf.get(&key).map(|(v, is_overflow)| {
if is_overflow {
leaf::overflow::read(v, leaf_store)
overflow::read(v, leaf_store)
} else {
v.to_vec()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
use crate::{
beatree::{
allocator::{StoreReader, SyncAllocator},
leaf::node::MAX_OVERFLOW_CELL_NODE_POINTERS,
PageNumber,
},
io::{page_pool::FatPage, IoCommand, IoHandle, IoKind, PagePool, PAGE_SIZE},
};

use super::node::MAX_OVERFLOW_CELL_NODE_POINTERS;

const BODY_SIZE: usize = PAGE_SIZE - 4;
const MAX_PNS: usize = BODY_SIZE / 4;
const HEADER_SIZE: usize = 4;
Expand Down
4 changes: 2 additions & 2 deletions nomt/src/beatree/ops/update/leaf_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ use threadpool::ThreadPool;
use crate::beatree::{
allocator::{PageNumber, StoreReader, SyncAllocator},
index::Index,
leaf::{node::LeafNode, overflow},
leaf::node::LeafNode,
leaf_cache::LeafCache,
ops::{
search_branch,
overflow, search_branch,
update::{
extend_range_protocol::{
request_range_extension, try_answer_left_neighbor, LeftNeighbor, RightNeighbor,
Expand Down

0 comments on commit 428a25d

Please sign in to comment.