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

Method remove

nodedb/src/engine/timeseries/segment_index.rs:62–71  ·  view source on GitHub ↗

Remove a segment from the index.

(&mut self, series_id: SeriesId, min_ts: i64)

Source from the content-addressed store, hash-verified

60
61 /// Remove a segment from the index.
62 pub fn remove(&mut self, series_id: SeriesId, min_ts: i64) -> Option<SegmentRef> {
63 let tree = self.entries.get_mut(&series_id)?;
64 let seg = tree.remove(&min_ts)?;
65 self.total_bytes = self.total_bytes.saturating_sub(seg.size_bytes);
66 self.total_segments = self.total_segments.saturating_sub(1);
67 if tree.is_empty() {
68 self.entries.remove(&series_id);
69 }
70 Some(seg)
71 }
72
73 pub fn series_count(&self) -> usize {
74 self.entries.len()

Callers 14

insertMethod · 0.45
evict_coldMethod · 0.45
evict_tenantMethod · 0.45
apply_schema_changesFunction · 0.45
compact_to_l2Method · 0.45
insertMethod · 0.45
invalidate_partitionMethod · 0.45
evict_tenantMethod · 0.45
enforce_retentionMethod · 0.45
evict_coldest_seriesMethod · 0.45
unregisterMethod · 0.45
purge_deletedMethod · 0.45

Calls 2

get_mutMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected