vinothchandar commented on a change in pull request #1009:  [HUDI-308] Avoid 
Renames for tracking state transitions of all actions on dataset
URL: https://github.com/apache/incubator-hudi/pull/1009#discussion_r348089714
 
 

 ##########
 File path: 
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieInstant.java
 ##########
 @@ -30,7 +34,23 @@
  *
  * @see HoodieTimeline
  */
-public class HoodieInstant implements Serializable {
+public class HoodieInstant implements Serializable, Comparable<HoodieInstant> {
+
+  /**
+   * 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 Set<String> comparableActions = Arrays.stream(new 
String[] { HoodieTimeline.COMMIT_ACTION,
+      HoodieTimeline.COMPACTION_ACTION}).collect(Collectors.toSet());
+
+  public static final Comparator<HoodieInstant> comparator = 
Comparator.comparing(HoodieInstant::getTimestamp)
 
 Review comment:
   +1 on this

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to