davehagman commented on a change in pull request #3820:
URL: https://github.com/apache/hudi/pull/3820#discussion_r737560726
##########
File path:
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/utils/TransactionUtils.java
##########
@@ -111,16 +118,27 @@
}
}
- // override the current metadata with the metadata from the latest instant
for the specified key prefixes
- private static void overrideWithLatestCommitMetadata(HoodieTableMetaClient
metaClient, Option<HoodieCommitMetadata> thisMetadata,
- Option<HoodieInstant> thisInstant, List<String> keyPrefixes) {
+ private static void
mergeCheckpointStateFromPreviousCommit(HoodieTableMetaClient metaClient,
Option<HoodieCommitMetadata> thisMetadata) {
+ overrideWithLatestCommitMetadata(metaClient, thisMetadata,
Collections.singletonList(HoodieWriteConfig.DELTASTREAMER_CHECKPOINT_KEY));
+ }
+
+ /**
+ * Generic method allowing us to override the current metadata with the
metadata from
+ * the latest instant for the specified key prefixes
+ * @param metaClient
+ * @param thisMetadata
+ * @param keyPrefixes The key prefixes to merge from the previous commit
+ */
+ private static void overrideWithLatestCommitMetadata(HoodieTableMetaClient
metaClient,
Review comment:
> Were you able to write unit tests for
mergeCheckpointStateFromPreviousCommit atleast. you can mock
getLastCompletedTxnInstantAndMetadata if need be to make it easier.
Working on this now
--
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]