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

Function read_from_lsn_with_limit

nodedb/src/event/cdc/buffer.rs:328–339  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

326
327 #[test]
328 fn read_from_lsn_with_limit() {
329 let buf = StreamBuffer::new("test".into(), RetentionConfig::default());
330
331 for i in 1..=10 {
332 buf.push(make_event(i, i * 10));
333 }
334
335 let events = buf.read_from_lsn(0, 3);
336 assert_eq!(events.len(), 3);
337 assert_eq!(events[0].lsn, 10);
338 assert_eq!(events[2].lsn, 30);
339 }
340
341 fn make_event_on_partition(seq: u64, partition: u32, lsn: u64) -> CdcEvent {
342 let mut e = make_event(seq, lsn);

Callers

nothing calls this directly

Calls 3

read_from_lsnMethod · 0.80
make_eventFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected