|
89 | 89 | { |
90 | 90 | fn reduce_named<L, V2: Data, R2: Ord+Abelian+'static>(&self, name: &str, logic: L) -> Collection<G, (K, V2), R2> |
91 | 91 | where L: FnMut(&K, &[(&V, R)], &mut Vec<(V2, R2)>)+'static { |
92 | | - self.reduce_abelian::<_,K,V2,ValBuilder<_,_,_,_>,ValSpine<_,_,_,_>>(name, logic) |
| 92 | + self.reduce_abelian::<_,ValBuilder<_,_,_,_>,ValSpine<K,V2,_,_>>(name, logic) |
93 | 93 | .as_collection(|k,v| (k.clone(), v.clone())) |
94 | 94 | } |
95 | 95 | } |
@@ -164,7 +164,7 @@ where |
164 | 164 | T1: for<'a> TraceReader<Key<'a>=&'a K, KeyOwn = K, Val<'a>=&'a (), Diff=R1>+Clone+'static, |
165 | 165 | { |
166 | 166 | fn threshold_named<R2: Ord+Abelian+'static, F: FnMut(&K,&R1)->R2+'static>(&self, name: &str, mut thresh: F) -> Collection<G, K, R2> { |
167 | | - self.reduce_abelian::<_,K,(),KeyBuilder<K,G::Timestamp,R2>,KeySpine<K,G::Timestamp,R2>>(name, move |k,s,t| t.push(((), thresh(k, &s[0].1)))) |
| 167 | + self.reduce_abelian::<_,KeyBuilder<K,G::Timestamp,R2>,KeySpine<K,G::Timestamp,R2>>(name, move |k,s,t| t.push(((), thresh(k, &s[0].1)))) |
168 | 168 | .as_collection(|k,_| k.clone()) |
169 | 169 | } |
170 | 170 | } |
@@ -211,7 +211,7 @@ where |
211 | 211 | T1: for<'a> TraceReader<Key<'a>=&'a K, KeyOwn = K, Val<'a>=&'a (), Diff=R>+Clone+'static, |
212 | 212 | { |
213 | 213 | fn count_core<R2: Ord + Abelian + From<i8> + 'static>(&self) -> Collection<G, (K, R), R2> { |
214 | | - self.reduce_abelian::<_,K,R,ValBuilder<K,R,G::Timestamp,R2>,ValSpine<K,R,G::Timestamp,R2>>("Count", |_k,s,t| t.push((s[0].1.clone(), R2::from(1i8)))) |
| 214 | + self.reduce_abelian::<_,ValBuilder<K,R,G::Timestamp,R2>,ValSpine<K,R,G::Timestamp,R2>>("Count", |_k,s,t| t.push((s[0].1.clone(), R2::from(1i8)))) |
215 | 215 | .as_collection(|k,c| (k.clone(), c.clone())) |
216 | 216 | } |
217 | 217 | } |
@@ -303,22 +303,20 @@ where |
303 | 303 | L: FnMut(&K, &[(&V, R)], &mut Vec<(V,T2::Diff)>, &mut Vec<(V, T2::Diff)>)+'static, |
304 | 304 | { |
305 | 305 | self.arrange_by_key_named(&format!("Arrange: {}", name)) |
306 | | - .reduce_core::<_,_,_,Bu,_>(name, logic) |
| 306 | + .reduce_core::<_,Bu,_>(name, logic) |
307 | 307 | } |
308 | 308 | } |
309 | 309 |
|
310 | 310 | /// A key-wise reduction of values in an input trace. |
311 | 311 | /// |
312 | 312 | /// This method exists to provide reduce functionality without opinions about qualifying trace types. |
313 | | -pub fn reduce_trace<G, T1, Bu, T2, K, V, L>(trace: &Arranged<G, T1>, name: &str, mut logic: L) -> Arranged<G, TraceAgent<T2>> |
| 313 | +pub fn reduce_trace<G, T1, Bu, T2, L>(trace: &Arranged<G, T1>, name: &str, mut logic: L) -> Arranged<G, TraceAgent<T2>> |
314 | 314 | where |
315 | 315 | G: Scope<Timestamp=T1::Time>, |
316 | | - T1: for<'a> TraceReader<KeyOwn = K> + Clone + 'static, |
317 | | - T2: for<'a> Trace<Key<'a>=T1::Key<'a>, ValOwn = V, Time=T1::Time> + 'static, |
318 | | - K: Ord + 'static, |
319 | | - V: Data, |
320 | | - Bu: Builder<Time=T2::Time, Output = T2::Batch, Input: Container + PushInto<((K, V), T2::Time, T2::Diff)>>, |
321 | | - L: FnMut(T1::Key<'_>, &[(T1::Val<'_>, T1::Diff)], &mut Vec<(V,T2::Diff)>, &mut Vec<(V, T2::Diff)>)+'static, |
| 316 | + T1: TraceReader<KeyOwn: Ord> + Clone + 'static, |
| 317 | + T2: for<'a> Trace<Key<'a>=T1::Key<'a>, KeyOwn=T1::KeyOwn, ValOwn: Data, Time=T1::Time> + 'static, |
| 318 | + Bu: Builder<Time=T2::Time, Output = T2::Batch, Input: Container + PushInto<((T1::KeyOwn, T2::ValOwn), T2::Time, T2::Diff)>>, |
| 319 | + L: FnMut(T1::Key<'_>, &[(T1::Val<'_>, T1::Diff)], &mut Vec<(T2::ValOwn,T2::Diff)>, &mut Vec<(T2::ValOwn, T2::Diff)>)+'static, |
322 | 320 | { |
323 | 321 | let mut result_trace = None; |
324 | 322 |
|
@@ -352,7 +350,7 @@ where |
352 | 350 |
|
353 | 351 | // Our implementation maintains a list of outstanding `(key, time)` synthetic interesting times, |
354 | 352 | // as well as capabilities for these times (or their lower envelope, at least). |
355 | | - let mut interesting = Vec::<(K, G::Timestamp)>::new(); |
| 353 | + let mut interesting = Vec::<(T1::KeyOwn, G::Timestamp)>::new(); |
356 | 354 | let mut capabilities = Vec::<Capability<G::Timestamp>>::new(); |
357 | 355 |
|
358 | 356 | // buffers and logic for computing per-key interesting times "efficiently". |
@@ -451,7 +449,7 @@ where |
451 | 449 | // |
452 | 450 | // TODO: It would be better if all updates went into one batch, but timely dataflow prevents |
453 | 451 | // this as long as it requires that there is only one capability for each message. |
454 | | - let mut buffers = Vec::<(G::Timestamp, Vec<(V, G::Timestamp, T2::Diff)>)>::new(); |
| 452 | + let mut buffers = Vec::<(G::Timestamp, Vec<(T2::ValOwn, G::Timestamp, T2::Diff)>)>::new(); |
455 | 453 | let mut builders = Vec::new(); |
456 | 454 | for cap in capabilities.iter() { |
457 | 455 | buffers.push((cap.time().clone(), Vec::new())); |
|
0 commit comments