Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/operators/consolidate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,16 @@ where
/// As `consolidate` but with the ability to name the operator and specify the trace type.
pub fn consolidate_named<Tr>(&self, name: &str) -> Self
where
Tr: for<'a> crate::trace::Trace<Key<'a>=&'a D,Val<'a>=&'a (),Time=G::Timestamp,Diff=R>+'static,
Tr: crate::trace::Trace<KeyOwned = D,ValOwned = (),Time=G::Timestamp,Diff=R>+'static,
Tr::Batch: crate::trace::Batch,
Tr::Batcher: Batcher<Item = ((D,()),G::Timestamp,R), Time = G::Timestamp>,
Tr::Builder: Builder<Item = ((D,()),G::Timestamp,R), Time = G::Timestamp>,
{
use crate::operators::arrange::arrangement::Arrange;
use crate::trace::cursor::MyTrait;
self.map(|k| (k, ()))
.arrange_named::<Tr>(name)
.as_collection(|d: &D, _| d.clone())
.as_collection(|d, _| d.into_owned())
}

/// Aggregates the weights of equal records.
Expand Down
34 changes: 0 additions & 34 deletions src/trace/implementations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ impl<U: Update> Layout for Vector<U>
where
U::Key: 'static,
U::Val: 'static,
// where
// U::Key: ToOwned<Owned = U::Key> + Sized + Clone + 'static,
// U::Val: ToOwned<Owned = U::Val> + Sized + Clone + 'static,
{
type Target = U;
type KeyContainer = Vec<U::Key>;
Expand Down Expand Up @@ -188,37 +185,6 @@ where
type UpdContainer = Vec<(T, D)>;
}


// /// A container that can retain/discard from some offset onward.
// pub trait RetainFrom<T: ?Sized> {
// /// Retains elements from an index onwards that satisfy a predicate.
// fn retain_from<P: FnMut(usize, &T)->bool>(&mut self, index: usize, predicate: P);
// }

// impl<T> RetainFrom<T> for Vec<T> {
// fn retain_from<P: FnMut(usize, &T)->bool>(&mut self, index: usize, mut predicate: P) {
// let mut write_position = index;
// for position in index .. self.len() {
// if predicate(position, &self[position]) {
// self.swap(position, write_position);
// write_position += 1;
// }
// }
// self.truncate(write_position);
// }
// }

// impl<T: Columnation> RetainFrom<T> for TimelyStack<T> {
// fn retain_from<P: FnMut(usize, &T)->bool>(&mut self, index: usize, mut predicate: P) {
// let mut position = index;
// self.retain_from(index, |item| {
// let result = predicate(position, item);
// position += 1;
// result
// })
// }
// }

use std::convert::TryInto;
use abomonation_derive::Abomonation;

Expand Down
4 changes: 2 additions & 2 deletions src/trace/implementations/ord_neu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ use crate::trace::rc_blanket_impls::RcBuilder;

use super::{Update, Layout, Vector, TStack, Preferred};

use self::val_batch::{OrdValBatch, OrdValBuilder};
use self::key_batch::{OrdKeyBatch, OrdKeyBuilder};
pub use self::val_batch::{OrdValBatch, OrdValBuilder};
pub use self::key_batch::{OrdKeyBatch, OrdKeyBuilder};

/// A trace implementation using a spine of ordered lists.
pub type OrdValSpine<K, V, T, R> = Spine<
Expand Down