stream2000 commented on code in PR #8456:
URL: https://github.com/apache/hudi/pull/8456#discussion_r1166489345
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/CleanFunction.java:
##########
@@ -60,11 +60,13 @@ public CleanFunction(Configuration conf) {
@Override
public void open(Configuration parameters) throws Exception {
super.open(parameters);
- this.writeClient = FlinkWriteClients.createWriteClient(conf,
getRuntimeContext());
- this.executor =
NonThrownExecutor.builder(LOG).waitForTasksFinish(true).build();
- String instantTime = HoodieActiveTimeline.createNewInstantTime();
- LOG.info(String.format("exec clean with instant time %s...", instantTime));
- executor.execute(() -> writeClient.clean(instantTime), "wait for cleaning
finish");
+ if (conf.getBoolean(FlinkOptions.CLEAN_ASYNC_ENABLED)) {
+ this.writeClient = FlinkWriteClients.createWriteClient(conf,
getRuntimeContext());
+ this.executor =
NonThrownExecutor.builder(LOG).waitForTasksFinish(true).build();
+ String instantTime = HoodieActiveTimeline.createNewInstantTime();
+ LOG.info(String.format("exec clean with instant time %s...",
instantTime));
+ executor.execute(() -> writeClient.clean(instantTime), "wait for
cleaning finish");
+ }
Review Comment:
nit: we can add a line of log here to indicate to the user that async clean
is disabled although the clean function is opened.
LOG.info("Async clean is disabled");
--
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]