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

Function stream_buffer_push_and_read

nodedb/tests/event_cdc.rs:17–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15
16#[test]
17fn stream_buffer_push_and_read() {
18 let buf = StreamBuffer::new("orders_stream".to_string(), RetentionConfig::default());
19 buf.push(make_cdc_event(1, 0, "orders", "INSERT"));
20 buf.push(make_cdc_event(2, 0, "orders", "UPDATE"));
21 buf.push(make_cdc_event(3, 1, "orders", "INSERT"));
22
23 let all = buf.read_from_lsn(0, 100);
24 assert_eq!(all.len(), 3);
25
26 let p0 = buf.read_partition_from_lsn(0, 0, 100);
27 assert_eq!(p0.len(), 2);
28
29 let p1 = buf.read_partition_from_lsn(1, 0, 100);
30 assert_eq!(p1.len(), 1);
31}
32
33#[test]
34fn stream_buffer_retention_evicts_oldest() {

Callers

nothing calls this directly

Calls 5

make_cdc_eventFunction · 0.85
to_stringMethod · 0.80
read_from_lsnMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected