You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "Hong Shen (Jira)" <ji...@apache.org> on 2020/06/10 02:15:00 UTC
[jira] [Resolved] (HUDI-1005) NPE in HoodieWriteClient.clean
[ https://issues.apache.org/jira/browse/HUDI-1005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hong Shen resolved HUDI-1005.
-----------------------------
Resolution: Fixed
> NPE in HoodieWriteClient.clean
> -------------------------------
>
> Key: HUDI-1005
> URL: https://issues.apache.org/jira/browse/HUDI-1005
> Project: Apache Hudi
> Issue Type: Bug
> Components: Writer Core
> Reporter: Hong Shen
> Assignee: Hong Shen
> Priority: Major
> Labels: pull-request-available
>
> HoodieWriteClient.clean will throw NullPointerException, here is the error message.
> {code}
> Caused by: java.lang.NullPointerException
> at org.apache.hudi.client.HoodieWriteClient.clean(HoodieWriteClient.java:495)
> at org.apache.hudi.client.HoodieWriteClient.postCommit(HoodieWriteClient.java:344)
> at org.apache.hudi.client.AbstractHoodieWriteClient.commit(AbstractHoodieWriteClient.java:123)
> at org.apache.hudi.client.AbstractHoodieWriteClient.commit(AbstractHoodieWriteClient.java:94)
> at org.apache.hudi.utilities.deltastreamer.DeltaSync.writeToSink(DeltaSync.java:399)
> at org.apache.hudi.utilities.deltastreamer.DeltaSync.syncOnce(DeltaSync.java:232)
> at org.apache.hudi.utilities.deltastreamer.HoodieDeltaStreamer$DeltaSyncService.lambda$startService$0(HoodieDeltaStreamer.java:422)
> ... 5 more
> {code}
> When metrics is on HoodieCleanMetadata metadata is null, it will throw NPE.
> {code}
> public HoodieCleanMetadata clean(String cleanInstantTime) throws HoodieIOException {
> LOG.info("Cleaner started");
> final Timer.Context context = metrics.getCleanCtx();
> HoodieCleanMetadata metadata = HoodieTable.create(config, hadoopConf).clean(jsc, cleanInstantTime);
> if (context != null) {
> long durationMs = metrics.getDurationInMs(context.stop());
> metrics.updateCleanMetrics(durationMs, metadata.getTotalFilesDeleted());
> LOG.info("Cleaned " + metadata.getTotalFilesDeleted() + " files"
> + " Earliest Retained Instant :" + metadata.getEarliestCommitToRetain()
> + " cleanerElaspsedMs" + durationMs);
> }
> return metadata;
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)