RanJinh commented on code in PR #23000:
URL: https://github.com/apache/flink/pull/23000#discussion_r1306883153
##########
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/translators/OneInputTransformationTranslator.java:
##########
@@ -50,24 +50,47 @@ public Collection<Integer> translateForBatchInternal(
keySelector,
transformation.getStateKeyType(),
context);
- boolean isKeyed = keySelector != null;
- if (isKeyed) {
- BatchExecutionUtils.applyBatchExecutionSettings(
- transformation.getId(), context,
StreamConfig.InputRequirement.SORTED);
- }
+
+ oneInputTransformationOutputEOFSetting(transformation, context);
return ids;
}
@Override
public Collection<Integer> translateForStreamingInternal(
final OneInputTransformation<IN, OUT> transformation, final
Context context) {
- return translateInternal(
- transformation,
- transformation.getOperatorFactory(),
- transformation.getInputType(),
- transformation.getStateKeySelector(),
- transformation.getStateKeyType(),
- context);
+ Collection<Integer> ids =
+ translateInternal(
+ transformation,
+ transformation.getOperatorFactory(),
+ transformation.getInputType(),
+ transformation.getStateKeySelector(),
+ transformation.getStateKeyType(),
+ context);
+
+ if (transformation.isOutputOnEOF()) {
+ // Try to apply batch execution settings for streaming mode
transformation.
+ oneInputTransformationOutputEOFSetting(transformation, context);
+ }
+
+ return ids;
+ }
+
+ private void oneInputTransformationOutputEOFSetting(
Review Comment:
I agree, and also modified in `TwoInputTransformationTranslator` and
`MultiInputTransformationTranslator`. Thanks for your suggestion.
##########
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/translators/OneInputTransformationTranslator.java:
##########
@@ -50,24 +50,47 @@ public Collection<Integer> translateForBatchInternal(
keySelector,
transformation.getStateKeyType(),
context);
- boolean isKeyed = keySelector != null;
- if (isKeyed) {
- BatchExecutionUtils.applyBatchExecutionSettings(
- transformation.getId(), context,
StreamConfig.InputRequirement.SORTED);
- }
+
+ oneInputTransformationOutputEOFSetting(transformation, context);
return ids;
}
@Override
public Collection<Integer> translateForStreamingInternal(
final OneInputTransformation<IN, OUT> transformation, final
Context context) {
- return translateInternal(
- transformation,
- transformation.getOperatorFactory(),
- transformation.getInputType(),
- transformation.getStateKeySelector(),
- transformation.getStateKeyType(),
- context);
+ Collection<Integer> ids =
+ translateInternal(
+ transformation,
+ transformation.getOperatorFactory(),
+ transformation.getInputType(),
+ transformation.getStateKeySelector(),
+ transformation.getStateKeyType(),
+ context);
+
+ if (transformation.isOutputOnEOF()) {
+ // Try to apply batch execution settings for streaming mode
transformation.
+ oneInputTransformationOutputEOFSetting(transformation, context);
+ }
+
+ return ids;
+ }
+
+ private void oneInputTransformationOutputEOFSetting(
Review Comment:
I agree, and also modified in `TwoInputTransformationTranslator` and
`MultiInputTransformationTranslator`. Thanks for your suggestion.
--
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]