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

Method restore

nodedb/src/event/streaming_mv/state.rs:212–218  ·  view source on GitHub ↗

Restore group states from a persisted snapshot.

(&self, snapshot: Vec<(String, Vec<GroupState>)>)

Source from the content-addressed store, hash-verified

210
211 /// Restore group states from a persisted snapshot.
212 pub fn restore(&self, snapshot: Vec<(String, Vec<GroupState>)>) {
213 let mut groups = self.groups.write().unwrap_or_else(|p| p.into_inner());
214 groups.clear();
215 for (key, states) in snapshot {
216 groups.insert(key, states);
217 }
218 }
219
220 /// Estimated memory usage in bytes.
221 pub fn estimated_memory(&self) -> usize {

Callers 2

restore_allMethod · 0.45
snapshot_and_restoreFunction · 0.45

Calls 3

writeMethod · 0.45
clearMethod · 0.45
insertMethod · 0.45

Tested by 1

snapshot_and_restoreFunction · 0.36