Package org.apache.kafka.common
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 Summary
Constructors Constructor Description TopicIdPartition(Uuid topicId, int partition, String topic)
Create an instance with the provided parameters.TopicIdPartition(Uuid topicId, TopicPartition topicPartition)
Create an instance with the provided parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
int
hashCode()
int
partition()
String
topic()
Uuid
topicId()
TopicPartition
topicPartition()
String
toString()
-
-
-
Constructor Detail
-
TopicIdPartition
public TopicIdPartition(Uuid topicId, TopicPartition topicPartition)
Create an instance with the provided parameters.- Parameters:
topicId
- the topic idtopicPartition
- the topic partition
-
-
Method Detail
-
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.
-
-