@@ -24,22 +24,20 @@ use mz_ore::cast::CastFrom;
2424use mz_repr:: { Datum , Diff , GlobalId , Timestamp } ;
2525use mz_timely_util:: containers:: { Column , ColumnBuilder , ProvidedBuilder } ;
2626use mz_timely_util:: replay:: MzReplay ;
27- use timely:: container:: CapacityContainerBuilder ;
2827use timely:: dataflow:: channels:: pact:: Pipeline ;
29- use timely:: dataflow:: channels:: pushers:: buffer:: Session ;
30- use timely:: dataflow:: channels:: pushers:: { Counter , Tee } ;
3128use timely:: dataflow:: operators:: core:: Map ;
3229use timely:: dataflow:: operators:: generic:: builder_rc:: OperatorBuilder ;
33- use timely:: dataflow:: operators:: Operator ;
34- use timely:: dataflow:: { Scope , Stream } ;
30+ use timely:: dataflow:: operators:: { Concatenate , Enter , Operator } ;
31+ use timely:: dataflow:: { Scope , Stream , StreamCore } ;
3532use timely:: scheduling:: Scheduler ;
3633use timely:: { Container , Data } ;
3734use tracing:: error;
3835use uuid:: Uuid ;
3936
4037use crate :: extensions:: arrange:: MzArrange ;
4138use crate :: logging:: {
42- ComputeLog , EventQueue , LogCollection , LogVariant , PermutedRowPacker , SharedLoggingState ,
39+ ComputeLog , EventQueue , LogCollection , LogVariant , OutputSessionColumnar , OutputSessionVec ,
40+ PermutedRowPacker , SharedLoggingState , Update ,
4341} ;
4442use crate :: row_spine:: { RowRowBatcher , RowRowBuilder } ;
4543use crate :: typedefs:: RowRowSpine ;
@@ -299,6 +297,7 @@ pub(super) fn construct<A: Scheduler + 'static, S: Scope<Timestamp = Timestamp>>
299297 scheduler : A ,
300298 config : & mz_compute_client:: logging:: LoggingConfig ,
301299 event_queue : EventQueue < Column < ( Duration , ComputeEvent ) > > ,
300+ compute_event_stream : impl IntoIterator < Item = StreamCore < S , Column < ( Duration , ComputeEvent ) > > > ,
302301 shared_state : Rc < RefCell < SharedLoggingState > > ,
303302) -> BTreeMap < LogVariant , LogCollection > {
304303 let logging_interval_ms = std:: cmp:: max ( 1 , config. interval . as_millis ( ) ) ;
@@ -319,6 +318,12 @@ pub(super) fn construct<A: Scheduler + 'static, S: Scope<Timestamp = Timestamp>>
319318 } ,
320319 ) ;
321320
321+ let logs = compute_event_stream
322+ . into_iter ( )
323+ . map ( |stream| stream. enter ( scope) )
324+ . chain ( std:: iter:: once ( logs) ) ;
325+ let logs = scope. concatenate ( logs) ;
326+
322327 // Build a demux operator that splits the replayed event stream up into the separate
323328 // logging streams.
324329 let mut demux = OperatorBuilder :: new ( "Compute Logging Demux" . to_string ( ) , scope. clone ( ) ) ;
@@ -663,34 +668,21 @@ struct ArrangementSizeState {
663668 count : isize ,
664669}
665670
666- /// An update of value `D` at a time and with a diff.
667- type Update < D > = ( D , Timestamp , Diff ) ;
668- /// A pusher for updates of value `D` for vector-based containers.
669- type Pusher < D > = Counter < Timestamp , Vec < Update < D > > , Tee < Timestamp , Vec < Update < D > > > > ;
670- /// A pusher for updates of value `D` for columnar containers.
671- type PusherColumnar < D > = Counter < Timestamp , Column < Update < D > > , Tee < Timestamp , Column < Update < D > > > > ;
672- /// An output session for vector-based containers of updates `D`, using a capacity container builder.
673- type OutputSession < ' a , D > =
674- Session < ' a , Timestamp , CapacityContainerBuilder < Vec < Update < D > > > , Pusher < D > > ;
675- /// An output session for columnar containers of updates `D`, using a column builder.
676- type OutputSessionColumnar < ' a , D > =
677- Session < ' a , Timestamp , ColumnBuilder < Update < D > > , PusherColumnar < D > > ;
678-
679671/// Bundled output sessions used by the demux operator.
680672struct DemuxOutput < ' a > {
681- export : OutputSession < ' a , ExportDatum > ,
682- frontier : OutputSession < ' a , FrontierDatum > ,
683- import_frontier : OutputSession < ' a , ImportFrontierDatum > ,
684- peek : OutputSession < ' a , PeekDatum > ,
685- peek_duration : OutputSession < ' a , PeekDurationDatum > ,
686- shutdown_duration : OutputSession < ' a , u128 > ,
687- arrangement_heap_size : OutputSession < ' a , ArrangementHeapDatum > ,
688- arrangement_heap_capacity : OutputSession < ' a , ArrangementHeapDatum > ,
689- arrangement_heap_allocations : OutputSession < ' a , ArrangementHeapDatum > ,
690- hydration_time : OutputSession < ' a , HydrationTimeDatum > ,
691- error_count : OutputSession < ' a , ErrorCountDatum > ,
692- lir_mapping : OutputSessionColumnar < ' a , LirMappingDatum > ,
693- dataflow_global_ids : OutputSession < ' a , DataflowGlobalDatum > ,
673+ export : OutputSessionVec < ' a , Update < ExportDatum > > ,
674+ frontier : OutputSessionVec < ' a , Update < FrontierDatum > > ,
675+ import_frontier : OutputSessionVec < ' a , Update < ImportFrontierDatum > > ,
676+ peek : OutputSessionVec < ' a , Update < PeekDatum > > ,
677+ peek_duration : OutputSessionVec < ' a , Update < PeekDurationDatum > > ,
678+ shutdown_duration : OutputSessionVec < ' a , Update < u128 > > ,
679+ arrangement_heap_size : OutputSessionVec < ' a , Update < ArrangementHeapDatum > > ,
680+ arrangement_heap_capacity : OutputSessionVec < ' a , Update < ArrangementHeapDatum > > ,
681+ arrangement_heap_allocations : OutputSessionVec < ' a , Update < ArrangementHeapDatum > > ,
682+ hydration_time : OutputSessionVec < ' a , Update < HydrationTimeDatum > > ,
683+ error_count : OutputSessionVec < ' a , Update < ErrorCountDatum > > ,
684+ lir_mapping : OutputSessionColumnar < ' a , Update < LirMappingDatum > > ,
685+ dataflow_global_ids : OutputSessionVec < ' a , Update < DataflowGlobalDatum > > ,
694686}
695687
696688#[ derive( Clone ) ]
0 commit comments