Myasuka commented on a change in pull request #18324:
URL: https://github.com/apache/flink/pull/18324#discussion_r784635071
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/state/changelog/ChangelogStateBackendHandle.java
##########
@@ -113,6 +124,19 @@ public long getStateSize() {
+
nonMaterialized.stream().mapToLong(StateObject::getStateSize).sum();
}
+ @Override
+ public long getIncrementalStateSize() {
+ long incrementalStateSize =
+ incrementalMaterializeSize ==
undefinedIncrementalMaterializeSize
+ ? materialized.stream()
+
.mapToLong(StateObject::getIncrementalStateSize)
+ .sum()
+ : incrementalMaterializeSize;
Review comment:
I prefer the 2nd option and I actually caulcate it in this way.
Actually, the `incrementalMaterializeSize` would not always be computed each
time. `ChangelogKeyedStateBackend` would hold `lastCompletedHandles` and
leverage that to caculate the incremental state size.
--
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]