@@ -15,7 +15,7 @@ use crate::communication::allocator::thread::{ThreadPusher, ThreadPuller};
1515use crate :: communication:: { Push , Pull } ;
1616use crate :: container:: PushPartitioned ;
1717use crate :: dataflow:: channels:: pushers:: Exchange as ExchangePusher ;
18- use crate :: dataflow:: channels:: Bundle ;
18+ use crate :: dataflow:: channels:: Message ;
1919use crate :: logging:: { TimelyLogger as Logger , MessagesEvent } ;
2020use crate :: progress:: Timestamp ;
2121use crate :: worker:: AsWorker ;
@@ -24,9 +24,9 @@ use crate::ExchangeData;
2424/// A `ParallelizationContract` allocates paired `Push` and `Pull` implementors.
2525pub trait ParallelizationContract < T , C > {
2626 /// Type implementing `Push` produced by this pact.
27- type Pusher : Push < Bundle < T , C > > +' static ;
27+ type Pusher : Push < Message < T , C > > +' static ;
2828 /// Type implementing `Pull` produced by this pact.
29- type Puller : Pull < Bundle < T , C > > +' static ;
29+ type Puller : Pull < Message < T , C > > +' static ;
3030 /// Allocates a matched pair of push and pull endpoints implementing the pact.
3131 fn connect < A : AsWorker > ( self , allocator : & mut A , identifier : usize , address : Rc < [ usize ] > , logging : Option < Logger > ) -> ( Self :: Pusher , Self :: Puller ) ;
3232}
@@ -36,10 +36,10 @@ pub trait ParallelizationContract<T, C> {
3636pub struct Pipeline ;
3737
3838impl < T : ' static , C : Container > ParallelizationContract < T , C > for Pipeline {
39- type Pusher = LogPusher < T , C , ThreadPusher < Bundle < T , C > > > ;
40- type Puller = LogPuller < T , C , ThreadPuller < Bundle < T , C > > > ;
39+ type Pusher = LogPusher < T , C , ThreadPusher < Message < T , C > > > ;
40+ type Puller = LogPuller < T , C , ThreadPuller < Message < T , C > > > ;
4141 fn connect < A : AsWorker > ( self , allocator : & mut A , identifier : usize , address : Rc < [ usize ] > , logging : Option < Logger > ) -> ( Self :: Pusher , Self :: Puller ) {
42- let ( pusher, puller) = allocator. pipeline :: < Bundle < T , C > > ( identifier, address) ;
42+ let ( pusher, puller) = allocator. pipeline :: < Message < T , C > > ( identifier, address) ;
4343 ( LogPusher :: new ( pusher, allocator. index ( ) , allocator. index ( ) , identifier, logging. clone ( ) ) ,
4444 LogPuller :: new ( puller, allocator. index ( ) , identifier, logging) )
4545 }
@@ -71,11 +71,11 @@ where
7171 C : ExchangeData + PushPartitioned ,
7272 for < ' a > H : FnMut ( & C :: Item < ' a > ) -> u64
7373{
74- type Pusher = ExchangePusher < T , C , LogPusher < T , C , Box < dyn Push < Bundle < T , C > > > > , H > ;
75- type Puller = LogPuller < T , C , Box < dyn Pull < Bundle < T , C > > > > ;
74+ type Pusher = ExchangePusher < T , C , LogPusher < T , C , Box < dyn Push < Message < T , C > > > > , H > ;
75+ type Puller = LogPuller < T , C , Box < dyn Pull < Message < T , C > > > > ;
7676
7777 fn connect < A : AsWorker > ( self , allocator : & mut A , identifier : usize , address : Rc < [ usize ] > , logging : Option < Logger > ) -> ( Self :: Pusher , Self :: Puller ) {
78- let ( senders, receiver) = allocator. allocate :: < Bundle < T , C > > ( identifier, address) ;
78+ let ( senders, receiver) = allocator. allocate :: < Message < T , C > > ( identifier, address) ;
7979 let senders = senders. into_iter ( ) . enumerate ( ) . map ( |( i, x) | LogPusher :: new ( x, allocator. index ( ) , i, identifier, logging. clone ( ) ) ) . collect :: < Vec < _ > > ( ) ;
8080 ( ExchangePusher :: new ( senders, self . hash_func ) , LogPuller :: new ( receiver, allocator. index ( ) , identifier, logging. clone ( ) ) )
8181 }
@@ -89,7 +89,7 @@ impl<C, F> Debug for ExchangeCore<C, F> {
8989
9090/// Wraps a `Message<T,D>` pusher to provide a `Push<(T, Content<D>)>`.
9191#[ derive( Debug ) ]
92- pub struct LogPusher < T , C , P : Push < Bundle < T , C > > > {
92+ pub struct LogPusher < T , C , P : Push < Message < T , C > > > {
9393 pusher : P ,
9494 channel : usize ,
9595 counter : usize ,
@@ -99,7 +99,7 @@ pub struct LogPusher<T, C, P: Push<Bundle<T, C>>> {
9999 logging : Option < Logger > ,
100100}
101101
102- impl < T , C , P : Push < Bundle < T , C > > > LogPusher < T , C , P > {
102+ impl < T , C , P : Push < Message < T , C > > > LogPusher < T , C , P > {
103103 /// Allocates a new pusher.
104104 pub fn new ( pusher : P , source : usize , target : usize , channel : usize , logging : Option < Logger > ) -> Self {
105105 LogPusher {
@@ -114,16 +114,16 @@ impl<T, C, P: Push<Bundle<T, C>>> LogPusher<T, C, P> {
114114 }
115115}
116116
117- impl < T , C : Container , P : Push < Bundle < T , C > > > Push < Bundle < T , C > > for LogPusher < T , C , P > {
117+ impl < T , C : Container , P : Push < Message < T , C > > > Push < Message < T , C > > for LogPusher < T , C , P > {
118118 #[ inline]
119- fn push ( & mut self , pair : & mut Option < Bundle < T , C > > ) {
119+ fn push ( & mut self , pair : & mut Option < Message < T , C > > ) {
120120 if let Some ( bundle) = pair {
121121 self . counter += 1 ;
122122
123123 // Stamp the sequence number and source.
124124 // FIXME: Awkward moment/logic.
125- bundle. payload . seq = self . counter - 1 ;
126- bundle. payload . from = self . source ;
125+ bundle. seq = self . counter - 1 ;
126+ bundle. from = self . source ;
127127
128128 if let Some ( logger) = self . logging . as_ref ( ) {
129129 logger. log ( MessagesEvent {
@@ -143,15 +143,15 @@ impl<T, C: Container, P: Push<Bundle<T, C>>> Push<Bundle<T, C>> for LogPusher<T,
143143
144144/// Wraps a `Message<T,D>` puller to provide a `Pull<(T, Content<D>)>`.
145145#[ derive( Debug ) ]
146- pub struct LogPuller < T , C , P : Pull < Bundle < T , C > > > {
146+ pub struct LogPuller < T , C , P : Pull < Message < T , C > > > {
147147 puller : P ,
148148 channel : usize ,
149149 index : usize ,
150150 phantom : PhantomData < ( T , C ) > ,
151151 logging : Option < Logger > ,
152152}
153153
154- impl < T , C , P : Pull < Bundle < T , C > > > LogPuller < T , C , P > {
154+ impl < T , C , P : Pull < Message < T , C > > > LogPuller < T , C , P > {
155155 /// Allocates a new `Puller`.
156156 pub fn new ( puller : P , index : usize , channel : usize , logging : Option < Logger > ) -> Self {
157157 LogPuller {
@@ -164,9 +164,9 @@ impl<T, C, P: Pull<Bundle<T, C>>> LogPuller<T, C, P> {
164164 }
165165}
166166
167- impl < T , C : Container , P : Pull < Bundle < T , C > > > Pull < Bundle < T , C > > for LogPuller < T , C , P > {
167+ impl < T , C : Container , P : Pull < Message < T , C > > > Pull < Message < T , C > > for LogPuller < T , C , P > {
168168 #[ inline]
169- fn pull ( & mut self ) -> & mut Option < Bundle < T , C > > {
169+ fn pull ( & mut self ) -> & mut Option < Message < T , C > > {
170170 let result = self . puller . pull ( ) ;
171171 if let Some ( bundle) = result {
172172 let channel = self . channel ;
0 commit comments