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

Method query

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

Find segments overlapping a time range for a given series.

(&self, series_id: SeriesId, range: &TimeRange)

Source from the content-addressed store, hash-verified

37
38 /// Find segments overlapping a time range for a given series.
39 pub fn query(&self, series_id: SeriesId, range: &TimeRange) -> Vec<&SegmentRef> {
40 let Some(tree) = self.entries.get(&series_id) else {
41 return Vec::new();
42 };
43 tree.values()
44 .filter(|seg| seg.max_ts >= range.start_ms && seg.min_ts <= range.end_ms)
45 .collect()
46 }
47
48 /// Find ALL segments older than a given timestamp (for retention/compaction).
49 pub fn segments_older_than(&self, cutoff_ts: i64) -> Vec<(SeriesId, i64, SegmentRef)> {

Callers 6

segment_index_basicFunction · 0.45
scan_metricsMethod · 0.45
scan_logsMethod · 0.45
setup_test_dataFunction · 0.45

Calls 2

collectMethod · 0.80
getMethod · 0.45

Tested by 2

segment_index_basicFunction · 0.36