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

Method acquire_scan_guard

nodedb/src/data/executor/core_loop/accessors.rs:25–43  ·  view source on GitHub ↗

Acquire a scan guard for `(tid, collection)`. Returns `Ok(None)` if no quiesce registry is installed (e.g. in tests) — callers treat that as "scan unconditionally". Returns `Err(Response)` carrying a `NodeDbError::collection_draining` error code when a drain is in progress against the collection.

(
        &self,
        task: &crate::data::executor::task::ExecutionTask,
        tid: u64,
        collection: &str,
    )

Source from the content-addressed store, hash-verified

23 /// carrying a `NodeDbError::collection_draining` error code when
24 /// a drain is in progress against the collection.
25 pub(in crate::data::executor) fn acquire_scan_guard(
26 &self,
27 task: &crate::data::executor::task::ExecutionTask,
28 tid: u64,
29 collection: &str,
30 ) -> Result<Option<crate::bridge::quiesce::ScanGuard>, crate::bridge::envelope::Response> {
31 let Some(q) = self.quiesce.as_ref() else {
32 return Ok(None);
33 };
34 match q.try_start_scan(tid, collection) {
35 Ok(g) => Ok(Some(g)),
36 Err(_) => Err(self.response_error(
37 task,
38 crate::bridge::envelope::ErrorCode::CollectionDraining {
39 collection: collection.to_string(),
40 },
41 )),
42 }
43 }
44
45 /// Install the encryption key used for vector checkpoint at-rest encryption.
46 ///

Callers 15

execute_text_searchMethod · 0.80
execute_phrase_searchMethod · 0.80
execute_hybrid_searchMethod · 0.80
execute_spatial_scanMethod · 0.80
execute_vector_searchMethod · 0.80
execute_kv_scanMethod · 0.80
execute_document_scanMethod · 0.80

Calls 4

try_start_scanMethod · 0.80
response_errorMethod · 0.80
to_stringMethod · 0.80
as_refMethod · 0.45

Tested by

no test coverage detected