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

Method dispatch_vector

nodedb/src/data/executor/dispatch/vector.rs:13–265  ·  view source on GitHub ↗
(&mut self, task: &ExecutionTask, op: &VectorOp)

Source from the content-addressed store, hash-verified

11
12impl CoreLoop {
13 pub(super) fn dispatch_vector(&mut self, task: &ExecutionTask, op: &VectorOp) -> Response {
14 let tid = task.request.tenant_id.as_u64();
15 // Pressure guard for all write operations.
16 let is_write = matches!(
17 op,
18 VectorOp::Insert { .. }
19 | VectorOp::BatchInsert { .. }
20 | VectorOp::SparseInsert { .. }
21 | VectorOp::MultiVectorInsert { .. }
22 | VectorOp::DirectUpsert { .. }
23 );
24 if is_write && let Some(r) = self.check_engine_pressure(task, nodedb_mem::EngineId::Vector)
25 {
26 return r;
27 }
28 match op {
29 VectorOp::Insert {
30 collection,
31 vector,
32 dim,
33 field_name,
34 surrogate,
35 } => self.execute_vector_insert(super::super::handlers::vector::VectorInsertParams {
36 task,
37 tid,
38 collection,
39 vector,
40 dim: *dim,
41 field_name,
42 surrogate: *surrogate,
43 }),
44
45 VectorOp::BatchInsert {
46 collection,
47 vectors,
48 dim,
49 surrogates,
50 } => self.execute_vector_batch_insert(task, tid, collection, vectors, *dim, surrogates),
51
52 VectorOp::MultiSearch {
53 collection,
54 query_vector,
55 top_k,
56 ef_search,
57 filter_bitmap,
58 rls_filters,
59 } => self.execute_vector_multi_search(
60 super::super::handlers::vector_search::VectorMultiSearchParams {
61 task,
62 tid,
63 collection,
64 query_vector,
65 top_k: *top_k,
66 ef_search: *ef_search,
67 filter_bitmap: filter_bitmap.as_ref(),
68 rls_filters,
69 },
70 ),

Callers 1

vectorMethod · 0.80

Tested by

no test coverage detected