gaoyunhaii commented on a change in pull request #14754:
URL: https://github.com/apache/flink/pull/14754#discussion_r588272831
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/OperatorState.java
##########
@@ -118,14 +142,30 @@ public ByteStreamStateHandle getCoordinatorState() {
}
public Map<Integer, OperatorSubtaskState> getSubtaskStates() {
+ return getSubtaskStates(false);
+ }
+
+ public Map<Integer, OperatorSubtaskState> getSubtaskStates(boolean
includeFinishedFlag) {
+ if (!includeFinishedFlag && isFullyFinished()) {
+ return Collections.emptyMap();
+ }
+
return Collections.unmodifiableMap(operatorSubtaskStates);
}
public Collection<OperatorSubtaskState> getStates() {
+ if (isFullyFinished()) {
+ return Collections.emptySet();
+ }
Review comment:
I think it would indeed make it more clear and not worry about
consistency between methods. I updated the PR with this method. Very thanks!
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]