1
0

[HUDI-1005] fix NPE in HoodieWriteClient.clean

This commit is contained in:
shenhong
2020-06-08 11:59:09 +08:00
committed by vinoth chandar
parent 6318e943d1
commit 3387b3841f

View File

@@ -490,7 +490,7 @@ public class HoodieWriteClient<T extends HoodieRecordPayload> extends AbstractHo
LOG.info("Cleaner started");
final Timer.Context context = metrics.getCleanCtx();
HoodieCleanMetadata metadata = HoodieTable.create(config, hadoopConf).clean(jsc, cleanInstantTime);
if (context != null) {
if (context != null && metadata != null) {
long durationMs = metrics.getDurationInMs(context.stop());
metrics.updateCleanMetrics(durationMs, metadata.getTotalFilesDeleted());
LOG.info("Cleaned " + metadata.getTotalFilesDeleted() + " files"