public class TierTopic extends Object implements InitializedTierTopic
Modifier and Type | Method and Description |
---|---|
void |
initialize(kafka.zk.AdminZkClient adminZkClient,
int configuredNumPartitions,
short configuredReplicationFactor)
Initializes the TierTopic by first checking if the tier topic exists.
|
void |
initialize(int numPartitions) |
OptionalInt |
numPartitions() |
String |
topicName() |
static String |
topicName(String tierNamespace) |
org.apache.kafka.common.TopicPartition |
toTierTopicPartition(TopicIdPartition tieredPartition) |
static org.apache.kafka.common.TopicPartition |
toTierTopicPartition(TopicIdPartition tieredPartition,
String topicName,
TierTopicPartitioner partitioner) |
Set<org.apache.kafka.common.TopicPartition> |
toTierTopicPartitions(Collection<TopicIdPartition> tieredPartitions)
Generate the tier topic partitions containing data for tiered partitions.
|
static Set<org.apache.kafka.common.TopicPartition> |
toTierTopicPartitions(Collection<TopicIdPartition> tieredPartitions,
String topicName,
TierTopicPartitioner partitioner) |
public TierTopic(String tierNamespace)
public void initialize(kafka.zk.AdminZkClient adminZkClient, int configuredNumPartitions, short configuredReplicationFactor)
configuredNumPartitions
- Configured number of partitionsconfiguredReplicationFactor
- Configured replication factorException
- Caller is expected to handle any exceptions from the underlying zk clientpublic void initialize(int numPartitions)
public Set<org.apache.kafka.common.TopicPartition> toTierTopicPartitions(Collection<TopicIdPartition> tieredPartitions)
toTierTopicPartitions
in interface InitializedTierTopic
tieredPartitions
- partitions that have been tieredpublic org.apache.kafka.common.TopicPartition toTierTopicPartition(TopicIdPartition tieredPartition)
toTierTopicPartition
in interface InitializedTierTopic
public String topicName()
topicName
in interface InitializedTierTopic
public OptionalInt numPartitions()
numPartitions
in interface InitializedTierTopic
public static Set<org.apache.kafka.common.TopicPartition> toTierTopicPartitions(Collection<TopicIdPartition> tieredPartitions, String topicName, TierTopicPartitioner partitioner)
public static org.apache.kafka.common.TopicPartition toTierTopicPartition(TopicIdPartition tieredPartition, String topicName, TierTopicPartitioner partitioner)