ssdong commented on a change in pull request #2784:
URL: https://github.com/apache/hudi/pull/2784#discussion_r611067880
##########
File path:
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/utils/MetadataConversionUtils.java
##########
@@ -72,10 +74,21 @@ public static HoodieArchivedMetaEntry
createMetaWrapper(HoodieInstant hoodieInst
HoodieReplaceCommitMetadata replaceCommitMetadata =
HoodieReplaceCommitMetadata
.fromBytes(metaClient.getActiveTimeline().getInstantDetails(hoodieInstant).get(),
HoodieReplaceCommitMetadata.class);
archivedMetaWrapper.setHoodieReplaceCommitMetadata(ReplaceArchivalHelper.convertReplaceCommitMetadata(replaceCommitMetadata));
+ } else if (hoodieInstant.isInflight()) {
+ // inflight replacecommit files have the same meta data body as
HoodieCommitMetadata
+ // so we could re-use it without further creating an inflight
extension.
+ // Or inflight replacecommit files are empty under clustering
circumstance
+ Option<HoodieCommitMetadata> inflightCommitMetadata =
getInflightReplaceMetadata(metaClient, hoodieInstant);
+ if (inflightCommitMetadata.isPresent()) {
+
archivedMetaWrapper.setHoodieInflightReplaceMetadata(convertCommitMetadata(inflightCommitMetadata.get()));
+ }
} else {
- HoodieRequestedReplaceMetadata requestedReplaceMetadata =
- ClusteringUtils.getRequestedReplaceMetadata(metaClient,
hoodieInstant).get();
Review comment:
Using `ClusteringUtils.getRequestedReplaceMetadata` is confusing to the
reader even though it produces the same result. Part of the purpose of this
method is to ignore the `inflight replacecommit` file and delegate it to
`requested replacecommit` file to retrieve the clustering plan. However, what
we merely need is a fetch&deserialization method for requested metadata. Hence,
I have created a separate method for this single purpose.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]