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



##########
File path: 
flink-dstl/flink-dstl-dfs/src/main/java/org/apache/flink/changelog/fs/StateChangeSet.java
##########
@@ -0,0 +1,235 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.changelog.fs;
+
+import org.apache.flink.runtime.state.changelog.SequenceNumber;
+import org.apache.flink.runtime.state.changelog.StateChange;
+
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.CancellationException;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.atomic.AtomicReference;
+
+import static java.util.Comparator.comparingInt;
+import static java.util.EnumSet.noneOf;
+import static java.util.EnumSet.of;
+import static org.apache.flink.changelog.fs.StateChangeSet.Status.CANCELLED;
+import static org.apache.flink.changelog.fs.StateChangeSet.Status.CONFIRMED;
+import static org.apache.flink.changelog.fs.StateChangeSet.Status.FAILED;
+import static org.apache.flink.changelog.fs.StateChangeSet.Status.MATERIALIZED;
+import static org.apache.flink.changelog.fs.StateChangeSet.Status.PENDING;
+import static org.apache.flink.changelog.fs.StateChangeSet.Status.SCHEDULED;
+import static org.apache.flink.changelog.fs.StateChangeSet.Status.SENT_TO_JM;
+import static org.apache.flink.changelog.fs.StateChangeSet.Status.UPLOADED;
+import static org.apache.flink.changelog.fs.StateChangeSet.Status.UPLOADING;
+import static org.apache.flink.util.Preconditions.checkState;
+
+class StateChangeSet {
+    private final UUID logId;
+    private final AtomicReference<Status> status;
+    private final List<StateChange> changes;
+    private final SequenceNumber sequenceNumber;
+    private final CompletableFuture<StoreResult> storeResultFuture;

Review comment:
       > CompletableFuture<StoreResult> inside StateChangeSet sounds strange 
   
   Why? 
   To me, decoupling store result seems strange, and in the end 
`FsStateChangelogWriter` would have to bind it again.
   I think of `StateChangeSet` as a kind of FSM (with a lifecycle roughly 
corresponding to the one [described in 
FLIP](https://cwiki.apache.org/confluence/display/FLINK/FLIP-158%3A+Generalized+incremental+checkpoints#FLIP158:Generalizedincrementalcheckpoints-Statechangelifecycle)).
 In some states it has this future completed.
   
   > ...and makes threading boundaries hard to define (which methods of 
StateChangeSet are thread safe?).
   
   I marked the class `@ThreadSafe` addressing the first comment.
   




----------------------------------------------------------------
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:
[email protected]


Reply via email to