mxm commented on code in PR #15566:
URL: https://github.com/apache/iceberg/pull/15566#discussion_r2940006961
##########
flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergSink.java:
##########
@@ -626,6 +633,85 @@ public Builder setSnapshotProperty(String property, String
value) {
return this;
}
+ /**
+ * Enables or disables compaction (rewriting data files) as a post-commit
maintenance task.
+ *
+ * @param enabled whether to enable compaction
+ * @see RewriteDataFilesConfig for the default config.
+ * @deprecated See {@code rewriteDatafiles(..)}
+ */
+ @Deprecated
+ public Builder compaction(boolean enabled) {
+ writeOptions.put(FlinkWriteOptions.COMPACTION_ENABLE.key(),
Boolean.toString(enabled));
+ return this;
+ }
+
+ /**
+ * Enables rewriting data files (compaction) as a post-commit maintenance
task.
+ *
+ * @see RewriteDataFilesConfig for the default config.
+ */
+ public Builder rewriteDataFiles() {
+ writeOptions.put(FlinkWriteOptions.COMPACTION_ENABLE.key(), "true");
+ return this;
+ }
+
+ /**
+ * Enables rewriting data files (compaction) as a post-commit maintenance
task.
+ *
+ * @param config task-specific configuration, see {@link
RewriteDataFilesConfig} for available
+ * keys
+ */
+ public Builder rewriteDataFiles(Map<String, String> config) {
+ rewriteDataFiles();
+ writeOptions.putAll(config);
+ return this;
+ }
+
+ /**
+ * Enables expire snapshots as a post-commit maintenance task.
+ *
+ * @see ExpireSnapshotsConfig for the default config.
+ */
+ public Builder expireSnapshots() {
+ writeOptions.put(FlinkWriteOptions.EXPIRE_SNAPSHOTS_ENABLE.key(),
"true");
+ return this;
+ }
+
+ /**
+ * Enables or disables expire snapshots as a post-commit maintenance task.
+ *
+ * @param config task-specific configuration, see {@link
ExpireSnapshotsConfig} for available
+ * keys
+ */
+ public Builder expireSnapshots(Map<String, String> config) {
+ expireSnapshots();
+ writeOptions.putAll(config);
+ return this;
+ }
+
+ /**
+ * Enables delete orphan files as a post-commit maintenance task.
+ *
+ * @see DeleteOrphanFilesConfig for the default config.
+ */
+ public Builder deleteOrphanFiles() {
+ writeOptions.put(FlinkWriteOptions.DELETE_ORPHAN_FILES_ENABLE.key(),
"true");
+ return this;
+ }
+
+ /**
+ * Enables delete orphan files as a post-commit maintenance task.
+ *
+ * @param config task-specific configuration, see {@link
DeleteOrphanFilesConfig} for available
+ * keys.
+ */
+ public Builder deleteOrphanFiles(Map<String, String> config) {
+ deleteOrphanFiles();
+ writeOptions.putAll(config);
+ return this;
+ }
+
@Override
public Builder toBranch(String branch) {
Review Comment:
Should we do this in a follow-up?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]