Hi @StephanEwen , your suggestion lead me to deep thinks, and the extreme 
performance is exactly what we want. I am going to ask you for more 
suggestions. I prefer to initialize the partitioner instance with a random 
partition, however in the design ahead, the partitioner doesn't know the target 
range.
The alternative is like this:
```
private final int[] returnArray = new int[] {new 
Random().nextInt(Integer.MAX_VALUE - 1)};

@Override
public int[] selectChannels(SerializationDelegate<StreamRecord<T>> record,
                int numberOfOutputChannels) {
        this.returnArray[0] = (this.returnArray[0] + 1) % 
numberOfOutputChannels;
        return this.returnArray;
}
```
 Please tell me how you think, thanks.

[ Full content available at: https://github.com/apache/flink/pull/6544 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to