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

Function reader_open_advises_sequential

nodedb-wal/tests/mmap_reader_madvise.rs:52–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50
51#[test]
52fn reader_open_advises_sequential() {
53 let dir = tempdir().unwrap();
54 let wal_dir = dir.path();
55 write_n_records(wal_dir, 1);
56
57 let segs = nodedb_wal::segment::discover_segments(wal_dir).unwrap();
58 let reader = MmapWalReader::open(&segs[0].path).unwrap();
59
60 assert_eq!(
61 reader.madvise_state(),
62 Some(libc::MADV_SEQUENTIAL),
63 "MmapWalReader::open must advise MADV_SEQUENTIAL"
64 );
65}
66
67#[test]
68fn replay_limit_from_last_segment_opens_only_last_segment() {

Callers

nothing calls this directly

Calls 4

write_n_recordsFunction · 0.85
discover_segmentsFunction · 0.85
openFunction · 0.50
pathMethod · 0.45

Tested by

no test coverage detected