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



##########
File path: 
flink-state-backends/flink-statebackend-changelog/src/main/java/org/apache/flink/state/changelog/ChangelogKeyedStateBackend.java
##########
@@ -116,16 +140,54 @@
     /** For caching the last accessed partitioned state. */
     private String lastName;
 
+    private final FunctionDelegationHelper functionDelegationHelper =
+            new FunctionDelegationHelper();
+
+    /** Updated initially on restore and later upon materialization (after 
FLINK-21356). */
+    private final List<KeyedStateHandle> materialized = new ArrayList<>();
+
+    /** Updated initially on restore and later cleared upon materialization 
(after FLINK-21356). */
+    private final List<ChangelogStateHandle> restoredNonMaterialized = new 
ArrayList<>();
+
+    /**
+     * {@link SequenceNumber} denoting last upload range <b>start</b>, 
inclusive. Updated to {@link
+     * #materializedTo} when {@link #snapshot(long, long, 
CheckpointStreamFactory,
+     * CheckpointOptions) starting snapshot}. Used to notify {@link 
#stateChangelogWriter} about
+     * changelog ranges that were confirmed or aborted by JM.
+     */
+    @Nullable private SequenceNumber lastUploadedFrom;
+    /**
+     * {@link SequenceNumber} denoting last upload range <b>end</b>, 
exclusive. Updated to {@link
+     * 
org.apache.flink.runtime.state.changelog.StateChangelogWriter#lastAppendedSequenceNumber}
+     * when {@link #snapshot(long, long, CheckpointStreamFactory, 
CheckpointOptions) starting
+     * snapshot}. Used to notify {@link #stateChangelogWriter} about changelog 
ranges that were
+     * confirmed or aborted by JM.
+     */
+    @Nullable private SequenceNumber lastUploadedTo;
+    /**
+     * The {@link SequenceNumber} up to which the state is materialized, 
exclusive. The log should
+     * be truncated accordingly.
+     *
+     * <p>WARN: currently not updated - to be changed in FLINK-21356.

Review comment:
       Without materialization, the backend is still incomplete and my 
intention was to make it clear what else and how will change. It's not ideal, 
but leaving `lastUploadedFrom` never updated (or always updated to 0) would 
have the same or worse effect IMO.
   I can remove it though if you'd like.




-- 
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:
us...@infra.apache.org


Reply via email to