AHeise commented on a change in pull request #12575:
URL: https://github.com/apache/flink/pull/12575#discussion_r440641075



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/UnionInputGate.java
##########
@@ -105,11 +105,11 @@ public UnionInputGate(IndexedInputGate... inputGates) {
                inputChannelToInputGateIndex = new 
int[totalNumberOfInputChannels];
 
                int currentNumberOfInputChannels = 0;
-               for (final IndexedInputGate inputGate : inputGates) {
-                       inputGateChannelIndexOffsets[inputGate.getGateIndex()] 
= currentNumberOfInputChannels;
+               for (int index = 0; index < inputGates.length; index++) {

Review comment:
       Yes you are right. I reverted the change and went into a different 
direction. The basic issue is that the field inputGates contains all gates in a 
dense array. We would need a sparse index/map if we access it completely 
through gateIndex.
   There were 3 options:
    - Always use dense, which results in what you have mentioned.
    - Use both, resulting in duplicate fields.
    - Always use sparse index, where we need to skip null values. Or use map 
and live with slightly longer accesses (current solution).




----------------------------------------------------------------
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]


Reply via email to