1996fanrui commented on code in PR #29550:
URL: https://github.com/apache/flink/pull/29550#discussion_r4435380296
##########
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java:
##########
@@ -1760,13 +1763,64 @@
List<RecordWriter<SerializationDelegate<StreamRecord<OUT>>>> createRecordWriters
private static void
replaceForwardPartitionerIfConsumerParallelismDoesNotMatch(
Environment environment, NonChainedOutput streamOutput, int
outputIndex) {
- if (streamOutput.getPartitioner() instanceof ForwardPartitioner
- &&
environment.getWriter(outputIndex).getNumberOfSubpartitions()
- !=
environment.getTaskInfo().getNumberOfParallelSubtasks()) {
- LOG.debug(
- "Replacing forward partitioner with rebalance for {}",
- environment.getTaskInfo().getTaskNameWithSubtasks());
- streamOutput.setPartitioner(new RebalancePartitioner<>());
+ final int producerParallelism =
environment.getTaskInfo().getNumberOfParallelSubtasks();
+ // The number of subpartitions isn't the consumer parallelism on a
POINTWISE edge, so the
+ // actual consumer parallelism is passed through the deployment
descriptor.
+ final int consumerParallelism =
environment.getWriterConsumerParallelism(outputIndex);
Review Comment:
Thanks for the review, yes, it's intended.
Get more from another backport PR
https://github.com/apache/flink/pull/29548#discussion_r4372171101
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]