the-other-tim-brown commented on code in PR #9385:
URL: https://github.com/apache/hudi/pull/9385#discussion_r1286435913
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieTableServiceClient.java:
##########
@@ -699,7 +699,14 @@ protected void runAnyPendingClustering(HoodieTable table) {
protected void writeTableMetadata(HoodieTable table, String instantTime,
String actionType, HoodieCommitMetadata metadata, HoodieData<WriteStatus>
writeStatuses) {
checkArgument(table.isTableServiceAction(actionType, instantTime),
String.format("Unsupported action: %s.%s is not table service.", actionType,
instantTime));
context.setJobStatus(this.getClass().getSimpleName(), "Committing to
metadata table: " + config.getTableName());
- table.getMetadataWriter(instantTime).ifPresent(w ->
((HoodieTableMetadataWriter) w).update(metadata, writeStatuses, instantTime));
+ Option<HoodieTableMetadataWriter> metadataWriterOpt =
table.getMetadataWriter(instantTime);
+ if (metadataWriterOpt.isPresent()) {
+ try (HoodieTableMetadataWriter metadataWriter = metadataWriterOpt.get())
{
+ metadataWriter.update(metadata, writeStatuses, instantTime);
+ } catch (Exception e) {
Review Comment:
Should we let this throw the exception instead of catching it, to match the
earlier behavior?
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java:
##########
@@ -361,7 +360,15 @@ protected void writeTableMetadata(HoodieTable table,
String instantTime, String
tableServiceClient.writeTableMetadata(table, instantTime, actionType,
metadata, writeStatuses);
} else {
context.setJobStatus(this.getClass().getSimpleName(), "Committing to
metadata table: " + config.getTableName());
- table.getMetadataWriter(instantTime).ifPresent(w ->
((HoodieTableMetadataWriter) w).update(metadata, writeStatuses, instantTime));
+ Option<HoodieTableMetadataWriter> metadataWriterOpt =
table.getMetadataWriter(instantTime);
+ if (metadataWriterOpt.isPresent()) {
+ try (HoodieTableMetadataWriter metadataWriter =
metadataWriterOpt.get()) {
+ metadataWriter.update(metadata, writeStatuses, instantTime);
+ } catch (Exception e) {
Review Comment:
Same here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]