@@ -16,14 +16,13 @@ use std::time::Duration;
1616
1717use mz_compute_client:: logging:: LoggingConfig ;
1818use mz_ore:: cast:: CastFrom ;
19- use mz_ore:: flatcontainer:: { MzOffsetOptimized , MzRegionPreference , OwnedRegionOpinion } ;
20- use mz_ore:: region:: LgAllocVec ;
19+ use mz_ore:: flatcontainer:: { ItemRegion , MzIndexOptimized , MzRegionPreference , OwnedRegionOpinion } ;
2120use mz_repr:: { Datum , Diff , Timestamp } ;
2221use mz_timely_util:: containers:: PreallocatingCapacityContainerBuilder ;
2322use mz_timely_util:: replay:: MzReplay ;
2423use serde:: { Deserialize , Serialize } ;
2524use timely:: communication:: Allocate ;
26- use timely:: container:: flatcontainer:: FlatStack ;
25+ use timely:: container:: flatcontainer:: { FlatStack , IntoOwned , MirrorRegion } ;
2726use timely:: container:: CapacityContainerBuilder ;
2827use timely:: dataflow:: channels:: pact:: Pipeline ;
2928use timely:: dataflow:: channels:: pushers:: buffer:: Session ;
@@ -158,7 +157,7 @@ pub(super) fn construct<A: Allocate>(
158157 )
159158 . as_collection ( move |id, name| {
160159 packer. pack_slice ( & [
161- Datum :: UInt64 ( u64:: cast_from ( * id) ) ,
160+ Datum :: UInt64 ( u64:: cast_from ( id) ) ,
162161 Datum :: UInt64 ( u64:: cast_from ( worker_id) ) ,
163162 Datum :: String ( name) ,
164163 ] )
@@ -191,7 +190,7 @@ pub(super) fn construct<A: Allocate>(
191190 . as_collection ( {
192191 move |id, address| {
193192 packer. pack_by_index ( |packer, index| match index {
194- 0 => packer. push ( Datum :: UInt64 ( u64:: cast_from ( * id) ) ) ,
193+ 0 => packer. push ( Datum :: UInt64 ( u64:: cast_from ( id) ) ) ,
195194 1 => packer. push ( Datum :: UInt64 ( u64:: cast_from ( worker_id) ) ) ,
196195 2 => packer
197196 . push_list ( address. iter ( ) . map ( |i| Datum :: UInt64 ( u64:: cast_from ( * i) ) ) ) ,
@@ -272,7 +271,7 @@ pub(super) fn construct<A: Allocate>(
272271 )
273272 . as_collection ( move |operator, _| {
274273 packer. pack_slice ( & [
275- Datum :: UInt64 ( u64:: cast_from ( * operator) ) ,
274+ Datum :: UInt64 ( u64:: cast_from ( operator) ) ,
276275 Datum :: UInt64 ( u64:: cast_from ( worker_id) ) ,
277276 ] )
278277 } ) ;
@@ -362,7 +361,7 @@ struct MessageCount {
362361}
363362
364363type FlatStackFor < D > =
365- FlatStack < < ( D , Timestamp , Diff ) as MzRegionPreference >:: Region , MzOffsetOptimized > ;
364+ FlatStack < ItemRegion < < ( D , Timestamp , Diff ) as MzRegionPreference >:: Region > , MzIndexOptimized > ;
366365
367366type Pusher < D > = Counter < Timestamp , FlatStackFor < D > , Tee < Timestamp , FlatStackFor < D > > > ;
368367type OutputSession < ' a , D > =
@@ -395,7 +394,23 @@ struct ChannelDatum {
395394
396395impl MzRegionPreference for ChannelDatum {
397396 type Owned = Self ;
398- type Region = LgAllocVec < Self > ;
397+ type Region = MirrorRegion < Self > ;
398+ }
399+
400+ impl < ' a > IntoOwned < ' a > for ChannelDatum {
401+ type Owned = Self ;
402+
403+ fn into_owned ( self ) -> Self :: Owned {
404+ self
405+ }
406+
407+ fn clone_onto ( self , other : & mut Self :: Owned ) {
408+ * other = self ;
409+ }
410+
411+ fn borrow_as ( owned : & ' a Self :: Owned ) -> Self {
412+ * owned
413+ }
399414}
400415
401416#[ derive( Clone , Copy , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Serialize , Deserialize ) ]
@@ -406,7 +421,23 @@ struct ParkDatum {
406421
407422impl MzRegionPreference for ParkDatum {
408423 type Owned = Self ;
409- type Region = LgAllocVec < Self > ;
424+ type Region = MirrorRegion < Self > ;
425+ }
426+
427+ impl < ' a > IntoOwned < ' a > for ParkDatum {
428+ type Owned = Self ;
429+
430+ fn into_owned ( self ) -> Self :: Owned {
431+ self
432+ }
433+
434+ fn clone_onto ( self , other : & mut Self :: Owned ) {
435+ * other = self ;
436+ }
437+
438+ fn borrow_as ( owned : & ' a Self :: Owned ) -> Self {
439+ * owned
440+ }
410441}
411442
412443#[ derive( Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Serialize , Deserialize ) ]
@@ -417,7 +448,23 @@ struct MessageDatum {
417448
418449impl MzRegionPreference for MessageDatum {
419450 type Owned = Self ;
420- type Region = LgAllocVec < Self > ;
451+ type Region = MirrorRegion < Self > ;
452+ }
453+
454+ impl < ' a > IntoOwned < ' a > for MessageDatum {
455+ type Owned = Self ;
456+
457+ fn into_owned ( self ) -> Self :: Owned {
458+ self
459+ }
460+
461+ fn clone_onto ( self , other : & mut Self :: Owned ) {
462+ * other = self ;
463+ }
464+
465+ fn borrow_as ( owned : & ' a Self :: Owned ) -> Self {
466+ * owned
467+ }
421468}
422469
423470#[ derive( Clone , Copy , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , Serialize , Deserialize ) ]
@@ -428,7 +475,23 @@ struct ScheduleHistogramDatum {
428475
429476impl MzRegionPreference for ScheduleHistogramDatum {
430477 type Owned = Self ;
431- type Region = LgAllocVec < Self > ;
478+ type Region = MirrorRegion < Self > ;
479+ }
480+
481+ impl < ' a > IntoOwned < ' a > for ScheduleHistogramDatum {
482+ type Owned = Self ;
483+
484+ fn into_owned ( self ) -> Self :: Owned {
485+ self
486+ }
487+
488+ fn clone_onto ( self , other : & mut Self :: Owned ) {
489+ * other = self ;
490+ }
491+
492+ fn borrow_as ( owned : & ' a Self :: Owned ) -> Self {
493+ * owned
494+ }
432495}
433496
434497/// Event handler of the demux operator.
0 commit comments