(
&self,
task: &ExecutionTask,
tid: u64,
node_id: &str,
edge_label: &Option<String>,
direction: crate::engine::graph::edge_store::Direction,
)
| 294 | } |
| 295 | |
| 296 | pub(in crate::data::executor) fn execute_graph_neighbors( |
| 297 | &self, |
| 298 | task: &ExecutionTask, |
| 299 | tid: u64, |
| 300 | node_id: &str, |
| 301 | edge_label: &Option<String>, |
| 302 | direction: crate::engine::graph::edge_store::Direction, |
| 303 | ) -> Response { |
| 304 | debug!(core = self.core_id, tid, %node_id, ?edge_label, ?direction, "graph neighbors"); |
| 305 | let neighbors: Vec<(String, String)> = match self.csr_partition(tid) { |
| 306 | Some(partition) => partition.neighbors(node_id, edge_label.as_deref(), direction), |
| 307 | None => Vec::new(), |
| 308 | }; |
| 309 | let result: Vec<_> = neighbors |
| 310 | .iter() |
| 311 | .map( |
| 312 | |(label, node)| super::super::response_codec::NeighborEntry { |
| 313 | label: label.as_str(), |
| 314 | node: node.as_str(), |
| 315 | }, |
| 316 | ) |
| 317 | .collect(); |
| 318 | if let Some(ref m) = self.metrics { |
| 319 | m.record_graph_traversal(); |
| 320 | } |
| 321 | match super::super::response_codec::encode(&result) { |
| 322 | Ok(payload) => self.response_with_payload(task, payload), |
| 323 | Err(e) => { |
| 324 | warn!(core = self.core_id, layer = DiagnosticLayer::WireShape.as_str(), error = %e, "graph neighbors serialization failed"); |
| 325 | self.response_error( |
| 326 | task, |
| 327 | ErrorCode::Internal { |
| 328 | detail: e.to_string(), |
| 329 | }, |
| 330 | ) |
| 331 | } |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | pub(in crate::data::executor) fn execute_graph_neighbors_multi( |
| 336 | &self, |
no test coverage detected