Skip to content

Conversation

antiguru
Copy link
Member

@antiguru antiguru commented Dec 2, 2021

Allow operators to push filter expressions to the upstream Tee.

This can reduce the amount of data copied within tees, but care needs to be taken to ensure the progress tracking invariants.

The intention is not to land this change but rather have a discussion if this is the right direction for such a change. I don't think the progress tracking wiring is particularly elegant, but seems to do the job. Maybe we could find a better abstraction here. This PR also breaks a public interface, the Stream::connect_to function. I'm not sure if there are any users outside of Timely that call this function.

let mut input = builder.new_input_filter(self, Pipeline, vec![], move |data, buffer| {
match data {
RefOrMut::Ref(data) => {
buffer.extend(data.into_iter().filter(|x| predicate(*x)).cloned())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fairly unrelated, but it'd be nice if operators could pass on references instead of requiring cloning, that could remove a lot of fairly redundant clones

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might do what you suggested: #471

Signed-off-by: Moritz Hoffmann <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants