JingsongLi commented on code in PR #550: URL: https://github.com/apache/flink-table-store/pull/550#discussion_r1116681535
########## flink-table-store-core/src/main/java/org/apache/flink/table/store/table/sink/TableCommit.java: ########## @@ -18,121 +18,47 @@ package org.apache.flink.table.store.table.sink; -import org.apache.flink.table.store.file.manifest.ManifestCommittable; -import org.apache.flink.table.store.file.operation.FileStoreCommit; -import org.apache.flink.table.store.file.operation.FileStoreExpire; +import org.apache.flink.table.store.annotation.Experimental; import org.apache.flink.table.store.file.operation.Lock; -import org.apache.flink.table.store.file.operation.PartitionExpire; +import org.apache.flink.table.store.table.Table; import javax.annotation.Nullable; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; /** - * An abstraction layer above {@link FileStoreCommit} and {@link FileStoreExpire} to provide - * snapshot commit and expiration. + * Commit of {@link Table} to provide {@link CommitMessage} committing. + * + * <p>According to the options, the expiration of snapshots and partitions will be completed in + * commit. + * + * @since 0.4.0 */ -public class TableCommit implements AutoCloseable { - - private final FileStoreCommit commit; - @Nullable private final FileStoreExpire expire; - @Nullable private final PartitionExpire partitionExpire; - - @Nullable private List<Map<String, String>> overwritePartitions = null; - @Nullable private Lock lock; - - public TableCommit( - FileStoreCommit commit, - @Nullable FileStoreExpire expire, - @Nullable PartitionExpire partitionExpire) { - this.commit = commit; - this.expire = expire; - this.partitionExpire = partitionExpire; - } - - public TableCommit withOverwritePartition(@Nullable Map<String, String> overwritePartition) { - if (overwritePartition != null) { - this.overwritePartitions = Collections.singletonList(overwritePartition); - } - return this; - } +@Experimental +public interface TableCommit extends AutoCloseable { - public TableCommit withOverwritePartitions( - @Nullable List<Map<String, String>> overwritePartitions) { - this.overwritePartitions = overwritePartitions; + default TableCommit withOverwritten() { + withOverwritten(Collections.emptyMap()); return this; } - public TableCommit withLock(Lock lock) { - commit.withLock(lock); - - if (expire != null) { - expire.withLock(lock); + default TableCommit withOverwritten(@Nullable Map<String, String> staticPartition) { Review Comment: back to `overwrite` -- 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