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

Method dispatch_document

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

Source from the content-addressed store, hash-verified

11
12impl CoreLoop {
13 pub(super) fn dispatch_document(&mut self, task: &ExecutionTask, op: &DocumentOp) -> Response {
14 let tid = task.request.tenant_id.as_u64();
15 // Pressure guard for write operations.
16 let is_write = matches!(
17 op,
18 DocumentOp::PointPut { .. }
19 | DocumentOp::PointInsert { .. }
20 | DocumentOp::PointUpdate { .. }
21 | DocumentOp::PointDelete { .. }
22 | DocumentOp::BatchInsert { .. }
23 | DocumentOp::BulkUpdate { .. }
24 | DocumentOp::BulkDelete { .. }
25 | DocumentOp::UpdateFromJoin { .. }
26 | DocumentOp::Upsert { .. }
27 | DocumentOp::InsertSelect { .. }
28 | DocumentOp::BackfillIndex { .. }
29 | DocumentOp::Merge { .. }
30 );
31 if is_write {
32 if let Some(r) =
33 self.check_engine_pressure(task, nodedb_mem::EngineId::DocumentSchemaless)
34 {
35 return r;
36 }
37 // FTS indexing is a side effect of every document write.
38 if let Some(r) = self.check_engine_pressure(task, nodedb_mem::EngineId::Fts) {
39 return r;
40 }
41 }
42 match op {
43 DocumentOp::PointGet {
44 collection,
45 document_id,
46 surrogate,
47 pk_bytes: _,
48 rls_filters,
49 system_as_of_ms,
50 valid_at_ms,
51 } => self.execute_point_get(
52 task,
53 super::super::handlers::point::get::PointGetParams {
54 tid,
55 collection,
56 document_id,
57 surrogate: *surrogate,
58 rls_filters,
59 system_as_of_ms: *system_as_of_ms,
60 valid_at_ms: *valid_at_ms,
61 },
62 ),
63
64 DocumentOp::PointPut {
65 collection,
66 document_id,
67 value,
68 surrogate,
69 pk_bytes: _,
70 } => self.execute_point_put(task, tid, collection, document_id, *surrogate, value),

Callers 1

documentMethod · 0.80

Calls 15

check_engine_pressureMethod · 0.80
execute_point_getMethod · 0.80
execute_point_putMethod · 0.80
execute_point_insertMethod · 0.80
execute_point_deleteMethod · 0.80
execute_point_updateMethod · 0.80
execute_document_scanMethod · 0.80
execute_range_scanMethod · 0.80
execute_bulk_updateMethod · 0.80

Tested by

no test coverage detected