Skip to content
Open
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
13 changes: 10 additions & 3 deletions src/operators/arrange/upsert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,23 @@ where
let mut priority_queue = BinaryHeap::<std::cmp::Reverse<(G::Timestamp, Tr::Key, Option<Tr::Val>)>>::new();
let mut updates = Vec::new();

let mut buffers = Vec::new();

move |input, output| {

// Stash capabilities and associated data (ordered by time).
// Read input out without doing work, to avoid trapping overloaded workers.
input.for_each(|cap, data| {
capabilities.insert(cap.retain());
data.swap(&mut buffer);
for (key, val, time) in buffer.drain(..) {
buffers.push(std::mem::take(&mut buffer));
});

// Stash capabilities and associated data (ordered by time).
for buffer in buffers.drain(..) {
for (key, val, time) in buffer {
priority_queue.push(std::cmp::Reverse((time, key, val)))
}
});
}

// Test to see if strict progress has occurred, which happens whenever any element of
// the old frontier is not greater or equal to the new frontier. It is only in this
Expand Down