You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2023/01/11 04:09:56 UTC

[GitHub] [flink] zhuzhurk commented on a diff in pull request #21621: [FLINK-30601][runtime] Omit "setKeyContextElement" call for non-keyed stream/operators to improve performance

zhuzhurk commented on code in PR #21621:
URL: https://github.com/apache/flink/pull/21621#discussion_r1066555577


##########
flink-libraries/flink-state-processing-api/src/main/java/org/apache/flink/state/api/output/BootstrapStreamTask.java:
##########
@@ -82,16 +86,14 @@ protected void init() throws Exception {
         mainOperator = mainOperatorAndTimeService.f0;
         mainOperator.initializeState(createStreamTaskStateInitializer());
         mainOperator.open();
+        recordProcessor = RecordProcessorUtils.getRecordProcessor(mainOperator);
     }
 
     @Override
     protected void processInput(MailboxDefaultAction.Controller controller) throws Exception {
         StreamElement element = input.take();
         if (element.isRecord()) {
-            StreamRecord<IN> streamRecord = element.asRecord();
-
-            mainOperator.setKeyContextElement1(streamRecord);
-            mainOperator.processElement(streamRecord);
+            recordProcessor.accept(element.asRecord());

Review Comment:
   I think it's not needed because all invocations to operators are intercepted. Operators' responsibility is to provide correct information of `hasKeyContext`. 



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org