[
https://issues.apache.org/jira/browse/FLINK-36209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
xiaochen.zhou updated FLINK-36209:
----------------------------------
Description: In certain methods, such as the
{{DynamicKafkaSourceEnumerator#onHandleSubscribedStreamsFetch()}} method,
{{partitions}} are divided into {{assignedPartitions}} and
{{unassignedInitialPartitions}} before being passed as parameters to the
{{KafkaSourceEnumState}} constructor. However, within the constructor, these
{{assignedPartitions}} and {{unassignedInitialPartitions}} are recombined into
{{{}partitions{}}}, leading to unnecessary operations and reduced performance.
By optimizing the code to pass {{partitions}} directly as a parameter when
initializing {{{}KafkaSourceEnumState{}}}, we can eliminate redundant
operations and enhance performance. (was: In some methods, such as the
{{DynamicKafkaSourceEnumerator#onHandleSubscribedStreamsFetch()}} method,
{{partitions}} are split into {{assignedPartitions}} and
{{unassignedInitialPartitions}} before initializing {{KafkaSourceEnumState}}
and used as parameters to its constructor. However, in the constructor of
{{KafkaSourceEnumState}}, these {{assignedPartitions}} and
{{unassignedInitialPartitions}} are merged back into {{partitions}}, resulting
in a lot of redundant operations and decreased performance. By optimizing the
code to directly use {{partitions}} as a parameter when initializing
{{KafkaSourceEnumState}}, we can avoid redundant operations and improve
performance.)
> Reduce some redundant operations in the initialization of KafkaSourceEnumState
> ------------------------------------------------------------------------------
>
> Key: FLINK-36209
> URL: https://issues.apache.org/jira/browse/FLINK-36209
> Project: Flink
> Issue Type: Improvement
> Components: Connectors / Kafka
> Reporter: xiaochen.zhou
> Priority: Minor
> Labels: pull-request-available
>
> In certain methods, such as the
> {{DynamicKafkaSourceEnumerator#onHandleSubscribedStreamsFetch()}} method,
> {{partitions}} are divided into {{assignedPartitions}} and
> {{unassignedInitialPartitions}} before being passed as parameters to the
> {{KafkaSourceEnumState}} constructor. However, within the constructor, these
> {{assignedPartitions}} and {{unassignedInitialPartitions}} are recombined
> into {{{}partitions{}}}, leading to unnecessary operations and reduced
> performance. By optimizing the code to pass {{partitions}} directly as a
> parameter when initializing {{{}KafkaSourceEnumState{}}}, we can eliminate
> redundant operations and enhance performance.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)