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

Function compaction_merges_l0_segments

nodedb/src/engine/array/compact.rs:55–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53
54 #[test]
55 fn compaction_merges_l0_segments() {
56 let dir = TempDir::new().unwrap();
57 let mut cfg = ArrayEngineConfig::new(dir.path().to_path_buf());
58 cfg.flush_cell_threshold = 1;
59 let mut e = ArrayEngine::new(cfg).unwrap();
60 e.open_array(aid(), schema(), 0x1).unwrap();
61 for i in 0..4 {
62 put_one(&mut e, i, 0, i, (i as u64) + 1);
63 }
64 assert_eq!(e.store(&aid()).unwrap().manifest().segments.len(), 4);
65 let merged = e.maybe_compact(&aid(), None, 0).unwrap();
66 assert!(merged);
67 let m = e.store(&aid()).unwrap().manifest();
68 assert_eq!(m.segments.len(), 1);
69 assert_eq!(m.segments[0].level, 1);
70 }
71}

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected