Skip to content

Commit

Permalink
[HUDI-4880] Fix corrupted parquet file issue left over by cancelled c…
Browse files Browse the repository at this point in the history
…ompaction task (#6733)
  • Loading branch information
TengHuo authored Nov 3, 2022
1 parent 14ec963 commit 0d7d3aa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ public void processElement(StreamRecord<ClusteringPlanEvent> element) throws Exc
}

@Override
public void close() {
public void close() throws Exception {
if (null != this.executor) {
this.executor.close();
}
if (this.writeClient != null) {
this.writeClient.cleanHandlesGracefully();
this.writeClient.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,16 @@ private HoodieWriteConfig reloadWriteConfig() throws Exception {
public void setExecutor(NonThrownExecutor executor) {
this.executor = executor;
}

@Override
public void close() throws Exception {
if (null != this.executor) {
this.executor.close();
}
if (null != this.writeClient) {
this.writeClient.cleanHandlesGracefully();
this.writeClient.close();
this.writeClient = null;
}
}
}

0 comments on commit 0d7d3aa

Please sign in to comment.