@@ -581,11 +581,10 @@ pub mod dd_builder {
581581
582582 use timely:: container:: PushInto ;
583583
584- use differential_dataflow:: IntoOwned ;
585584 use differential_dataflow:: trace:: Builder ;
586585 use differential_dataflow:: trace:: Description ;
587586 use differential_dataflow:: trace:: implementations:: Layout ;
588- use differential_dataflow:: trace:: implementations:: Update ;
587+ use differential_dataflow:: trace:: implementations:: layout ;
589588 use differential_dataflow:: trace:: implementations:: BatchContainer ;
590589 use differential_dataflow:: trace:: implementations:: ord_neu:: { OrdValBatch , val_batch:: OrdValStorage , OrdKeyBatch , Vals , Upds , layers:: UpdsBuilder } ;
591590 use differential_dataflow:: trace:: implementations:: ord_neu:: key_batch:: OrdKeyStorage ;
@@ -611,18 +610,16 @@ pub mod dd_builder {
611610 impl < L > Builder for OrdValBuilder < L >
612611 where
613612 L : Layout ,
614- < L :: KeyContainer as BatchContainer > :: Owned : Columnar ,
615- < L :: ValContainer as BatchContainer > :: Owned : Columnar ,
616- < L :: TimeContainer as BatchContainer > :: Owned : Columnar ,
617- < L :: DiffContainer as BatchContainer > :: Owned : Columnar ,
613+ layout :: Key < L > : Columnar ,
614+ layout :: Val < L > : Columnar ,
615+ layout :: Time < L > : Columnar ,
616+ layout :: Diff < L > : Columnar ,
618617 // These two constraints seem .. like we could potentially replace by `Columnar::Ref<'a>`.
619- for < ' a > L :: KeyContainer : PushInto < & ' a <L :: KeyContainer as BatchContainer >:: Owned > ,
620- for < ' a > L :: ValContainer : PushInto < & ' a <L :: ValContainer as BatchContainer >:: Owned > ,
621- for < ' a > <L :: TimeContainer as BatchContainer >:: ReadItem < ' a > : IntoOwned < ' a , Owned = <L :: Target as Update >:: Time > ,
622- for < ' a > <L :: DiffContainer as BatchContainer >:: ReadItem < ' a > : IntoOwned < ' a , Owned = <L :: Target as Update >:: Diff > ,
618+ for < ' a > L :: KeyContainer : PushInto < & ' a layout:: Key < L > > ,
619+ for < ' a > L :: ValContainer : PushInto < & ' a layout:: Val < L > > ,
623620 {
624- type Input = Column < ( ( < L :: KeyContainer as BatchContainer > :: Owned , < L :: ValContainer as BatchContainer > :: Owned ) , < L :: TimeContainer as BatchContainer > :: Owned , < L :: DiffContainer as BatchContainer > :: Owned ) > ;
625- type Time = < L :: Target as Update > :: Time ;
621+ type Input = Column < ( ( layout :: Key < L > , layout :: Val < L > ) , layout :: Time < L > , layout :: Diff < L > ) > ;
622+ type Time = layout :: Time < L > ;
626623 type Output = OrdValBatch < L > ;
627624
628625 fn with_capacity ( keys : usize , vals : usize , upds : usize ) -> Self {
@@ -648,44 +645,44 @@ pub mod dd_builder {
648645
649646 for ( ( key, val) , time, diff) in chunk. drain ( ) {
650647 // It would be great to avoid.
651- let key = << L :: KeyContainer as BatchContainer > :: Owned as Columnar >:: into_owned ( key) ;
652- let val = << L :: ValContainer as BatchContainer > :: Owned as Columnar >:: into_owned ( val) ;
648+ let key = <layout :: Key < L > as Columnar >:: into_owned ( key) ;
649+ let val = <layout :: Val < L > as Columnar >:: into_owned ( val) ;
653650 // These feel fine (wrt the other versions)
654- let time = << L :: TimeContainer as BatchContainer > :: Owned as Columnar >:: into_owned ( time) ;
655- let diff = << L :: DiffContainer as BatchContainer > :: Owned as Columnar >:: into_owned ( diff) ;
651+ let time = <layout :: Time < L > as Columnar >:: into_owned ( time) ;
652+ let diff = <layout :: Diff < L > as Columnar >:: into_owned ( diff) ;
656653
657654 // Pre-load the first update.
658655 if self . result . keys . is_empty ( ) {
659- self . result . vals . vals . push ( & val) ;
660- self . result . keys . push ( & key) ;
656+ self . result . vals . vals . push_into ( & val) ;
657+ self . result . keys . push_into ( & key) ;
661658 self . staging . push ( time, diff) ;
662659 }
663660 // Perhaps this is a continuation of an already received key.
664- else if self . result . keys . last ( ) . map ( |k| << L :: KeyContainer as BatchContainer > :: ReadItem < ' _ > as IntoOwned > :: borrow_as ( & key) . eq ( & k) ) . unwrap_or ( false ) {
661+ else if self . result . keys . last ( ) . map ( |k| L :: KeyContainer :: borrow_as ( & key) . eq ( & k) ) . unwrap_or ( false ) {
665662 // Perhaps this is a continuation of an already received value.
666- if self . result . vals . vals . last ( ) . map ( |v| << L :: ValContainer as BatchContainer > :: ReadItem < ' _ > as IntoOwned > :: borrow_as ( & val) . eq ( & v) ) . unwrap_or ( false ) {
663+ if self . result . vals . vals . last ( ) . map ( |v| L :: ValContainer :: borrow_as ( & val) . eq ( & v) ) . unwrap_or ( false ) {
667664 self . staging . push ( time, diff) ;
668665 } else {
669666 // New value; complete representation of prior value.
670667 self . staging . seal ( & mut self . result . upds ) ;
671668 self . staging . push ( time, diff) ;
672- self . result . vals . vals . push ( & val) ;
669+ self . result . vals . vals . push_into ( & val) ;
673670 }
674671 } else {
675672 // New key; complete representation of prior key.
676673 self . staging . seal ( & mut self . result . upds ) ;
677674 self . staging . push ( time, diff) ;
678- self . result . vals . offs . push ( self . result . vals . len ( ) ) ;
679- self . result . vals . vals . push ( & val) ;
680- self . result . keys . push ( & key) ;
675+ self . result . vals . offs . push_ref ( self . result . vals . len ( ) ) ;
676+ self . result . vals . vals . push_into ( & val) ;
677+ self . result . keys . push_into ( & key) ;
681678 }
682679 }
683680 }
684681
685682 #[ inline( never) ]
686683 fn done ( mut self , description : Description < Self :: Time > ) -> OrdValBatch < L > {
687684 self . staging . seal ( & mut self . result . upds ) ;
688- self . result . vals . offs . push ( self . result . vals . len ( ) ) ;
685+ self . result . vals . offs . push_ref ( self . result . vals . len ( ) ) ;
689686 OrdValBatch {
690687 updates : self . staging . total ( ) ,
691688 storage : self . result ,
@@ -718,18 +715,16 @@ pub mod dd_builder {
718715 impl < L > Builder for OrdKeyBuilder < L >
719716 where
720717 L : Layout ,
721- < L :: KeyContainer as BatchContainer > :: Owned : Columnar ,
722- < L :: ValContainer as BatchContainer > :: Owned : Columnar ,
723- < L :: TimeContainer as BatchContainer > :: Owned : Columnar ,
724- < L :: DiffContainer as BatchContainer > :: Owned : Columnar ,
718+ layout :: Key < L > : Columnar ,
719+ layout :: Val < L > : Columnar ,
720+ layout :: Time < L > : Columnar ,
721+ layout :: Diff < L > : Columnar ,
725722 // These two constraints seem .. like we could potentially replace by `Columnar::Ref<'a>`.
726- for < ' a > L :: KeyContainer : PushInto < & ' a <L :: KeyContainer as BatchContainer >:: Owned > ,
727- for < ' a > L :: ValContainer : PushInto < & ' a <L :: ValContainer as BatchContainer >:: Owned > ,
728- for < ' a > <L :: TimeContainer as BatchContainer >:: ReadItem < ' a > : IntoOwned < ' a , Owned = <L :: Target as Update >:: Time > ,
729- for < ' a > <L :: DiffContainer as BatchContainer >:: ReadItem < ' a > : IntoOwned < ' a , Owned = <L :: Target as Update >:: Diff > ,
723+ for < ' a > L :: KeyContainer : PushInto < & ' a layout:: Key < L > > ,
724+ for < ' a > L :: ValContainer : PushInto < & ' a layout:: Val < L > > ,
730725 {
731- type Input = Column < ( ( < L :: KeyContainer as BatchContainer > :: Owned , < L :: ValContainer as BatchContainer > :: Owned ) , < L :: TimeContainer as BatchContainer > :: Owned , < L :: DiffContainer as BatchContainer > :: Owned ) > ;
732- type Time = < L :: Target as Update > :: Time ;
726+ type Input = Column < ( ( layout :: Key < L > , layout :: Val < L > ) , layout :: Time < L > , layout :: Diff < L > ) > ;
727+ type Time = layout :: Time < L > ;
733728 type Output = OrdKeyBatch < L > ;
734729
735730 fn with_capacity ( keys : usize , _vals : usize , upds : usize ) -> Self {
@@ -754,24 +749,24 @@ pub mod dd_builder {
754749
755750 for ( ( key, _val) , time, diff) in chunk. drain ( ) {
756751 // It would be great to avoid.
757- let key = << L :: KeyContainer as BatchContainer > :: Owned as Columnar >:: into_owned ( key) ;
752+ let key = <layout :: Key < L > as Columnar >:: into_owned ( key) ;
758753 // These feel fine (wrt the other versions)
759- let time = << L :: TimeContainer as BatchContainer > :: Owned as Columnar >:: into_owned ( time) ;
760- let diff = << L :: DiffContainer as BatchContainer > :: Owned as Columnar >:: into_owned ( diff) ;
754+ let time = <layout :: Time < L > as Columnar >:: into_owned ( time) ;
755+ let diff = <layout :: Diff < L > as Columnar >:: into_owned ( diff) ;
761756
762757 // Pre-load the first update.
763758 if self . result . keys . is_empty ( ) {
764- self . result . keys . push ( & key) ;
759+ self . result . keys . push_into ( & key) ;
765760 self . staging . push ( time, diff) ;
766761 }
767762 // Perhaps this is a continuation of an already received key.
768- else if self . result . keys . last ( ) . map ( |k| << L :: KeyContainer as BatchContainer > :: ReadItem < ' _ > as IntoOwned > :: borrow_as ( & key) . eq ( & k) ) . unwrap_or ( false ) {
763+ else if self . result . keys . last ( ) . map ( |k| L :: KeyContainer :: borrow_as ( & key) . eq ( & k) ) . unwrap_or ( false ) {
769764 self . staging . push ( time, diff) ;
770765 } else {
771766 // New key; complete representation of prior key.
772767 self . staging . seal ( & mut self . result . upds ) ;
773768 self . staging . push ( time, diff) ;
774- self . result . keys . push ( & key) ;
769+ self . result . keys . push_into ( & key) ;
775770 }
776771 }
777772 }
0 commit comments