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

Method poll_build_completions

nodedb/src/data/executor/vector_checkpoint.rs:33–48  ·  view source on GitHub ↗

Drain completed HNSW builds from the background builder thread and promote the corresponding building segments to sealed segments. Called at the top of `tick()` before draining new requests. `BuildComplete.key` is the old-style `"{tid}:{coll}"` string (produced by `VectorCollection::seal` which still takes `&str`). Parse it back to the tuple key to look up the map.

(&mut self)

Source from the content-addressed store, hash-verified

31 /// by `VectorCollection::seal` which still takes `&str`). Parse it back to
32 /// the tuple key to look up the map.
33 pub fn poll_build_completions(&mut self) {
34 let Some(rx) = &self.build_rx else { return };
35 while let Ok(complete) = rx.try_recv() {
36 // Parse the string key `"{tid}:{coll_key}"` back into the tuple.
37 let tuple_key = parse_build_key(&complete.key);
38 if let Some(coll) = self.vector_collections.get_mut(&tuple_key) {
39 coll.complete_build(complete.segment_id, complete.index);
40 tracing::info!(
41 core = self.core_id,
42 key = %complete.key,
43 segment_id = complete.segment_id,
44 "HNSW build completed, segment promoted to sealed"
45 );
46 }
47 }
48 }
49
50 /// Write HNSW checkpoints for all vector indexes to disk.
51 ///

Callers 1

tickMethod · 0.80

Calls 4

parse_build_keyFunction · 0.85
try_recvMethod · 0.80
complete_buildMethod · 0.80
get_mutMethod · 0.45

Tested by

no test coverage detected