diff --git a/nomt/src/beatree/iterator.rs b/nomt/src/beatree/iterator.rs index 06aca129..a0383c82 100644 --- a/nomt/src/beatree/iterator.rs +++ b/nomt/src/beatree/iterator.rs @@ -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) diff --git a/nomt/src/beatree/leaf/mod.rs b/nomt/src/beatree/leaf/mod.rs index 5e02630d..1322a638 100644 --- a/nomt/src/beatree/leaf/mod.rs +++ b/nomt/src/beatree/leaf/mod.rs @@ -10,4 +10,3 @@ // be required to access the data again. pub mod node; -pub mod overflow; diff --git a/nomt/src/beatree/ops/mod.rs b/nomt/src/beatree/ops/mod.rs index 1b5eaf56..f697f470 100644 --- a/nomt/src/beatree/ops/mod.rs +++ b/nomt/src/beatree/ops/mod.rs @@ -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; @@ -35,7 +36,7 @@ pub fn partial_lookup(key: Key, bbn_index: &Index) -> Option { pub fn finish_lookup(key: Key, leaf: &LeafNode, leaf_store: &StoreReader) -> Option> { 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() } diff --git a/nomt/src/beatree/leaf/overflow.rs b/nomt/src/beatree/ops/overflow.rs similarity index 99% rename from nomt/src/beatree/leaf/overflow.rs rename to nomt/src/beatree/ops/overflow.rs index 931d25b2..310e80ca 100644 --- a/nomt/src/beatree/leaf/overflow.rs +++ b/nomt/src/beatree/ops/overflow.rs @@ -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; diff --git a/nomt/src/beatree/ops/update/leaf_stage.rs b/nomt/src/beatree/ops/update/leaf_stage.rs index 1275ddd6..f8544322 100644 --- a/nomt/src/beatree/ops/update/leaf_stage.rs +++ b/nomt/src/beatree/ops/update/leaf_stage.rs @@ -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,