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

Function should_compact_threshold

nodedb-columnar/src/mutation/tests.rs:286–307  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

284
285#[test]
286fn should_compact_threshold() {
287 let mut engine = MutationEngine::new("test".into(), test_schema());
288
289 // Insert and flush to create a real segment.
290 for i in 0..10 {
291 engine
292 .insert(&[
293 Value::Integer(i),
294 Value::String(format!("u{i}")),
295 Value::Null,
296 ])
297 .expect("insert");
298 }
299 engine.on_memtable_flushed(1).expect("flush");
300
301 // Delete 3 out of 10 rows = 30% > 20% threshold.
302 for i in 0..3 {
303 engine.delete(&Value::Integer(i)).expect("delete");
304 }
305
306 assert!(engine.should_compact(1, 10));
307}
308
309#[test]
310fn segment_id_allocator_returns_err_at_u64_max() {

Callers

nothing calls this directly

Calls 5

on_memtable_flushedMethod · 0.80
test_schemaFunction · 0.70
expectMethod · 0.45
insertMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected