public class TierTopic extends java.lang.Object implements InitializedTierTopic
Constructor and Description |
---|
TierTopic(java.lang.String tierNamespace,
java.util.function.Supplier<kafka.zk.AdminZkClient> adminZkClientSupplier) |
Modifier and Type | Method and Description |
---|---|
int |
ensureTopic(int configuredNumPartitions,
short configuredReplicationFactor)
Check if tier topic exists.
|
java.util.OptionalInt |
numPartitions() |
java.lang.String |
topicName() |
static java.lang.String |
topicName(java.lang.String tierNamespace) |
org.apache.kafka.common.TopicPartition |
toTierTopicPartition(TopicIdPartition tieredPartition) |
java.util.Set<org.apache.kafka.common.TopicPartition> |
toTierTopicPartitions(java.util.Collection<TopicIdPartition> tieredPartitions)
Generate the tier topic partitions containing data for tiered partitions.
|
public TierTopic(java.lang.String tierNamespace, java.util.function.Supplier<kafka.zk.AdminZkClient> adminZkClientSupplier)
public int ensureTopic(int configuredNumPartitions, short configuredReplicationFactor)
configuredNumPartitions
- Configured number of partitionsconfiguredReplicationFactor
- Configured replication factorjava.lang.Exception
- Caller is expected to handle any exceptions from the underlying zk clientpublic java.util.Set<org.apache.kafka.common.TopicPartition> toTierTopicPartitions(java.util.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 java.lang.String topicName()
topicName
in interface InitializedTierTopic
public java.util.OptionalInt numPartitions()
numPartitions
in interface InitializedTierTopic
public static java.lang.String topicName(java.lang.String tierNamespace)