org.apache.storm.kafka.spout

## Class TopicPartitionComparator

- java.lang.Object
- - org.apache.storm.kafka.spout.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.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static TopicPartitionComparator` | `INSTANCE`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compare(org.apache.kafka.common.TopicPartition o1, org.apache.kafka.common.TopicPartition 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

      `comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

- - ### Field Detail

    - #### INSTANCE

          public static final TopicPartitionComparator INSTANCE

  - ### 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>`

Copyright © 2021 The Apache Software Foundation. All rights reserved.