JingsongLi commented on code in PR #605:
URL: https://github.com/apache/flink-table-store/pull/605#discussion_r1136656614


##########
flink-table-store-core/src/main/java/org/apache/flink/table/store/file/operation/AbstractFileStoreWrite.java:
##########
@@ -232,50 +210,131 @@ public void close() throws Exception {
         }
     }
 
+    @Override
+    public List<State> extractStateAndClose() throws Exception {
+        List<State> result = new ArrayList<>();
+        for (Map.Entry<BinaryRow, Map<Integer, WriterContainer<T>>> 
partitionEntry :
+                writers.entrySet()) {
+            BinaryRow partition = partitionEntry.getKey();
+            for (Map.Entry<Integer, WriterContainer<T>> bucketEntry :
+                    partitionEntry.getValue().entrySet()) {
+                int bucket = bucketEntry.getKey();
+                WriterContainer<T> writerContainer = bucketEntry.getValue();
+                CommitIncrement increment = 
writerContainer.writer.extractStateAndClose();

Review Comment:
   We don't need to introduce `extractStateAndClose` to writer, we can just:
   ```
   1. CommitIncrement increment = writer. prepareCommit...;
   2. List<DataFileMeta> dataFiles = writer.dataFiles();
   3. writer.close();
   ```
   We should get data files before close.



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

Reply via email to