-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-13765][task] Introduce TwoInputSelectionHandler for selecting input in StreamTwoInputSelectableProcessor #9477
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit e21b3e5 (Tue Aug 27 09:18:34 UTC 2019) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how big value has this PR. Yes, you have encapsulated 3 fields, that's a plus, but very little logic was extracted. For example you replaced inputSelection.isALLMaskOf2()
with inputSelectionHandler.isALLInputsSelected()
. Or inputSelection.isInputSelected(1)
with inputSelectionHandler.isFirstInputSelected()
. However if you prefer it this way +1 from my side.
Feel free to merge this once you checked my comments
...treaming-java/src/main/java/org/apache/flink/streaming/runtime/io/InputSelectionHandler.java
Outdated
Show resolved
Hide resolved
...treaming-java/src/main/java/org/apache/flink/streaming/runtime/io/InputSelectionHandler.java
Outdated
Show resolved
Hide resolved
...treaming-java/src/main/java/org/apache/flink/streaming/runtime/io/InputSelectionHandler.java
Outdated
Show resolved
Hide resolved
Thanks for this review @pnowojski ! Actually this PR would not be a blocker for the following work as I misleading before. If just from the design aspect, the benefits might not be very obvious as you mentioned. My previous thought:
I could understand your concern and it would be better if we could further reduce some complex interactive logics provided by |
As I wrote before, please feel free to merge this. Keeping it open for "rethinking" in the future it's probably a bad idea. |
…ing input in StreamTwoInputSelectableProcessor In StreamTwoInputSelectableProcessor there are three fields {InputSelectable, InputSelection, availableInputsMask} to be used together for the function of selecting next available input index. From design aspect, these fields can be abstracted into a separate component called TwoInputSelectionHandler, which is passed into the constructor of StreamTwoInputSelectableProcessor as a final field. So the internal implementation details of TwoInputSelectionHandler is hidden from processor view which only needs to interact with exposed methods from selection handler. Another tiny benefit is that we make the StreamTwoInputSelectableProcessor a bit because two methods are removed from it.
Thanks for the confirmation and I would merge it after travis green. @pnowojski |
@flinkbot run travis |
What is the purpose of the change
In
StreamTwoInputSelectableProcessor
there are three fields {InputSelectable
,InputSelection
,availableInputsMask
} to be used together for the function of selecting next available input index.From design aspect, these fields can be abstracted into a separate component called
TwoInputSelectionHandler
, which is passed into the constructor ofStreamTwoInputSelectableProcessor
as a final field. So the internal implementation details ofTwoInputSelectionHandler
is hidden from processor view which only needs to interact with exposed methods from selection handler.Another tiny benefit is that we make the
StreamTwoInputSelectableProcessor
a bit because two methods are removed from it.Brief change log
TwoInputSelectionHandler
for handling the logic of next available input indexStreamTwoInputSelectableProcessor
based onInputSelectionHandler
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)Documentation