Skip to content

Commit 9ee8adf

Browse files
authored
Define columnation chunker for all (D,T,R) (#559)
It was only defined for ((K,V),T,R). Signed-off-by: Moritz Hoffmann <[email protected]>
1 parent 16ea800 commit 9ee8adf

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/trace/implementations/chunker.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,15 @@ impl<T: Columnation> Default for ColumnationChunker<T> {
138138
}
139139
}
140140

141-
impl<K,V,T,R> ColumnationChunker<((K, V), T, R)>
141+
impl<D,T,R> ColumnationChunker<(D, T, R)>
142142
where
143-
K: Columnation + Ord,
144-
V: Columnation + Ord,
143+
D: Columnation + Ord,
145144
T: Columnation + Ord,
146145
R: Columnation + Semigroup,
147146
{
148147
const BUFFER_SIZE_BYTES: usize = 64 << 10;
149148
fn chunk_capacity() -> usize {
150-
let size = ::std::mem::size_of::<((K, V), T, R)>();
149+
let size = ::std::mem::size_of::<(D, T, R)>();
151150
if size == 0 {
152151
Self::BUFFER_SIZE_BYTES
153152
} else if size <= Self::BUFFER_SIZE_BYTES {
@@ -179,14 +178,13 @@ where
179178
}
180179
}
181180

182-
impl<'a, K, V, T, R> PushInto<&'a mut Vec<((K, V), T, R)>> for ColumnationChunker<((K, V), T, R)>
181+
impl<'a, D, T, R> PushInto<&'a mut Vec<(D, T, R)>> for ColumnationChunker<(D, T, R)>
183182
where
184-
K: Columnation + Ord + Clone,
185-
V: Columnation + Ord + Clone,
183+
D: Columnation + Ord + Clone,
186184
T: Columnation + Ord + Clone,
187185
R: Columnation + Semigroup + Clone,
188186
{
189-
fn push_into(&mut self, container: &'a mut Vec<((K, V), T, R)>) {
187+
fn push_into(&mut self, container: &'a mut Vec<(D, T, R)>) {
190188
// Ensure `self.pending` has the desired capacity. We should never have a larger capacity
191189
// because we don't write more than capacity elements into the buffer.
192190
if self.pending.capacity() < Self::chunk_capacity() * 2 {
@@ -203,14 +201,13 @@ where
203201
}
204202
}
205203

206-
impl<K, V, T, R> ContainerBuilder for ColumnationChunker<((K, V), T, R)>
204+
impl<D, T, R> ContainerBuilder for ColumnationChunker<(D, T, R)>
207205
where
208-
K: Columnation + Ord + Clone + 'static,
209-
V: Columnation + Ord + Clone + 'static,
206+
D: Columnation + Ord + Clone + 'static,
210207
T: Columnation + Ord + Clone + 'static,
211208
R: Columnation + Semigroup + Clone + 'static,
212209
{
213-
type Container = TimelyStack<((K,V),T,R)>;
210+
type Container = TimelyStack<(D,T,R)>;
214211

215212
fn extract(&mut self) -> Option<&mut Self::Container> {
216213
if let Some(ready) = self.ready.pop_front() {

0 commit comments

Comments
 (0)