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

2020-08-28 Thread GitBox


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



##
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 
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> 
getExtraMetadataTimeline(HoodieTableMetaClient metaClient, String 
extraMetadataKey) {

Review comment:
   getAllExtraMetadataFromActiveTimeline ?





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




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

2020-08-27 Thread GitBox


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