GitHub user NicoK opened a pull request:
https://github.com/apache/flink/pull/5583
[FLINK-8737][network] disallow creating a union of UnionGate instances
## What is the purpose of the change
Recently, the `InputGate#pollNextBufferOrEvent()` was added but not
implemented in `UnionInputGate`. It is, however, used in
`UnionInputGate#getNextBufferOrEvent()` and thus any `UnionInputGate`
containing a `UnionInputGate` would have failed already. There should be no use
case for wiring up inputs this way. Therefore, fail early when trying to
construct this.
## Brief change log
- throw an `UnsupportedOperationException` when trying to use a
`UnionInputGate` for input to a `UnionInputGate`
## 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:
- Dependencies (does it add or upgrade a dependency): **no**
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: **no**
- The serializers: **no**
- The runtime per-record code paths (performance sensitive): **no**
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Yarn/Mesos, ZooKeeper: **no**
- The S3 file system connector: **no**
## Documentation
- Does this pull request introduce a new feature? **no**
- If yes, how is the feature documented? **JavaDocs**
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/NicoK/flink flink-8737
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/5583.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #5583
----
commit 198bf145e2a4b81327ae0c1e58c5bf4f8a5da650
Author: Nico Kruber <nico@...>
Date: 2018-02-26T16:50:10Z
[hotfix][network] minor improvements in UnionInputGate
commit 6eff3e396b5a98a1029e3f42b5e78abfb10da7a6
Author: Nico Kruber <nico@...>
Date: 2018-02-26T16:52:37Z
[FLINK-8737][network] disallow creating a union of UnionInputGate instances
Recently, the pollNextBufferOrEvent() was added but not implemented but
this is
used in getNextBufferOrEvent() and thus any UnionInputGate containing a
UnionInputGate
would have failed already. There should be no use case for wiring up inputs
this way. Therefore, fail early when trying to construct this.
----
---