Find start position in large files via binary search

This commit is contained in:
Dominik Werder
2021-07-30 22:14:07 +02:00
parent 002139bfae
commit 5e624bb2ca
9 changed files with 318 additions and 33 deletions

View File

@@ -12,6 +12,7 @@ pub fn make_test_node(id: u32) -> Node {
port: 8800 + id as u16,
port_raw: 8800 + id as u16 + 100,
data_base_path: format!("../tmpdata/node{:02}", id).into(),
cache_base_path: format!("../tmpdata/node{:02}", id).into(),
split: id,
ksprefix: "ks".into(),
backend: "testbackend".into(),

View File

@@ -138,7 +138,7 @@ impl CacheFileDesc {
let hc = self.hash_channel();
node_config
.node
.data_base_path
.cache_base_path
.join("cache")
.join(&hc[0..3])
.join(&hc[3..6])

View File

@@ -78,6 +78,7 @@ pub async fn gen_test_data() -> Result<(), Error> {
port_raw: 7780 + i1 as u16 + 100,
split: i1,
data_base_path: data_base_path.join(format!("node{:02}", i1)),
cache_base_path: data_base_path.join(format!("node{:02}", i1)),
ksprefix: ksprefix.clone(),
backend: "testbackend".into(),
bin_grain_kind: 0,