Skip to content

Commit ec09798

Browse files
committed
add support for chunk size handling
1 parent 0dc4609 commit ec09798

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

db4-storage/src/persist/strategy.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ use crate::segments::{
99

1010
pub const DEFAULT_MAX_PAGE_LEN_NODES: u32 = 131_072; // 2^17
1111
pub const DEFAULT_MAX_PAGE_LEN_EDGES: u32 = 1_048_576; // 2^20
12+
pub const DEFAULT_MAX_MEMORY_BYTES: usize = 32 * 1024 * 1024;
1213

1314
pub trait Config:
1415
Default + std::fmt::Debug + Clone + Send + Sync + 'static + for<'a> Deserialize<'a> + Serialize
1516
{
1617
fn max_node_page_len(&self) -> u32;
1718
fn max_edge_page_len(&self) -> u32;
19+
20+
fn max_memory_bytes(&self) -> usize;
1821
fn is_parallel(&self) -> bool;
1922
fn node_types(&self) -> &[String];
2023
fn set_node_types(&mut self, types: impl IntoIterator<Item = impl AsRef<str>>);
@@ -70,6 +73,10 @@ impl Config for NoOpStrategy {
7073
self.max_edge_page_len
7174
}
7275

76+
fn max_memory_bytes(&self) -> usize {
77+
usize::MAX
78+
}
79+
7380
fn is_parallel(&self) -> bool {
7481
false
7582
}

0 commit comments

Comments
 (0)