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

Method scan_tiles_with_hilbert_prefix

nodedb/src/engine/array/store/catalog.rs:217–243  ·  view source on GitHub ↗

Like `scan_tiles` but also returns the tile's `hilbert_prefix` so callers can apply per-shard Hilbert-range filters (distributed agg).

(
        &self,
        pred: &MbrQueryPredicate,
    )

Source from the content-addressed store, hash-verified

215 /// Like `scan_tiles` but also returns the tile's `hilbert_prefix` so
216 /// callers can apply per-shard Hilbert-range filters (distributed agg).
217 pub fn scan_tiles_with_hilbert_prefix(
218 &self,
219 pred: &MbrQueryPredicate,
220 ) -> Result<Vec<(u64, TilePayload)>, nodedb_array::ArrayError> {
221 let mut out = Vec::new();
222 for h in self.segments.values() {
223 let reader = h.reader();
224 for idx in h.rtree().query(pred) {
225 let hilbert_prefix = reader
226 .tiles()
227 .get(idx)
228 .map(|e| e.tile_id.hilbert_prefix)
229 .unwrap_or(0);
230 out.push((hilbert_prefix, reader.read_tile(idx)?));
231 }
232 }
233 for (tile_id, buf) in self.memtable.iter() {
234 if buf.entry_count() == 0 {
235 continue;
236 }
237 out.push((
238 tile_id.hilbert_prefix,
239 TilePayload::Sparse(buf.materialise(&self.schema)?),
240 ));
241 }
242 Ok(out)
243 }
244
245 /// Bitemporal scan: resolve the ceiling for every cell coordinate at the
246 /// given `system_as_of` and optional `valid_at_ms` point.

Callers 1

scan_tilesMethod · 0.45

Calls 10

rtreeMethod · 0.80
tilesMethod · 0.80
read_tileMethod · 0.80
materialiseMethod · 0.80
readerMethod · 0.45
queryMethod · 0.45
getMethod · 0.45
pushMethod · 0.45
iterMethod · 0.45
entry_countMethod · 0.45

Tested by

no test coverage detected