rkhachatryan commented on a change in pull request #17462:
URL: https://github.com/apache/flink/pull/17462#discussion_r749129094



##########
File path: 
flink-state-backends/flink-statebackend-changelog/src/main/java/org/apache/flink/state/changelog/ChangelogKeyedStateBackend.java
##########
@@ -600,8 +600,14 @@ private ChangelogSnapshotState completeRestore(
                                     System.currentTimeMillis(),
                                     streamFactory,
                                     CHECKPOINT_OPTIONS),
-                            // TODO: add metadata to log FLINK-23170.
-                            upTo));
+                            upTo);
+
+            // log metadata after materialization is triggered
+            keyValueStatesByName
+                    .values()
+                    .forEach(t -> ((AbstractChangelogState) 
t).resetMetaDataWritten());

Review comment:
       I think the page you are referring to compares indexed loops with 
java-1.5 foreach loops, but not with functional `forEach` from  java 8 (and 
it's also not backed by any benchmarks).
   In general, 1.8 loops are slower because of lambdas and function calls.
   
   Yes, it may be neglibible, or may not. I don't think we can assume that it 
will,;and benchmarking seems non-trivial. So I'd just stay with faster for-loop.




-- 
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


Reply via email to