MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / reopen_loads_manifest_and_segments

Function reopen_loads_manifest_and_segments

nodedb/src/engine/array/engine.rs:263–280  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

261
262 #[test]
263 fn reopen_loads_manifest_and_segments() {
264 use crate::engine::array::test_support::put_one;
265 use tempfile::TempDir;
266
267 let dir = TempDir::new().unwrap();
268 let aid = aid();
269 {
270 let mut e = ArrayEngine::new(ArrayEngineConfig::new(dir.path().to_path_buf())).unwrap();
271 e.open_array(aid.clone(), schema(), 0xBEEF).unwrap();
272 put_one(&mut e, 1, 1, 7, 1);
273 e.flush(&aid, 2).unwrap();
274 }
275 let mut e = ArrayEngine::new(ArrayEngineConfig::new(dir.path().to_path_buf())).unwrap();
276 e.open_array(aid.clone(), schema(), 0xBEEF).unwrap();
277 let m = e.store(&aid).unwrap().manifest();
278 assert_eq!(m.segments.len(), 1);
279 assert!(m.durable_lsn > 0);
280 }
281}

Callers

nothing calls this directly

Calls 9

put_oneFunction · 0.85
open_arrayMethod · 0.80
manifestMethod · 0.80
aidFunction · 0.70
schemaFunction · 0.70
pathMethod · 0.45
cloneMethod · 0.45
flushMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected