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

Method execute_graph_path

nodedb/src/data/executor/handlers/graph_traversal.rs:14–58  ·  view source on GitHub ↗
(
        &self,
        task: &ExecutionTask,
        tid: u64,
        src: &str,
        dst: &str,
        edge_label: &Option<String>,
        max_depth: usize,
        frontier_bitmap: Option<&n

Source from the content-addressed store, hash-verified

12impl CoreLoop {
13 #[allow(clippy::too_many_arguments)]
14 pub(in crate::data::executor) fn execute_graph_path(
15 &self,
16 task: &ExecutionTask,
17 tid: u64,
18 src: &str,
19 dst: &str,
20 edge_label: &Option<String>,
21 max_depth: usize,
22 frontier_bitmap: Option<&nodedb_types::SurrogateBitmap>,
23 ) -> Response {
24 let max_depth =
25 max_depth.min(crate::engine::graph::traversal_options::MAX_GRAPH_TRAVERSAL_DEPTH);
26 debug!(core = self.core_id, tid, %src, %dst, ?edge_label, max_depth, "graph path");
27 let path = match self.csr_partition(tid) {
28 Some(partition) => partition.shortest_path(
29 src,
30 dst,
31 edge_label.as_deref(),
32 max_depth,
33 self.graph_tuning.max_visited,
34 frontier_bitmap,
35 ),
36 None => None,
37 };
38 match path {
39 Some(path) => {
40 if let Some(ref m) = self.metrics {
41 m.record_graph_traversal();
42 }
43 match crate::data::executor::response_codec::encode(&path) {
44 Ok(payload) => self.response_with_payload(task, payload),
45 Err(e) => {
46 warn!(core = self.core_id, layer = DiagnosticLayer::WireShape.as_str(), error = %e, "graph path serialization failed");
47 self.response_error(
48 task,
49 ErrorCode::Internal {
50 detail: e.to_string(),
51 },
52 )
53 }
54 }
55 }
56 None => self.response_error(task, ErrorCode::NotFound),
57 }
58 }
59
60 pub(in crate::data::executor) fn execute_graph_subgraph(
61 &self,

Callers 1

dispatch_graphMethod · 0.80

Calls 7

csr_partitionMethod · 0.80
shortest_pathMethod · 0.80
response_with_payloadMethod · 0.80
response_errorMethod · 0.80
to_stringMethod · 0.80
encodeFunction · 0.50

Tested by

no test coverage detected