xiangforever2014 commented on code in PR #16714: URL: https://github.com/apache/flink/pull/16714#discussion_r2221854064
########## flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/RoundRobinOperatorStateRepartitioner.java: ########## @@ -459,4 +478,26 @@ private static final class GroupByStateNameResults { return byMode.get(mode); } } + + private static final class StateEntry { + final List<Tuple2<StreamStateHandle, OperatorStateHandle.StateMetaInfo>> entries; + final BitSet reportedSubtaskIndices; + + public StateEntry(int estimatedEntrySize, int parallelism) { + this.entries = new ArrayList<>(estimatedEntrySize); + this.reportedSubtaskIndices = new BitSet(parallelism); + } + + void addEntry( + int subtaskIndex, + Tuple2<StreamStateHandle, OperatorStateHandle.StateMetaInfo> entry) { + this.entries.add(entry); + reportedSubtaskIndices.set(subtaskIndex); + } + + boolean isPartiallyReported() { + return reportedSubtaskIndices.cardinality() > 0 + && reportedSubtaskIndices.cardinality() < reportedSubtaskIndices.size(); Review Comment: why here we should compare reportedSubtaskIndices.cardinality() with reportedSubtaskIndices.size()? does it should be the `parallelism` in the constructor? -- 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-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org