[
https://issues.apache.org/jira/browse/FLINK-5980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15901101#comment-15901101
]
ASF GitHub Bot commented on FLINK-5980:
---------------------------------------
Github user zentol commented on a diff in the pull request:
https://github.com/apache/flink/pull/3487#discussion_r104896041
--- Diff:
flink-core/src/main/java/org/apache/flink/api/common/functions/util/AbstractRuntimeUDFContext.java
---
@@ -97,10 +97,16 @@ public int getNumberOfParallelSubtasks() {
}
@Override
+ public int getMaxNumberOfParallelSubtasks() {
+ // Number of KeyGroups is same with max-parallelism currently.
+ return taskInfo.getNumberOfKeyGroups();
--- End diff --
what does this return for the batch API, which doesn't have key-groups?
(ideally it should ```getNumberOFParallelSubtasks()```.
> Expose max-parallelism value in RuntimeContext
> ----------------------------------------------
>
> Key: FLINK-5980
> URL: https://issues.apache.org/jira/browse/FLINK-5980
> Project: Flink
> Issue Type: Improvement
> Components: DataStream API
> Reporter: Biao Liu
> Assignee: Biao Liu
> Priority: Minor
>
> I am implementing a custom source function. I want to keep all progresses in
> a ListState to support dynamically scaling just like what FlinkKafkaConsumer
> did. And I think the max-parallelism value is ideal length for the ListState
> in my scenario. But I realize that currently the max-parallelism value is not
> visible to UDF.
> I propose exposing the max-parallelism value in RuntimeContext. It will be
> useful in dynamically scaling scenario.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)