1
0

Fix bug for schedule compaction manually

This commit is contained in:
v-zhangjc9
2023-10-30 15:27:58 +08:00
parent 2188b8ed8a
commit 181df2240a

View File

@@ -226,17 +226,14 @@ public class HoodieFlinkCompactor {
// checks the compaction plan and do compaction.
if (cfg.schedule) {
Option<String> compactionInstantTimeOption = CompactionUtil.getCompactionInstantTime(metaClient);
if (compactionInstantTimeOption.isPresent()) {
boolean scheduled = writeClient.scheduleCompactionAtInstant(compactionInstantTimeOption.get(), Option.empty());
if (!scheduled) {
// do nothing.
LOG.info("No compaction plan for this job ");
compactClosed("No compaction plan for this job ", null);
return;
}
table.getMetaClient().reloadActiveTimeline();
boolean scheduled = writeClient.scheduleCompaction(Option.empty()).isPresent();
if (!scheduled) {
// do nothing.
LOG.info("No compaction plan for this job ");
compactClosed("No compaction plan for this job ", null);
return;
}
table.getMetaClient().reloadActiveTimeline();
}
// fetch the instant based on the configured execution sequence