(&mut self, task: &ExecutionTask, op: &GraphOp)
| 11 | |
| 12 | impl CoreLoop { |
| 13 | pub(super) fn dispatch_graph(&mut self, task: &ExecutionTask, op: &GraphOp) -> Response { |
| 14 | let tid = task.request.tenant_id.as_u64(); |
| 15 | // Pressure guard for write operations. |
| 16 | let is_write = matches!( |
| 17 | op, |
| 18 | GraphOp::EdgePut { .. } |
| 19 | | GraphOp::EdgePutBatch { .. } |
| 20 | | GraphOp::EdgeDelete { .. } |
| 21 | | GraphOp::EdgeDeleteBatch { .. } |
| 22 | ); |
| 23 | if is_write && let Some(r) = self.check_engine_pressure(task, nodedb_mem::EngineId::Graph) { |
| 24 | return r; |
| 25 | } |
| 26 | match op { |
| 27 | GraphOp::EdgePut { |
| 28 | collection, |
| 29 | src_id, |
| 30 | label, |
| 31 | dst_id, |
| 32 | properties, |
| 33 | src_surrogate, |
| 34 | dst_surrogate, |
| 35 | } => self.execute_edge_put( |
| 36 | task, |
| 37 | tid, |
| 38 | collection, |
| 39 | src_id, |
| 40 | label, |
| 41 | dst_id, |
| 42 | properties, |
| 43 | *src_surrogate, |
| 44 | *dst_surrogate, |
| 45 | ), |
| 46 | |
| 47 | GraphOp::EdgePutBatch { edges } => self.execute_edge_put_batch(task, tid, edges), |
| 48 | |
| 49 | GraphOp::EdgeDelete { |
| 50 | collection, |
| 51 | src_id, |
| 52 | label, |
| 53 | dst_id, |
| 54 | } => self.execute_edge_delete(task, tid, collection, src_id, label, dst_id), |
| 55 | |
| 56 | GraphOp::EdgeDeleteBatch { edges } => self.execute_edge_delete_batch(task, tid, edges), |
| 57 | |
| 58 | GraphOp::Hop { |
| 59 | start_nodes, |
| 60 | edge_label, |
| 61 | direction, |
| 62 | depth, |
| 63 | options: _, |
| 64 | rls_filters: _, |
| 65 | frontier_bitmap, |
| 66 | } => self.execute_graph_hop( |
| 67 | task, |
| 68 | tid, |
| 69 | start_nodes, |
| 70 | edge_label, |
no test coverage detected