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

Method compact

nodedb-raft/src/storage.rs:76–81  ·  view source on GitHub ↗
(&mut self, index: u64, term: u64)

Source from the content-addressed store, hash-verified

74 }
75
76 fn compact(&mut self, index: u64, term: u64) -> Result<()> {
77 self.entries.retain(|e| e.index > index);
78 self.snapshot_index = index;
79 self.snapshot_term = term;
80 Ok(())
81 }
82
83 fn snapshot_metadata(&self) -> (u64, u64) {
84 (self.snapshot_index, self.snapshot_term)

Callers 2

apply_snapshotMethod · 0.45
mem_storage_compactFunction · 0.45

Calls

no outgoing calls

Tested by 1

mem_storage_compactFunction · 0.36