static Cluster bootstrap(List<InetSocketAddress> addresses)
Cluster
Cluster represents a subset of the nodes and topic partitions in a Kafka cluster.
|
Note
|
org.apache.kafka.common.Cluster is a public final class.
|
A special variant of a cluster is boostrap cluster that is made up of the bootstrap brokers that are mandatory (and specified explicitly) when Kafka clients are created, i.e. KafkaAdminClient, AdminClient, KafkaConsumer and KafkaProducer.
|
Note
|
A bootstrap cluster does not hold all information about the cluster. |
Cluster is created when:
-
AdminMetadataManageris requested to clearController -
Clusteris requested to create an empty Cluster metadata and Cluster metadata with given partitions, and bootstrap -
MetadataCacheis requested to getClusterMetadata -
Metadatais requested to getClusterForCurrentTopics -
MetadataResponseis requested to cluster
| Name | Description |
|---|---|
Flag…FIXME Used when…FIXME |
|
bootstrap Factory Method
bootstrap…FIXME
|
Note
|
bootstrap is used when KafkaAdminClient, KafkaConsumer and KafkaProducer are created (and update their internal metadata).
|
isBootstrapConfigured Method
boolean isBootstrapConfigured()
isBootstrapConfigured gives isBootstrapConfigured internal flag.
|
Note
|
isBootstrapConfigured is used when…FIXME
|
Getting Partitions for Topic — partitionsForTopic Method
List<PartitionInfo> partitionsForTopic(String topic)
partitionsForTopic returns a collection of zero or more partition of the input topic from partitionsByTopic internal lookup table.
|
Note
|
|
availablePartitionsForTopic Method
List<PartitionInfo> availablePartitionsForTopic(String topic)
availablePartitionsForTopic…FIXME
|
Note
|
availablePartitionsForTopic is used when…FIXME
|
Creating Cluster Instance
Cluster takes the following when created:
-
Kafka Nodes (
Collection<Node>) -
Kafka PartitionInfos (
Collection<PartitionInfo>) -
Controller (as a Kafka Node)
Cluster initializes the internal registries and counters.