flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnowojski <...@git.apache.org>
Subject [GitHub] flink pull request #5381: [FLINK-8523][network] Stop assigning floating buff...
Date Wed, 31 Jan 2018 08:32:09 GMT
Github user pnowojski commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5381#discussion_r164979541
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/UnionInputGate.java
---
    @@ -138,6 +148,24 @@ public void requestPartitions() throws IOException, InterruptedException
{
     		}
     	}
     
    +	@Override
    +	public void blockInputChannel(int channelIndex) {
    +		InputGate inputGate = indexToInputGateMap.get(channelIndex);
    +		if (inputGate == null) {
    +			throw new IllegalStateException("Could not find input gate from the channel index
" + channelIndex);
    +		}
    +
    +		int indexOffset = inputGateToIndexOffsetMap.get(inputGate);
    +		inputGate.blockInputChannel(channelIndex - indexOffset);
    --- End diff --
    
    wrap this offset handling in a private method:
    ```
    inputGate.blockInputChannel(externalToInternalChannelIndex(channelIndex, inputGate));
    ```
    and similar call in `getNextBufferOrEvent()` method to:
    ```
    bufferOrEvent.setChannelIndex(internalToExternalChannelIndex(bufferOrEvent.getChannelIndex(),
inputGate));
    ```


---

Mime
View raw message