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

Method execute_edge_delete_batch

nodedb/src/data/executor/handlers/graph.rs:181–213  ·  view source on GitHub ↗

Apply a batched edge delete in a single SPSC round-trip.

(
        &mut self,
        task: &ExecutionTask,
        tid: u64,
        edges: &[nodedb_physical::physical_plan::BatchEdge],
    )

Source from the content-addressed store, hash-verified

179
180 /// Apply a batched edge delete in a single SPSC round-trip.
181 pub(in crate::data::executor) fn execute_edge_delete_batch(
182 &mut self,
183 task: &ExecutionTask,
184 tid: u64,
185 edges: &[nodedb_physical::physical_plan::BatchEdge],
186 ) -> Response {
187 debug!(
188 core = self.core_id,
189 count = edges.len(),
190 "edge delete batch"
191 );
192 for edge in edges {
193 let ord = self.hlc.next_ordinal();
194 use crate::engine::graph::edge_store::EdgeRef;
195 let _ = self.edge_store.soft_delete_edge(
196 EdgeRef::new(
197 TenantId::new(tid),
198 &edge.collection,
199 &edge.src_id,
200 &edge.label,
201 &edge.dst_id,
202 ),
203 ord,
204 );
205 let partition = self.csr_partition_mut(tid);
206 partition.remove_edge(&edge.src_id, &edge.label, &edge.dst_id);
207 }
208 if !edges.is_empty() {
209 self.checkpoint_coordinator
210 .mark_dirty("sparse", edges.len());
211 }
212 self.response_ok(task)
213 }
214
215 pub(in crate::data::executor) fn execute_edge_delete(
216 &mut self,

Callers 1

dispatch_graphMethod · 0.80

Calls 8

next_ordinalMethod · 0.80
soft_delete_edgeMethod · 0.80
csr_partition_mutMethod · 0.80
mark_dirtyMethod · 0.80
response_okMethod · 0.80
remove_edgeMethod · 0.45
is_emptyMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected