1996fanrui opened a new pull request, #23550: URL: https://github.com/apache/flink/pull/23550
## What is the purpose of the change See [FLINK-33315](https://issues.apache.org/jira/browse/FLINK-33315) for details. When creating a successor operator to a SourceOperator, the call stack is: - OperatorChain#createOperatorChain -> - wrapOperatorIntoOutput -> - getOperatorRecordsOutCounter -> - operatorConfig.getStreamOperatorFactory(userCodeClassloader) It will generate the SourceOperatorFactory temporarily and just check whether it's SinkWriterOperatorFactory This PR focus on avoid unnecessary heavy getStreamOperatorFactory, it can optimize the memory and cpu cost of Replica_2 in [FLINK-33315](https://issues.apache.org/jira/browse/FLINK-33315). This heavy operation is introduced in [FLINK-30536](https://issues.apache.org/jira/browse/FLINK-30536) (1.17), and it's not necessary. ([code link](https://github.com/apache/flink/blob/c2e14ff411e806f9ccf176c85eb8249b8ff12e56/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/OperatorChain.java#L646)) . ## Brief change log Solution: We can store the serializedUdfClassName at StreamConfig, and using the getStreamOperatorFactoryClassName instead of the heavy getStreamOperatorFactory in OperatorChain#getOperatorRecordsOutCounter. ## Verifying this change This change is a trivial rework / code cleanup without any test coverage. ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): no - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no - The serializers: no - The runtime per-record code paths (performance sensitive): no - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no - The S3 file system connector: no ## Documentation - Does this pull request introduce a new feature?no -- 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]
