Skip to content

Commit

Permalink
[HUDI-6395] Scheduling jobs should not fail when there is no schedule…
Browse files Browse the repository at this point in the history
…d compaction or clustering plan (apache#9009)
  • Loading branch information
askwang committed Jun 20, 2023
1 parent 5c8f552 commit 587a53f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.apache.hudi.common.util.Option;
import org.apache.hudi.common.util.StringUtils;
import org.apache.hudi.config.HoodieCleanConfig;
import org.apache.hudi.exception.HoodieClusteringException;
import org.apache.hudi.table.HoodieSparkTable;

import com.beust.jcommander.JCommander;
Expand Down Expand Up @@ -216,7 +215,8 @@ private int doCluster(JavaSparkContext jsc) throws Exception {
LOG.info("Found the earliest scheduled clustering instant which will be executed: "
+ cfg.clusteringInstantTime);
} else {
throw new HoodieClusteringException("There is no scheduled clustering in the table.");
LOG.info("There is no scheduled clustering in the table.");
return 0;
}
}
Option<HoodieCommitMetadata> commitMetadata = client.cluster(cfg.clusteringInstantTime).getCommitMetadata();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.apache.hudi.common.util.Option;
import org.apache.hudi.common.util.StringUtils;
import org.apache.hudi.config.HoodieCleanConfig;
import org.apache.hudi.exception.HoodieCompactionException;
import org.apache.hudi.exception.HoodieException;
import org.apache.hudi.table.action.HoodieWriteMetadata;
import org.apache.hudi.table.action.compact.strategy.LogFileSizeBasedCompactionStrategy;
Expand Down Expand Up @@ -268,7 +267,8 @@ private int doCompact(JavaSparkContext jsc) throws Exception {
LOG.info("Found the earliest scheduled compaction instant which will be executed: "
+ cfg.compactionInstantTime);
} else {
throw new HoodieCompactionException("There is no scheduled compaction in the table.");
LOG.info("There is no scheduled compaction in the table.");
return 0;
}
}
HoodieWriteMetadata<JavaRDD<WriteStatus>> compactionMetadata = client.compact(cfg.compactionInstantTime);
Expand Down

0 comments on commit 587a53f

Please sign in to comment.