Github user mxm commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2718#discussion_r85523016
  
    --- Diff: 
flink-tests/src/test/java/org/apache/flink/test/checkpointing/TimestampedFileInputSplitTest.java
 ---
    @@ -90,4 +112,60 @@ public void testIllegalArgument() {
                        }
                }
        }
    +
    +   @Test
    +   public void testPriorityQ() {
    +           TimestampedFileInputSplit richFirstSplit =
    +                   new TimestampedFileInputSplit(0, 3, new 
Path("test/test1"), 0, 100, null);
    +
    +           TimestampedFileInputSplit richSecondSplit =
    +                   new TimestampedFileInputSplit(10, 2, new 
Path("test/test2"), 0, 100, null);
    +
    +           TimestampedFileInputSplit richThirdSplit =
    +                   new TimestampedFileInputSplit(10, 1, new 
Path("test/test2"), 0, 100, null);
    +
    +           TimestampedFileInputSplit richForthSplit =
    +                   new TimestampedFileInputSplit(11, 0, new 
Path("test/test3"), 0, 100, null);
    +
    +           TimestampedFileInputSplit richFifthSplit =
    +                   new TimestampedFileInputSplit(11, 1, new 
Path("test/test3"), 0, 100, null);
    +
    +           TimestampedFileInputSplit eos = TimestampedFileInputSplit.EOS;
    +
    +           Queue<TimestampedFileInputSplit> pendingSplits = new 
PriorityQueue<>(10, new Comparator<TimestampedFileInputSplit>() {
    +                   @Override
    +                   public int compare(TimestampedFileInputSplit o1, 
TimestampedFileInputSplit o2) {
    +                           return o1.compareTo(o2);
    +                   }
    +           });
    --- End diff --
    
    `TimestampedFileInputSplit` is already `Comparable`. So you can skip the 
Comparator here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to