prashantwason commented on a change in pull request #2701:
URL: https://github.com/apache/hudi/pull/2701#discussion_r663196935
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieInstant.java
##########
@@ -38,24 +39,24 @@
* A COMPACTION action eventually becomes COMMIT when completed. So, when
grouping instants
* for state transitions, this needs to be taken into account
*/
- private static final Map<String, String> COMPARABLE_ACTIONS =
+ public static final Map<String, String> COMPARABLE_ACTIONS =
CollectionUtils.createImmutableMap(HoodieTimeline.COMPACTION_ACTION,
HoodieTimeline.COMMIT_ACTION);
public static final Comparator<HoodieInstant> ACTION_COMPARATOR =
Comparator.comparing(instant ->
getComparableAction(instant.getAction()));
- public static final Comparator<HoodieInstant> COMPARATOR =
Comparator.comparing(HoodieInstant::getTimestamp)
+ public static final Comparator<HoodieInstant> START_INSTANT_TIME_COMPARATOR
= Comparator.comparing(HoodieInstant::getTimestamp)
+ .thenComparing(ACTION_COMPARATOR).thenComparing(HoodieInstant::getState);
+
+ public static final Comparator<HoodieInstant> END_INSTANT_TIME_COMPARATOR =
Comparator.comparing(HoodieInstant::getStateTransitionTime)
.thenComparing(ACTION_COMPARATOR).thenComparing(HoodieInstant::getState);
public static String getComparableAction(String action) {
return COMPARABLE_ACTIONS.getOrDefault(action, action);
}
- public static String getTimelineFileExtension(String fileName) {
- Objects.requireNonNull(fileName);
- int dotIndex = fileName.indexOf('.');
- return dotIndex == -1 ? "" : fileName.substring(dotIndex);
- }
+ public static State DEFAULT_INIT_STATE = State.COMPLETED;
Review comment:
this seems like a finish state rather than INIT (initialization) state.
--
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]