You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2020/08/27 18:25:37 UTC

[GitHub] [hudi] n3nash commented on a change in pull request #2044: [HUDI-1228] Add utility method to query extra metadata

n3nash commented on a change in pull request #2044:
URL: https://github.com/apache/hudi/pull/2044#discussion_r478612897



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/table/timeline/TimelineUtils.java
##########
@@ -98,4 +101,31 @@
 
     }).distinct().filter(s -> !s.isEmpty()).collect(Collectors.toList());
   }
+
+  /**
+   * Get extra metadata for specified key from latest commit/deltacommit instant.
+   */
+  public static Option<String> getExtraMetadataFromLatest(HoodieTableMetaClient metaClient, String extraMetadataKey) {
+    return metaClient.getCommitsTimeline().filterCompletedInstants().getReverseOrderedInstants().findFirst().map(instant ->
+        getMetadataValue(metaClient, extraMetadataKey, instant)).orElse(Option.empty());
+  }
+
+  /**
+   * Get extra metadata for specified key from all active commit/deltacommit instants.
+   */
+  public static Map<String, Option<String>> getExtraMetadataTimeline(HoodieTableMetaClient metaClient, String extraMetadataKey) {

Review comment:
       @satishkotha can you describe what this method is used for ? The naming is a little confusing..




----------------------------------------------------------------
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:
users@infra.apache.org