Skip to content

Conversation

@tgroh
Copy link
Member

@tgroh tgroh commented Apr 28, 2016

Be sure to do all of the following to help us incorporate your contribution
quickly and easily:

  • Make sure the PR title is formatted like:
    [BEAM-<Jira issue #>] Description of pull request
  • Make sure tests pass via mvn clean verify. (Even better, enable
    Travis-CI on your fork and ensure the whole test matrix passes).
  • Replace <Jira issue #> in the title with the actual Jira issue
    number, if there is one.
  • If this contribution is large, please file an Apache
    Individual Contributor License Agreement.

This DoFnRunner wraps an existing DoFnRunner and provides a method,
processElementInReadyWindows, which returns a list of WindowedValues
that could not be processed due to requiring a SideInput that is not
ready.

@tgroh
Copy link
Member Author

tgroh commented Apr 28, 2016

R: @peihe
R: @kennknowles for committer

For an example of use, see here.

These PRs split for easier reviewability, plus the linked change requires #249 and a follow-up

* Call the underlying {@link DoFnRunner#processElement(WindowedValue)} for the provided element
* for each window the element is in that is ready.
*/
public Iterable<WindowedValue<InputT>> processElementInReadyWindows(WindowedValue<InputT> elem) {
Copy link
Member

Choose a reason for hiding this comment

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

What is the return value?

Copy link
Member Author

Choose a reason for hiding this comment

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

Noted.

@kennknowles
Copy link
Member

Please rebase and place new files into runners/direct-java if appropriate, or util for now if they seem like they are runner-independent and will end up in runners/core.

@tgroh tgroh force-pushed the ippr_pushback_do_fn_runner_impl branch from 261c68c to 7134090 Compare May 2, 2016 17:05
tgroh added 2 commits May 2, 2016 10:25
This SideInputReader allows callers to check for a side input being
available before attempting to read the contents
This DoFnRunner wraps a DoFnRunner and provides an additional method to
process an element in all the windows where all side inputs are ready,
returning any elements that it could not process.
@tgroh tgroh force-pushed the ippr_pushback_do_fn_runner_impl branch from 7134090 to 8bddf32 Compare May 2, 2016 17:25
@tgroh
Copy link
Member Author

tgroh commented May 2, 2016

Rebased on top of module change; moved ReadyCheckingSideInputReader and PushbackSideInputDoFnRunner to util.

return Collections.emptyList();
}
ImmutableList.Builder<WindowedValue<InputT>> pushedBack = ImmutableList.builder();
for (WindowedValue<InputT> windowElem : elem.explodeWindows()) {
Copy link
Member

@kennknowles kennknowles May 2, 2016

Choose a reason for hiding this comment

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

Is it necessary to explode windows in this class, or can it be separated out?

I suppose the code here won't really change much, since you have to access the contents of the WindowedValue anyhow. But the helper method could be simplified.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is required to return only the (value, window)s that could not be processed, instead of The (value, window*)s that contain a window that could not be processed. This lets us do as much work as possible

Copy link
Member

Choose a reason for hiding this comment

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

Actually I meant somewhat the opposite. I meant to suggest that you explode values prior to reaching this point. But since the type would still be WindowedValue it wouldn't really buy you much.

Copy link
Member Author

Choose a reason for hiding this comment

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

Generally it's left up to the DoFnRunner to decide if it should explode windows or not (to not make redundant calls if possible), or at least that's how the existing FnRunners work

@tgroh tgroh force-pushed the ippr_pushback_do_fn_runner_impl branch from a0a9136 to 1cb0b10 Compare May 2, 2016 20:12
@tgroh tgroh force-pushed the ippr_pushback_do_fn_runner_impl branch from 1cb0b10 to 2f57a21 Compare May 2, 2016 20:18
@kennknowles
Copy link
Member

I wanted to be sure to ping @aljoscha on this PR. Not sure if I did before. I think it may be relevant to developments.

@kennknowles
Copy link
Member

LGTM. Will merge.

@asfgit asfgit closed this in 9794564 May 4, 2016
@aljoscha
Copy link
Contributor

aljoscha commented May 5, 2016

Thanks @kennknowles, I'll keep it in mind.

iemejia added a commit to iemejia/beam that referenced this pull request Jan 12, 2018
pl04351820 pushed a commit to pl04351820/beam that referenced this pull request Dec 20, 2023
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.

4 participants