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

Function parse_build_key

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

Parse a `"{tid}:{coll_key}"` string (used in `BuildComplete.key` and on-disk checkpoint filenames) back into the `(TenantId, String)` tuple map key. If the string has no `':'` separator the entire string is used as the collection key with tenant 0 (should not happen in practice).

(s: &str)

Source from the content-addressed store, hash-verified

12/// If the string has no `':'` separator the entire string is used as the
13/// collection key with tenant 0 (should not happen in practice).
14fn parse_build_key(s: &str) -> (crate::types::TenantId, String) {
15 match s.split_once(':') {
16 Some((tid_str, coll_key)) => {
17 let tid = tid_str.parse::<u64>().unwrap_or(0);
18 (crate::types::TenantId::new(tid), coll_key.to_string())
19 }
20 None => (crate::types::TenantId::new(0_u64), s.to_string()),
21 }
22}
23
24impl CoreLoop {
25 /// Drain completed HNSW builds from the background builder thread and

Callers 2

Calls 1

to_stringMethod · 0.80

Tested by

no test coverage detected