@@ -69,7 +69,7 @@ pub struct ComponentNode {
6969 pub inputs : HashMap < Handle , Option < DFGTxInput > > ,
7070 pub results : Vec < Handle > ,
7171 pub intermediate_handles : Vec < Handle > ,
72- pub transaction_id : Handle ,
72+ pub transaction : Transaction ,
7373 pub is_uncomputable : bool ,
7474 pub component_id : usize ,
7575}
@@ -156,10 +156,10 @@ pub fn finalize(graph: &mut Dag<(bool, usize), OpEdge>) -> Vec<usize> {
156156 unneeded_nodes
157157}
158158
159- type ComponentNodes = Result < ( Vec < ComponentNode > , Vec < ( Handle , Handle ) > ) > ;
159+ type ComponentNodes = Result < ( Vec < ComponentNode > , Vec < ( Handle , Transaction ) > ) > ;
160160pub fn build_component_nodes (
161161 mut operations : Vec < DFGOp > ,
162- transaction_id : & Handle ,
162+ transaction : & Transaction ,
163163) -> ComponentNodes {
164164 operations. sort_by_key ( |o| o. output_handle . clone ( ) ) ;
165165 let mut graph: Dag < ( bool , usize ) , OpEdge > = Dag :: default ( ) ;
@@ -195,9 +195,9 @@ pub fn build_component_nodes(
195195 . map_err ( |_| SchedulerError :: CyclicDependence ) ?;
196196 }
197197 // Prune unneeded branches from the graph
198- let unneeded: Vec < ( Handle , Handle ) > = finalize ( & mut graph)
198+ let unneeded: Vec < ( Handle , Transaction ) > = finalize ( & mut graph)
199199 . into_iter ( )
200- . map ( |i| ( operations[ i] . output_handle . clone ( ) , transaction_id . clone ( ) ) )
200+ . map ( |i| ( operations[ i] . output_handle . clone ( ) , transaction . clone ( ) ) )
201201 . collect ( ) ;
202202 // Partition the graph and extract sequential components
203203 let mut execution_graph: Dag < ExecNode , ( ) > = Dag :: default ( ) ;
@@ -215,7 +215,7 @@ pub fn build_component_nodes(
215215 . ok_or ( SchedulerError :: DataflowGraphError ) ?;
216216 component_ops. push ( std:: mem:: take ( & mut operations[ op_node. 1 ] ) ) ;
217217 }
218- component. build ( component_ops, transaction_id , idx) ?;
218+ component. build ( component_ops, transaction , idx) ?;
219219 components. push ( component) ;
220220 }
221221 Ok ( ( components, unneeded) )
@@ -225,10 +225,10 @@ impl ComponentNode {
225225 pub fn build (
226226 & mut self ,
227227 mut operations : Vec < DFGOp > ,
228- transaction_id : & Handle ,
228+ transaction : & Transaction ,
229229 component_id : usize ,
230230 ) -> Result < ( ) > {
231- self . transaction_id = transaction_id . clone ( ) ;
231+ self . transaction = transaction . clone ( ) ;
232232 self . component_id = component_id;
233233 self . is_uncomputable = false ;
234234 // Gather all handles produced within the transaction
@@ -286,7 +286,7 @@ impl ComponentNode {
286286}
287287impl std:: fmt:: Debug for ComponentNode {
288288 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
289- let _ = writeln ! ( f, "Transaction: [{:?}]" , self . transaction_id ) ;
289+ let _ = writeln ! ( f, "Transaction: [{:?}]" , self . transaction ) ;
290290 let _ = writeln ! (
291291 f,
292292 "{:?}" ,
@@ -308,7 +308,7 @@ impl std::fmt::Debug for ComponentNode {
308308pub struct DFComponentGraph {
309309 pub graph : Dag < ComponentNode , ComponentEdge > ,
310310 pub needed_map : HashMap < Handle , Vec < NodeIndex > > ,
311- pub produced : HashMap < Handle , Vec < ( NodeIndex , Handle ) > > ,
311+ pub produced : HashMap < Handle , Vec < ( NodeIndex , Transaction ) > > ,
312312 pub results : Vec < DFGTxResult > ,
313313 deferred_dependences : Vec < ( NodeIndex , NodeIndex , Handle ) > ,
314314}
@@ -322,8 +322,8 @@ impl DFComponentGraph {
322322 for r in tx. results . iter ( ) {
323323 self . produced
324324 . entry ( r. clone ( ) )
325- . and_modify ( |p| p. push ( ( producer, tx. transaction_id . clone ( ) ) ) )
326- . or_insert ( vec ! [ ( producer, tx. transaction_id . clone( ) ) ] ) ;
325+ . and_modify ( |p| p. push ( ( producer, tx. transaction . clone ( ) ) ) )
326+ . or_insert ( vec ! [ ( producer, tx. transaction . clone( ) ) ] ) ;
327327 }
328328 }
329329 // Identify all dependence pairs (producer, consumer)
@@ -333,7 +333,7 @@ impl DFComponentGraph {
333333 if let Some ( producer) = self . produced . get ( i) {
334334 // If this handle is produced within this same transaction
335335 if let Some ( ( prod_idx, _) ) =
336- producer. iter ( ) . find ( |( _, tid) | * tid == tx. transaction_id )
336+ producer. iter ( ) . find ( |( _, tid) | * tid == tx. transaction )
337337 {
338338 if * prod_idx == consumer {
339339 warn ! ( target: "scheduler" , { } ,
@@ -383,7 +383,7 @@ impl DFComponentGraph {
383383 . graph
384384 . node_weight ( * consumer)
385385 . ok_or ( SchedulerError :: DataflowGraphError ) ?;
386- error ! ( target: "scheduler" , { producer_id = ?hex :: encode ( prod. transaction_id . clone( ) ) , consumer_id = ?hex :: encode ( cons. transaction_id . clone( ) ) } ,
386+ error ! ( target: "scheduler" , { producer_id = ?prod. transaction . clone( ) , consumer_id = ?cons. transaction . clone( ) } ,
387387 "Unexpected cycle in same-transaction dependence" ) ;
388388 return Err ( SchedulerError :: CyclicDependence . into ( ) ) ;
389389 }
@@ -431,11 +431,11 @@ impl DFComponentGraph {
431431 . node_weight_mut ( * idx)
432432 . ok_or ( SchedulerError :: DataflowGraphError ) ?;
433433 tx. is_uncomputable = true ;
434- error ! ( target: "scheduler" , { transaction_id = ?hex :: encode ( tx. transaction_id . clone( ) ) } ,
434+ error ! ( target: "scheduler" , { transaction = ?tx. transaction . clone( ) } ,
435435 "Transaction is part of a dependence cycle" ) ;
436436 for ( _, op) in tx. graph . graph . node_references ( ) {
437437 self . results . push ( DFGTxResult {
438- transaction_id : tx. transaction_id . clone ( ) ,
438+ transaction : tx. transaction . clone ( ) ,
439439 handle : op. result_handle . to_vec ( ) ,
440440 compressed_ct : Err ( SchedulerError :: CyclicDependence . into ( ) ) ,
441441 } ) ;
@@ -454,7 +454,7 @@ impl DFComponentGraph {
454454 . graph
455455 . node_weight ( * consumer)
456456 . ok_or ( SchedulerError :: DataflowGraphError ) ?;
457- error ! ( target: "scheduler" , { producer_id = ?hex :: encode ( prod. transaction_id . clone( ) ) , consumer_id = ?hex :: encode ( cons. transaction_id . clone( ) ) } ,
457+ error ! ( target: "scheduler" , { producer = ?prod. transaction . clone( ) , consumer_id = ?cons. transaction . clone( ) } ,
458458 "Dependence cycle when adding dependence - initial cycle detection failed" ) ;
459459 return Err ( SchedulerError :: CyclicDependence . into ( ) ) ;
460460 }
@@ -489,7 +489,7 @@ impl DFComponentGraph {
489489 if let Ok ( ref result) = result {
490490 if let Some ( ( pid, _) ) = producer
491491 . iter ( )
492- . find ( |( _, tid) | * tid == result. transaction_id )
492+ . find ( |( _, tid) | tid == result. transaction )
493493 {
494494 prod_idx = * pid;
495495 }
@@ -525,7 +525,7 @@ impl DFComponentGraph {
525525 . node_weight_mut ( prod_idx)
526526 . ok_or ( SchedulerError :: DataflowGraphError ) ?;
527527 self . results . push ( DFGTxResult {
528- transaction_id : producer_tx. transaction_id . clone ( ) ,
528+ transaction : producer_tx. transaction . clone ( ) ,
529529 handle : handle. to_vec ( ) ,
530530 compressed_ct : result. map ( |rok| rok. compressed_ct ) ,
531531 } ) ;
@@ -558,7 +558,7 @@ impl DFComponentGraph {
558558 // Add error results for all operations in this transaction
559559 for ( _idx, op) in tx_node. graph . graph . node_references ( ) {
560560 self . results . push ( DFGTxResult {
561- transaction_id : tx_node. transaction_id . clone ( ) ,
561+ transaction : tx_node. transaction . clone ( ) ,
562562 handle : op. result_handle . to_vec ( ) ,
563563 compressed_ct : Err ( SchedulerError :: MissingInputs . into ( ) ) ,
564564 } ) ;
@@ -574,14 +574,14 @@ impl DFComponentGraph {
574574 pub fn get_results ( & mut self ) -> Vec < DFGTxResult > {
575575 std:: mem:: take ( & mut self . results )
576576 }
577- pub fn get_intermediate_handles ( & mut self ) -> Vec < ( Handle , Handle ) > {
577+ pub fn get_intermediate_handles ( & mut self ) -> Vec < ( Handle , Transaction ) > {
578578 let mut res = vec ! [ ] ;
579579 for tx in self . graph . node_weights_mut ( ) {
580580 if !tx. is_uncomputable {
581581 res. append (
582582 & mut ( std:: mem:: take ( & mut tx. intermediate_handles ) )
583583 . into_iter ( )
584- . map ( |h| ( h, tx. transaction_id . clone ( ) ) )
584+ . map ( |h| ( h, tx. transaction . clone ( ) ) )
585585 . collect :: < Vec < _ > > ( ) ,
586586 ) ;
587587 }
0 commit comments