1
0

[HUDI-3945] After the async compaction operation is complete, the task should exit. (#5391)

Co-authored-by: y00617041 <yangxuan42@huawei.com>
This commit is contained in:
watermelon12138
2022-04-27 21:16:09 +08:00
committed by GitHub
parent 924e2e96a6
commit cacbd98687

View File

@@ -171,13 +171,15 @@ public class HoodieCompactor {
System.exit(1);
}
final JavaSparkContext jsc = UtilHelpers.buildSparkContext("compactor-" + cfg.tableName, cfg.sparkMaster, cfg.sparkMemory);
int ret = 0;
try {
HoodieCompactor compactor = new HoodieCompactor(jsc, cfg);
compactor.compact(cfg.retry);
ret = compactor.compact(cfg.retry);
} catch (Throwable throwable) {
LOG.error("Fail to run compaction for " + cfg.tableName, throwable);
} finally {
jsc.stop();
System.exit(ret);
}
}