SteNicholas commented on code in PR #262:
URL: https://github.com/apache/flink-table-store/pull/262#discussion_r970709006


##########
flink-table-store-core/src/main/java/org/apache/flink/table/store/file/compact/CompactManager.java:
##########
@@ -40,14 +42,28 @@ public CompactManager(ExecutorService executor) {
         this.executor = executor;
     }
 
-    /** Submit a new compaction task. */
-    public abstract void submitCompaction();
+    /** Should wait compaction finish. */
+    public abstract boolean shouldWaitCompaction();
+
+    /** Add a new file. */
+    public abstract void addNewFile(DataFileMeta file);
+
+    /** Trigger a new compaction task. */
+    public abstract void triggerCompaction();
 
-    public boolean isCompactionFinished() {
-        return taskFuture == null;
+    /** Get compaction result. Wait finish if {@code blocking} is true. */
+    public abstract Optional<CompactResult> getCompactionResult(boolean 
blocking)
+            throws ExecutionException, InterruptedException;
+
+    public void cancelCompaction() {
+        // TODO this method may leave behind orphan files if compaction is 
actually finished
+        //  but some CPU work still needs to be done
+        if (taskFuture != null && !taskFuture.isCancelled()) {
+            taskFuture.cancel(true);

Review Comment:
   Shoud the `taskFuture` set to null after cancel?



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