public class ZKTopicMetadataCollector extends Object
Constructor and Description |
---|
ZKTopicMetadataCollector(kafka.server.KafkaConfig config,
kafka.zk.KafkaZkClient zkClient,
org.apache.kafka.common.metrics.Metrics metrics,
org.apache.kafka.common.utils.Time time) |
Modifier and Type | Method and Description |
---|---|
Optional<ZKTopicMetadataCollectorContext> |
collectorContext()
Get the ZKTopicMetadataCollectorContext.
|
boolean |
isActive()
An active collector means it is emitting snapshots and change deltas.
|
void |
onTopicConfigChange(String topic,
kafka.log.LogConfig newConfig)
Listens to topic config changes.
|
void |
onTopicCreate(Map<String,TopicInfo> newTopicWithInfo)
Listens to topic creation.
|
void |
onTopicDelete(Set<String> deleteTopics)
Listens to topic deletion.
|
void |
onTopicPartitionChange(String topic,
int newPartition)
Listens to topic partition changes.
|
void |
setCollectorContext(Optional<ZKTopicMetadataCollectorContext> contextOptional)
Set the ZKTopicMetadataCollectorContext.
|
void |
shutdown()
Shutdown the collector.
|
void |
start(Map<String,TopicInfo> topicsWithInfo,
int epoch)
Start collector, it is going to emit snapshots or change deltas.
|
void |
stop()
Stop collector, it will stop emitting snapshots and stop listens to delta change, but it will
process remaining delta in the queue.
|
public ZKTopicMetadataCollector(kafka.server.KafkaConfig config, kafka.zk.KafkaZkClient zkClient, org.apache.kafka.common.metrics.Metrics metrics, org.apache.kafka.common.utils.Time time)
public void start(Map<String,TopicInfo> topicsWithInfo, int epoch)
topicsWithInfo
- the initial set of topics and their metadata (topic id, number of
partitions, replication factors) when the controller start upepoch
- the epoch of the current controllerpublic void stop()
public void shutdown()
public boolean isActive()
public Optional<ZKTopicMetadataCollectorContext> collectorContext()
public void setCollectorContext(Optional<ZKTopicMetadataCollectorContext> contextOptional)
public void onTopicCreate(Map<String,TopicInfo> newTopicWithInfo)
public void onTopicDelete(Set<String> deleteTopics)
public void onTopicPartitionChange(String topic, int newPartition)
public void onTopicConfigChange(String topic, kafka.log.LogConfig newConfig)