public class TierTopic extends Object implements InitializedTierTopic
Modifier and Type | Method and Description |
---|---|
void |
initialize(int numPartitions) |
void |
initialize(kafka.server.InternalAdmin internalAdmin,
int configuredNumPartitions,
short configuredReplicationFactor)
Initializes the TierTopic by first checking if the tier topic exists.
|
static boolean |
isConfigValid(org.slf4j.Logger logger,
String topicName,
org.apache.kafka.storage.internals.log.LogConfig config) |
OptionalInt |
numPartitions() |
static Properties |
topicConfig() |
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) |
void |
tryUpdatingTopicConfig(kafka.server.InternalAdmin internalAdmin,
Properties topicConfig) |
public TierTopic(String tierNamespace)
public void initialize(kafka.server.InternalAdmin internalAdmin, int configuredNumPartitions, short configuredReplicationFactor)
internalAdmin
- admin client to ensure the tiered topic state existsconfiguredNumPartitions
- Configured number of partitionsconfiguredReplicationFactor
- Configured replication factorException
- Caller is expected to handle any exceptions from the underlying zk clientpublic void tryUpdatingTopicConfig(kafka.server.InternalAdmin internalAdmin, Properties topicConfig)
public 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)
public static Properties topicConfig()
public static boolean isConfigValid(org.slf4j.Logger logger, String topicName, org.apache.kafka.storage.internals.log.LogConfig config)