Class TopicIdPartition

java.lang.Object
org.apache.kafka.common.TopicIdPartition

public class TopicIdPartition extends Object
This represents universally unique identifier with topic id for a topic partition. This makes sure that topics recreated with the same name will always have unique topic identifiers.
  • Constructor Details

    • TopicIdPartition

      public TopicIdPartition(Uuid topicId, TopicPartition topicPartition)
      Create an instance with the provided parameters.
      Parameters:
      topicId - the topic id
      topicPartition - the topic partition
    • TopicIdPartition

      public TopicIdPartition(Uuid topicId, int partition, String topic)
      Create an instance with the provided parameters.
      Parameters:
      topicId - the topic id
      partition - the partition id
      topic - the topic name or null
  • Method Details

    • topicId

      public Uuid topicId()
      Returns:
      Universally unique id representing this topic partition.
    • topic

      public String topic()
      Returns:
      the topic name or null if it is unknown.
    • partition

      public int partition()
      Returns:
      the partition id.
    • topicPartition

      public TopicPartition topicPartition()
      Returns:
      Topic partition representing this instance.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object