Class KafkaInputKeyComparator

  • All Implemented Interfaces:, java.util.Comparator<>,<>
    Direct Known Subclasses:

    public class KafkaInputKeyComparator
    extends java.lang.Object
    This class is used to support secondary sorting for KafkaInput Repush. The key is composed by the raw key + offset, and this class will compare key part first to make it in ascending order and then compare the offset part when keys are equal to maintain an offset-descending order for the same key.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2)  
      protected int compare​(KafkaInputMapperKey k1, KafkaInputMapperKey k2)  
      int compare​( o1, o2)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Constructor Detail

      • KafkaInputKeyComparator

        public KafkaInputKeyComparator()
    • Method Detail

      • compare

        public int compare​(byte[] b1,
                           int s1,
                           int l1,
                           byte[] b2,
                           int s2,
                           int l2)
        Specified by:
        compare in interface<>
      • compare

        public int compare​( o1,
        Specified by:
        compare in interface java.util.Comparator<>