minihippo commented on code in PR #6630:
URL: https://github.com/apache/hudi/pull/6630#discussion_r966149554
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/HoodieIndexUtils.java:
##########
@@ -72,6 +73,26 @@ public static List<HoodieBaseFile>
getLatestBaseFilesForPartition(
return Collections.emptyList();
}
+ /**
+ * Fetches Pair of partition path and {@link FileSlice}s for interested
partitions.
+ *
+ * @param partition Partition of interest
+ * @param hoodieTable Instance of {@link HoodieTable} of interest
+ * @return the list of {@link FileSlice}
+ */
+ public static List<FileSlice> getLatestFileSlicesForPartition(
+ final String partition,
+ final HoodieTable hoodieTable) {
+ Option<HoodieInstant> latestCommitTime =
hoodieTable.getMetaClient().getCommitsTimeline()
+ .filterCompletedInstants().lastInstant();
+ if (latestCommitTime.isPresent()) {
+ return hoodieTable.getHoodieView()
+ .getLatestFileSlicesBeforeOrOn(partition,
latestCommitTime.get().getTimestamp(), true)
+ .collect(toList());
Review Comment:
+1
--
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]