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

Method replace

nodedb/src/engine/array/store/manifest.rs:132–138  ·  view source on GitHub ↗

Replace `removed` ids with the new `added` segments. Used by the compaction merger after it has produced a replacement segment.

(&mut self, removed: &[String], added: Vec<SegmentRef>)

Source from the content-addressed store, hash-verified

130 /// Replace `removed` ids with the new `added` segments. Used by the
131 /// compaction merger after it has produced a replacement segment.
132 pub fn replace(&mut self, removed: &[String], added: Vec<SegmentRef>) {
133 self.segments.retain(|s| !removed.contains(&s.id));
134 for seg in added {
135 self.durable_lsn = self.durable_lsn.max(seg.flush_lsn);
136 self.segments.push(seg);
137 }
138 }
139
140 pub fn segments_at_level(&self, level: u8) -> impl Iterator<Item = &SegmentRef> {
141 self.segments.iter().filter(move |s| s.level == level)

Callers 15

parse_default_literalMethod · 0.80
quote_identifierFunction · 0.80
quote_string_literalFunction · 0.80
quote_identFunction · 0.80
extract_quoted_cronFunction · 0.80
consume_quotedFunction · 0.80
parse_predicate_valueFunction · 0.80
try_evalFunction · 0.80
execute_then_actionFunction · 0.80
evaluate_to_valueFunction · 0.80
rotate_master_keyMethod · 0.80
base64_url_decodeFunction · 0.80

Calls 2

containsMethod · 0.45
pushMethod · 0.45

Tested by 1