4949 T : Timestamp ,
5050{
5151 type Input = Input ;
52- type Output = M :: Output ;
5352 type Time = T ;
53+ type Output = M :: Chunk ;
5454
5555 fn new ( logger : Option < Logger < DifferentialEvent , WorkerIdentifier > > , operator_id : usize ) -> Self {
5656 Self {
@@ -109,7 +109,7 @@ where
109109
110110 self . stash . clear ( ) ;
111111
112- let seal = M :: seal :: < B > ( & mut readied, self . lower . borrow ( ) , upper. borrow ( ) , Antichain :: from_elem ( T :: minimum ( ) ) . borrow ( ) ) ;
112+ let seal = B :: seal ( & mut readied, self . lower . borrow ( ) , upper. borrow ( ) , Antichain :: from_elem ( T :: minimum ( ) ) . borrow ( ) ) ;
113113 self . lower = upper;
114114 seal
115115 }
@@ -204,10 +204,6 @@ where
204204pub trait Merger : Default {
205205 /// The internal representation of chunks of data.
206206 type Chunk : Container ;
207- /// The output type
208- /// TODO: This should be replaced by `Chunk` or another container once the builder understands
209- /// building from a complete chain.
210- type Output ;
211207 /// The type of time in frontiers to extract updates.
212208 type Time ;
213209 /// Merge chains into an output chain.
@@ -223,15 +219,6 @@ pub trait Merger: Default {
223219 stash : & mut Vec < Self :: Chunk > ,
224220 ) ;
225221
226- /// Build from a chain
227- /// TODO: We can move this entirely to `MergeBatcher` once builders can accepts chains.
228- fn seal < B : Builder < Input = Self :: Output , Time = Self :: Time > > (
229- chain : & mut Vec < Self :: Chunk > ,
230- lower : AntichainRef < Self :: Time > ,
231- upper : AntichainRef < Self :: Time > ,
232- since : AntichainRef < Self :: Time > ,
233- ) -> B :: Output ;
234-
235222 /// Account size and allocation changes. Returns a tuple of (records, size, capacity, allocations).
236223 fn account ( chunk : & Self :: Chunk ) -> ( usize , usize , usize , usize ) ;
237224}
@@ -286,7 +273,6 @@ where
286273{
287274 type Time = T ;
288275 type Chunk = Vec < ( ( K , V ) , T , R ) > ;
289- type Output = Vec < ( ( K , V ) , T , R ) > ;
290276
291277 fn merge ( & mut self , list1 : Vec < Self :: Chunk > , list2 : Vec < Self :: Chunk > , output : & mut Vec < Self :: Chunk > , stash : & mut Vec < Self :: Chunk > ) {
292278 let mut list1 = list1. into_iter ( ) ;
@@ -401,45 +387,6 @@ where
401387 readied. push ( ready) ;
402388 }
403389 }
404-
405- fn seal < B : Builder < Input = Self :: Output , Time = Self :: Time > > (
406- chain : & mut Vec < Self :: Chunk > ,
407- lower : AntichainRef < Self :: Time > ,
408- upper : AntichainRef < Self :: Time > ,
409- since : AntichainRef < Self :: Time > ,
410- ) -> B :: Output {
411- let mut keys = 0 ;
412- let mut vals = 0 ;
413- let mut upds = 0 ;
414- let mut prev_keyval = None ;
415- for buffer in chain. iter ( ) {
416- for ( ( key, val) , time, _) in buffer. iter ( ) {
417- if !upper. less_equal ( time) {
418- if let Some ( ( p_key, p_val) ) = prev_keyval {
419- if p_key != key {
420- keys += 1 ;
421- vals += 1 ;
422- } else if p_val != val {
423- vals += 1 ;
424- }
425- } else {
426- keys += 1 ;
427- vals += 1 ;
428- }
429- upds += 1 ;
430- prev_keyval = Some ( ( key, val) ) ;
431- }
432- }
433- }
434- let mut builder = B :: with_capacity ( keys, vals, upds) ;
435-
436- for mut chunk in chain. drain ( ..) {
437- builder. push ( & mut chunk) ;
438- }
439-
440- builder. done ( lower. to_owned ( ) , upper. to_owned ( ) , since. to_owned ( ) )
441- }
442-
443390 fn account ( chunk : & Self :: Chunk ) -> ( usize , usize , usize , usize ) {
444391 ( chunk. len ( ) , 0 , 0 , 0 )
445392 }
0 commit comments