MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / rotate_segments_simple

Function rotate_segments_simple

crates/commitlog/src/commitlog.rs:1079–1090  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1077
1078 #[test]
1079 fn rotate_segments_simple() {
1080 let mut log = mem_log::<[u8; 32]>(128);
1081 for i in 0..4 {
1082 log.commit([(i, [0; 32])]).unwrap();
1083 }
1084 log.flush_and_sync().unwrap();
1085
1086 let offsets = log.repo.existing_offsets().unwrap();
1087 assert_eq!(&offsets[..offsets.len() - 1], &log.tail);
1088 // TODO: We overshoot the max segment size.
1089 assert_eq!(&offsets, &[0, 3]);
1090 }
1091
1092 #[test]
1093 fn huge_commit() {

Callers

nothing calls this directly

Calls 4

commitMethod · 0.65
unwrapMethod · 0.45
flush_and_syncMethod · 0.45
existing_offsetsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…