Class TopicPartitionComparator

  • All Implemented Interfaces:
    Comparator<org.apache.kafka.common.TopicPartition>

    public class TopicPartitionComparator
    extends Object
    implements Comparator<org.apache.kafka.common.TopicPartition>
    Singleton comparator of TopicPartitions. Topics have precedence over partitions. Topics are compared through String.compare and partitions are compared numerically.

    Use INSTANCE for all sorting.

    • Method Detail

      • compare

        public int compare​(org.apache.kafka.common.TopicPartition o1,
                           org.apache.kafka.common.TopicPartition o2)
        Specified by:
        compare in interface Comparator<org.apache.kafka.common.TopicPartition>