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

Method apply

nodedb-cluster/src/metadata_group/applier.rs:261–281  ·  view source on GitHub ↗
(&self, entries: &[(u64, Vec<u8>)])

Source from the content-addressed store, hash-verified

259
260impl MetadataApplier for CacheApplier {
261 fn apply(&self, entries: &[(u64, Vec<u8>)]) -> u64 {
262 let mut last = 0u64;
263 let mut guard = self
264 .cache
265 .write()
266 .unwrap_or_else(|poison| poison.into_inner());
267 for (index, data) in entries {
268 last = *index;
269 if data.is_empty() {
270 continue;
271 }
272 match decode_entry(data) {
273 Ok(entry) => {
274 guard.apply(*index, &entry);
275 self.cascade_live_state(&entry);
276 }
277 Err(e) => warn!(index = *index, error = %e, "metadata decode failed"),
278 }
279 }
280 last
281 }
282}
283
284/// No-op applier used by tests and subsystems that don't care about the

Calls 5

decode_entryFunction · 0.85
cascade_live_stateMethod · 0.80
writeMethod · 0.45
is_emptyMethod · 0.45
lastMethod · 0.45