zhijiangW commented on a change in pull request #11507: [FLINK-16587] Add basic
CheckpointBarrierHandler for unaligned checkpoint
URL: https://github.com/apache/flink/pull/11507#discussion_r400814235
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/UnionInputGate.java
##########
@@ -77,37 +77,34 @@
*/
private final LinkedHashSet<InputGate> inputGatesWithData = new
LinkedHashSet<>();
- /** The total number of input channels across all unioned input gates.
*/
- private final int totalNumberOfInputChannels;
+ /** Input channels across all unioned input gates. */
+ private final InputChannel[] inputChannels;
/**
* A mapping from input gate to (logical) channel index offset. Valid
channel indexes go from 0
* (inclusive) to the total number of input channels (exclusive).
*/
- private final Map<InputGate, Integer> inputGateToIndexOffsetMap;
+ private final int[] inputGateChannelIndexOffsets;
public UnionInputGate(InputGate... inputGates) {
this.inputGates = checkNotNull(inputGates);
checkArgument(inputGates.length > 1, "Union input gate should
union at least two input gates.");
- this.inputGateToIndexOffsetMap =
Maps.newHashMapWithExpectedSize(inputGates.length);
this.inputGatesWithRemainingData =
Sets.newHashSetWithExpectedSize(inputGates.length);
+ final int maxGateIndex =
Arrays.stream(inputGates).mapToInt(InputGate::getGateIndex).max().orElse(0);
Review comment:
I am wondering whether the `inputGates` argument might refer to
`UnionInputGate` in practice, otherwise it should be definitely defined
`SingleInputGate`. For the case of union gate in arguments, `getGateIndex`
would throw exception as implemented default in `InputGate`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services