Github user uce commented on a diff in the pull request: https://github.com/apache/flink/pull/1883#discussion_r60903497 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CompletedCheckpoint.java --- @@ -74,20 +77,56 @@ public long getDuration() { return duration; } - public List<StateForTask> getStates() { - return states; + public long getStateSize() { + long result = 0L; + + for (StateForTaskGroup stateForTaskGroup: taskGroupStates.values()) { + result += stateForTaskGroup.getStateSize(); + } + + return result; + } + + public Map<JobVertexID, StateForTaskGroup> getTaskGroupStates() { + return taskGroupStates; + } + + public StateForTaskGroup getTaskGroupState(JobVertexID jobVertexID) { + return taskGroupStates.get(jobVertexID); } // -------------------------------------------------------------------------------------------- public void discard(ClassLoader userClassLoader) { - for(StateForTask state: states){ + for (StateForTaskGroup state: taskGroupStates.values()) { state.discard(userClassLoader); } - states.clear(); + + taskGroupStates.clear(); } // -------------------------------------------------------------------------------------------- + + @Override + public boolean equals(Object obj) { + if (obj instanceof CompletedCheckpoint) { + CompletedCheckpoint other = (CompletedCheckpoint) obj; + + return job.equals(other.job) && checkpointID == other.checkpointID && + timestamp == other.timestamp && duration == other.duration && + taskGroupStates.equals(other.taskGroupStates); + } else { + return false; + } + } + + @Override + public int hashCode() { --- End diff -- Out of curiosity, did you add this, because the default implementation was a problem somewhere (also for `PendingCheckpoint`)? Both looks good though.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---