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
17 changes: 14 additions & 3 deletions crates/dbsp/src/trace/ord/vec/indexed_wset_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ where
type Layers<K, V, R, O> = Layer<K, Leaf<V, R>, O>;

/// An immutable collection of update tuples.
#[derive(SizeOf)]
pub struct VecIndexedWSet<K, V, R, O = usize>
where
K: DataTrait + ?Sized,
Expand All @@ -169,9 +168,7 @@ where
/// Where all the data is.
#[doc(hidden)]
pub layer: Layers<K, V, R, O>,
#[size_of(skip)]
factories: VecIndexedWSetFactories<K, V, R>,
#[size_of(skip)]
negative_weight_count: u64,
}

Expand Down Expand Up @@ -203,6 +200,20 @@ where
}
}

impl<K, V, R, O> SizeOf for VecIndexedWSet<K, V, R, O>
where
K: DataTrait + ?Sized,
V: DataTrait + ?Sized,
R: WeightTrait + ?Sized,
O: OrdOffset,
{
fn size_of_children(&self, context: &mut size_of::Context) {
// This is only approximate but it is *much* cheaper than measuring all
// the elements individually.
context.add(self.approximate_byte_size());
}
}

impl<K, V, R, O> PartialEq for VecIndexedWSet<K, V, R, O>
where
K: DataTrait + ?Sized,
Expand Down
16 changes: 14 additions & 2 deletions crates/dbsp/src/trace/ord/vec/key_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ pub type VecKeyBatchLayer<K, T, R, O> = Layer<K, Leaf<DynDataTyped<T>, R>, O>;

/// An immutable collection of update tuples, from a contiguous interval of
/// logical times.
#[derive(SizeOf)]
pub struct VecKeyBatch<K, T, R, O = usize>
where
K: DataTrait + ?Sized,
Expand All @@ -158,10 +157,23 @@ where
{
/// Where all the dataz is.
pub layer: VecKeyBatchLayer<K, T, R, O>,
#[size_of(skip)]
factories: VecKeyBatchFactories<K, T, R>,
}

impl<K, T, R, O> SizeOf for VecKeyBatch<K, T, R, O>
where
K: DataTrait + ?Sized,
R: WeightTrait + ?Sized,
T: Timestamp,
O: OrdOffset,
{
fn size_of_children(&self, context: &mut size_of::Context) {
// This is only approximate but it is *much* cheaper than measuring all
// the elements individually.
context.add(self.approximate_byte_size());
}
}

impl<K, T, R, O> Debug for VecKeyBatch<K, T, R, O>
where
K: DataTrait + ?Sized,
Expand Down
17 changes: 15 additions & 2 deletions crates/dbsp/src/trace/ord/vec/val_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ where

/// An immutable collection of update tuples, from a contiguous interval of
/// logical times.
#[derive(SizeOf)]
pub struct VecValBatch<K, V, T, R, O = usize>
where
K: DataTrait + ?Sized,
Expand All @@ -191,7 +190,6 @@ where
T: Timestamp,
O: OrdOffset,
{
#[size_of(skip)]
factories: VecValBatchFactories<K, V, T, R>,

// #[size_of(skip)]
Expand All @@ -204,6 +202,21 @@ where
pub layer: VecValBatchLayer<K, V, T, R, O>,
}

impl<K, V, T, R, O> SizeOf for VecValBatch<K, V, T, R, O>
where
K: DataTrait + ?Sized,
V: DataTrait + ?Sized,
R: WeightTrait + ?Sized,
T: Timestamp,
O: OrdOffset,
{
fn size_of_children(&self, context: &mut size_of::Context) {
// This is only approximate but it is *much* cheaper than measuring all
// the elements individually.
context.add(self.approximate_byte_size());
}
}

unsafe impl<K, V, T, R, O> Send for VecValBatch<K, V, T, R, O>
where
K: DataTrait + ?Sized,
Expand Down
14 changes: 12 additions & 2 deletions crates/dbsp/src/trace/ord/vec/wset_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,29 @@ impl<K: DataTrait + ?Sized, R: WeightTrait + ?Sized> BatchFactories<K, DynUnit,
}

/// An immutable collection of `(key, weight)` pairs without timing information.
#[derive(SizeOf)]
pub struct VecWSet<K, R>
where
K: DataTrait + ?Sized,
R: WeightTrait + ?Sized,
{
#[doc(hidden)]
pub layer: Leaf<K, R>,
#[size_of(skip)]
factories: VecWSetFactories<K, R>,
negative_weight_count: u64,
}

impl<K, R> SizeOf for VecWSet<K, R>
where
K: DataTrait + ?Sized,
R: WeightTrait + ?Sized,
{
fn size_of_children(&self, context: &mut size_of::Context) {
// This is only approximate but it is *much* cheaper than measuring all
// the elements individually.
context.add(self.approximate_byte_size());
}
}

impl<K, R> VecWSet<K, R>
where
K: DataTrait + ?Sized,
Expand Down
Loading