From 186b94a19f84faab0e8956fcf1b15cdd1ab26927 Mon Sep 17 00:00:00 2001 From: Moritz Hoffmann Date: Mon, 9 Jan 2023 20:52:07 -0500 Subject: [PATCH] Loosen trait bounds on Arrange for Collection Allows to call arrange_core on a collection that cannot be exchanged. Signed-off-by: Moritz Hoffmann --- src/operators/arrange/arrangement.rs | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/operators/arrange/arrangement.rs b/src/operators/arrange/arrangement.rs index 34988adb7..2d4318e43 100644 --- a/src/operators/arrange/arrangement.rs +++ b/src/operators/arrange/arrangement.rs @@ -495,10 +495,31 @@ impl Arrange for Collection where G: Scope, G::Timestamp: Lattice+Ord, - K: ExchangeData+Hashable, - V: ExchangeData, - R: Semigroup+ExchangeData, + K: Data, + V: Data, + R: Semigroup, { + fn arrange(&self) -> Arranged> + where + K: ExchangeData + Hashable, + V: ExchangeData, + R: ExchangeData, + Tr: Trace + TraceReader + 'static, Tr::Batch: Batch + { + self.arrange_named("Arrange") + } + + fn arrange_named(&self, name: &str) -> Arranged> + where + K: ExchangeData + Hashable, + V: ExchangeData, + R: ExchangeData, + Tr: Trace + TraceReader + 'static, Tr::Batch: Batch + { + let exchange = Exchange::new(move |update: &((K,V),G::Timestamp,R)| (update.0).0.hashed().into()); + self.arrange_core(exchange, name) + } + fn arrange_core(&self, pact: P, name: &str) -> Arranged> where P: ParallelizationContract,