AdminZkClient

AdminZkClient is created when:

AdminZkClient takes a single KafkaZkClient when created.

fetchEntityConfig Method

fetchEntityConfig(rootEntityType: String, sanitizedEntityName: String): Properties

fetchEntityConfig…​FIXME

Note
fetchEntityConfig is used when…​FIXME

writeTopicPartitionAssignment Internal Method

writeTopicPartitionAssignment(
  topic: String,
  replicaAssignment: Map[Int, Seq[Int]],
  update: Boolean): Unit

writeTopicPartitionAssignment…​FIXME

Note
writeTopicPartitionAssignment is used exclusively when AdminZkClient is requested to createOrUpdateTopicPartitionAssignmentPathInZK.

createOrUpdateTopicPartitionAssignmentPathInZK Internal Method

createOrUpdateTopicPartitionAssignmentPathInZK(
  topic: String,
  partitionReplicaAssignment: Map[Int, Seq[Int]],
  config: Properties = new Properties,
  update: Boolean = false): Unit

createOrUpdateTopicPartitionAssignmentPathInZK…​FIXME

Note

createOrUpdateTopicPartitionAssignmentPathInZK is used when:

Creating Topic — createTopic Method

createTopic(
  topic: String,
  partitions: Int,
  replicationFactor: Int,
  topicConfig: Properties = new Properties,
  rackAwareMode: RackAwareMode = RackAwareMode.Enforced): Unit

createTopic fetches the metadata of the brokers in the cluster (given the RackAwareMode).

createTopic requests AdminUtils helper object to assignReplicasToBrokers (given the broker metadata, partitions and replicationFactor).

Note

createTopic is used when:

addPartitions Method

addPartitions(
  topic: String,
  existingAssignment: Map[Int, Seq[Int]],
  allBrokers: Seq[BrokerMetadata],
  numPartitions: Int = 1,
  replicaAssignment: Option[Map[Int, Seq[Int]]] = None,
  validateOnly: Boolean = false): Map[Int, Seq[Int]]

addPartitions…​FIXME

Note
addPartitions is used when…​FIXME

Fetching Metadata of Brokers in Cluster (Broker ID and Rack Information) — getBrokerMetadatas Method

getBrokerMetadatas(
  rackAwareMode: RackAwareMode = RackAwareMode.Enforced,
  brokerList: Option[Seq[Int]] = None): Seq[BrokerMetadata]

getBrokerMetadatas requests the KafkaZkClient for the metadata of the brokers in the cluster.

Note
The broker metadata includes a broker ID, endpoints, and an optional rack information.

getBrokerMetadatas takes the input broker IDs (brokerList) if defined and leaves only those that are available (i.e. among the brokers in the cluster) or falls back to all brokers in the cluster.

getBrokerMetadatas branches off per RackAwareMode as follows:

  • For RackAwareMode.Disabled or RackAwareMode.Safe, getBrokerMetadatas returns BrokerMetadata with broker IDs and no rack information

  • For RackAwareMode.Enforced, getBrokerMetadatas returns BrokerMetadata with broker IDs and rack information

In the end, getBrokerMetadatas sorts the brokers by broker ID.

getBrokerMetadatas throws an AdminOperationException for RackAwareMode.Enforced mode with some brokers without rack information:

Not all brokers have rack information. Add --disable-rack-aware in command line to make replica assignment without rack information.
Note

getBrokerMetadatas is used when:

results matching ""

    No results matching ""