voonhous commented on code in PR #13147:
URL: https://github.com/apache/hudi/pull/13147#discussion_r3401740499
##########
hudi-timeline-service/src/main/java/org/apache/hudi/timeline/service/handlers/TimelineHandler.java:
##########
@@ -46,4 +61,151 @@ public List<InstantDTO> getLastInstant(String basePath) {
public TimelineDTO getTimeline(String basePath) {
return
TimelineDTO.fromTimeline(viewManager.getFileSystemView(basePath).getTimeline());
}
+
+ public org.apache.hudi.common.table.timeline.dto.v2.TimelineDTO
getTimelineV2(String basePath) {
+ return
org.apache.hudi.common.table.timeline.dto.v2.TimelineDTO.fromTimeline(viewManager.getFileSystemView(basePath).getTimeline());
+ }
+
+ public Object getInstantDetails(String basePath, String requestedTime,
String action, String state)
+ throws IOException {
+ HoodieTimeline hoodieTimeline =
viewManager.getFileSystemView(basePath).getTimeline();
+ try {
+ HoodieInstant requestedInstant = new HoodieInstant(
+ HoodieInstant.State.valueOf(state), action, requestedTime,
+ InstantComparatorV1.REQUESTED_TIME_BASED_COMPARATOR);
+
+ Object result;
Review Comment:
Good catch. `getInstantDetails` now derives the `InstantGenerator` from the
timeline's own layout version
(`TimelineLayout.fromVersion(timeline.getTimelineLayoutVersion()).getInstantGenerator()`)
and uses it to create the instant, instead of hardcoding the V1 comparator. So
a V2-layout table gets a V2 instant with the correct comparator and action
mapping (including CLUSTERING). Removed the now-unused `InstantComparatorV1`
import.
--
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]