Skip to content

Commit b73cc96

Browse files
committed
Remove into_owned.rs
1 parent af596dc commit b73cc96

File tree

12 files changed

+69
-275
lines changed

12 files changed

+69
-275
lines changed

differential-dataflow/src/into_owned.rs

Lines changed: 0 additions & 204 deletions
This file was deleted.

differential-dataflow/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ use std::fmt::Debug;
7979
pub use collection::{Collection, AsCollection};
8080
pub use hashable::Hashable;
8181
pub use difference::Abelian as Diff;
82-
pub use into_owned::IntoOwned;
8382

8483
/// Data type usable in differential dataflow.
8584
///
@@ -106,7 +105,6 @@ pub mod logging;
106105
pub mod consolidation;
107106
pub mod capture;
108107
pub mod containers;
109-
mod into_owned;
110108

111109
/// Configuration options for differential dataflow.
112110
#[derive(Default)]

differential-dataflow/src/operators/arrange/arrangement.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use timely::progress::Timestamp;
2626
use timely::progress::Antichain;
2727
use timely::dataflow::operators::Capability;
2828

29-
use crate::{Data, ExchangeData, Collection, AsCollection, Hashable, IntoOwned};
29+
use crate::{Data, ExchangeData, Collection, AsCollection, Hashable};
3030
use crate::difference::Semigroup;
3131
use crate::lattice::Lattice;
3232
use crate::trace::{self, Trace, TraceReader, BatchReader, Batcher, Builder, Cursor};
@@ -285,10 +285,11 @@ where
285285
/// A direct implementation of `ReduceCore::reduce_abelian`.
286286
pub fn reduce_abelian<L, K, V, Bu, T2>(&self, name: &str, mut logic: L) -> Arranged<G, TraceAgent<T2>>
287287
where
288-
for<'a> T1::Key<'a>: IntoOwned<'a, Owned = K>,
288+
T1: TraceReader<KeyOwn = K>,
289289
T2: for<'a> Trace<
290290
Key<'a>= T1::Key<'a>,
291-
Val<'a> : IntoOwned<'a, Owned = V>,
291+
KeyOwn = K,
292+
ValOwn = V,
292293
Time=T1::Time,
293294
Diff: Abelian,
294295
>+'static,
@@ -309,10 +310,11 @@ where
309310
/// A direct implementation of `ReduceCore::reduce_core`.
310311
pub fn reduce_core<L, K, V, Bu, T2>(&self, name: &str, logic: L) -> Arranged<G, TraceAgent<T2>>
311312
where
312-
for<'a> T1::Key<'a>: IntoOwned<'a, Owned = K>,
313+
T1: TraceReader<KeyOwn = K>,
313314
T2: for<'a> Trace<
314315
Key<'a>=T1::Key<'a>,
315-
Val<'a> : IntoOwned<'a, Owned = V>,
316+
KeyOwn = K,
317+
ValOwn = V,
316318
Time=T1::Time,
317319
>+'static,
318320
K: Ord + 'static,

differential-dataflow/src/operators/arrange/upsert.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ use timely::dataflow::operators::Capability;
111111
use crate::operators::arrange::arrangement::Arranged;
112112
use crate::trace::{Builder, Description};
113113
use crate::trace::{self, Trace, TraceReader, Cursor};
114-
use crate::{ExchangeData, Hashable, IntoOwned};
114+
use crate::{ExchangeData, Hashable};
115+
116+
use crate::trace::implementations::containers::BatchContainer;
115117

116118
use super::TraceAgent;
117119

@@ -131,9 +133,9 @@ pub fn arrange_from_upsert<G, K, V, Bu, Tr>(
131133
) -> Arranged<G, TraceAgent<Tr>>
132134
where
133135
G: Scope<Timestamp=Tr::Time>,
134-
Tr: Trace + for<'a> TraceReader<
135-
Key<'a> : IntoOwned<'a, Owned = K>,
136-
Val<'a> : IntoOwned<'a, Owned = V>,
136+
Tr: for<'a> Trace<
137+
KeyOwn = K,
138+
ValOwn = V,
137139
Time: TotalOrder+ExchangeData,
138140
Diff=isize,
139141
>+'static,
@@ -148,7 +150,7 @@ where
148150

149151
let reader = &mut reader;
150152

151-
let exchange = Exchange::new(move |update: &(K,Option<V>,G::Timestamp)| (update.0).hashed().into());
153+
let exchange = Exchange::<(K, Option<V>, G::Timestamp), _>::new(move |update: &(K,Option<V>,G::Timestamp)| (update.0).hashed().into());
152154

153155
stream.unary_frontier(exchange, name, move |_capability, info| {
154156

@@ -239,16 +241,16 @@ where
239241
let mut prev_value: Option<V> = None;
240242

241243
// Attempt to find the key in the trace.
242-
trace_cursor.seek_key(&trace_storage, IntoOwned::borrow_as(&key));
243-
if trace_cursor.get_key(&trace_storage).map(|k| k.eq(&IntoOwned::borrow_as(&key))).unwrap_or(false) {
244+
trace_cursor.seek_key(&trace_storage, Tr::KeyContainer::borrow_as(&key));
245+
if trace_cursor.get_key(&trace_storage).map(|k| k.eq(&Tr::KeyContainer::borrow_as(&key))).unwrap_or(false) {
244246
// Determine the prior value associated with the key.
245247
while let Some(val) = trace_cursor.get_val(&trace_storage) {
246248
let mut count = 0;
247249
trace_cursor.map_times(&trace_storage, |_time, diff| count += Tr::owned_diff(diff));
248250
assert!(count == 0 || count == 1);
249251
if count == 1 {
250252
assert!(prev_value.is_none());
251-
prev_value = Some(val.into_owned());
253+
prev_value = Some(Tr::owned_val(val));
252254
}
253255
trace_cursor.step_val(&trace_storage);
254256
}

0 commit comments

Comments
 (0)