@@ -581,11 +581,10 @@ pub mod dd_builder {
581
581
582
582
use timely:: container:: PushInto ;
583
583
584
- use differential_dataflow:: IntoOwned ;
585
584
use differential_dataflow:: trace:: Builder ;
586
585
use differential_dataflow:: trace:: Description ;
587
586
use differential_dataflow:: trace:: implementations:: Layout ;
588
- use differential_dataflow:: trace:: implementations:: Update ;
587
+ use differential_dataflow:: trace:: implementations:: layout ;
589
588
use differential_dataflow:: trace:: implementations:: BatchContainer ;
590
589
use differential_dataflow:: trace:: implementations:: ord_neu:: { OrdValBatch , val_batch:: OrdValStorage , OrdKeyBatch , Vals , Upds , layers:: UpdsBuilder } ;
591
590
use differential_dataflow:: trace:: implementations:: ord_neu:: key_batch:: OrdKeyStorage ;
@@ -611,18 +610,16 @@ pub mod dd_builder {
611
610
impl < L > Builder for OrdValBuilder < L >
612
611
where
613
612
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 ,
618
617
// 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 > > ,
623
620
{
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 > ;
626
623
type Output = OrdValBatch < L > ;
627
624
628
625
fn with_capacity ( keys : usize , vals : usize , upds : usize ) -> Self {
@@ -648,44 +645,44 @@ pub mod dd_builder {
648
645
649
646
for ( ( key, val) , time, diff) in chunk. drain ( ) {
650
647
// 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) ;
653
650
// 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) ;
656
653
657
654
// Pre-load the first update.
658
655
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) ;
661
658
self . staging . push ( time, diff) ;
662
659
}
663
660
// 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 ) {
665
662
// 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 ) {
667
664
self . staging . push ( time, diff) ;
668
665
} else {
669
666
// New value; complete representation of prior value.
670
667
self . staging . seal ( & mut self . result . upds ) ;
671
668
self . staging . push ( time, diff) ;
672
- self . result . vals . vals . push ( & val) ;
669
+ self . result . vals . vals . push_into ( & val) ;
673
670
}
674
671
} else {
675
672
// New key; complete representation of prior key.
676
673
self . staging . seal ( & mut self . result . upds ) ;
677
674
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) ;
681
678
}
682
679
}
683
680
}
684
681
685
682
#[ inline( never) ]
686
683
fn done ( mut self , description : Description < Self :: Time > ) -> OrdValBatch < L > {
687
684
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 ( ) ) ;
689
686
OrdValBatch {
690
687
updates : self . staging . total ( ) ,
691
688
storage : self . result ,
@@ -718,18 +715,16 @@ pub mod dd_builder {
718
715
impl < L > Builder for OrdKeyBuilder < L >
719
716
where
720
717
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 ,
725
722
// 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 > > ,
730
725
{
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 > ;
733
728
type Output = OrdKeyBatch < L > ;
734
729
735
730
fn with_capacity ( keys : usize , _vals : usize , upds : usize ) -> Self {
@@ -754,24 +749,24 @@ pub mod dd_builder {
754
749
755
750
for ( ( key, _val) , time, diff) in chunk. drain ( ) {
756
751
// 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) ;
758
753
// 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) ;
761
756
762
757
// Pre-load the first update.
763
758
if self . result . keys . is_empty ( ) {
764
- self . result . keys . push ( & key) ;
759
+ self . result . keys . push_into ( & key) ;
765
760
self . staging . push ( time, diff) ;
766
761
}
767
762
// 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 ) {
769
764
self . staging . push ( time, diff) ;
770
765
} else {
771
766
// New key; complete representation of prior key.
772
767
self . staging . seal ( & mut self . result . upds ) ;
773
768
self . staging . push ( time, diff) ;
774
- self . result . keys . push ( & key) ;
769
+ self . result . keys . push_into ( & key) ;
775
770
}
776
771
}
777
772
}
0 commit comments