ControllerBrokerRequestBatch

ControllerBrokerRequestBatch is created exclusively for a KafkaController that uses it for the following:

Every time ControllerBrokerRequestBatch is used it is first newBatch that is then sendRequestsToBrokers.

ControllerBrokerRequestBatch takes the following to be created:

Table 1. ControllerBrokerRequestBatch’s Internal Properties (e.g. Registries, Counters and Flags)
Name Description

leaderAndIsrRequestMap

Map[Int, mutable.Map[TopicPartition, LeaderAndIsrRequest.PartitionState]]

stopReplicaRequestMap

Map[Int, Seq[StopReplicaRequestInfo]]

updateMetadataRequestBrokerSet

Broker IDs to send UPDATE_METADATA requests to (and to be removed right after a successful sending)

New broker IDs added in addUpdateMetadataRequestForBrokers

updateMetadataRequestPartitionInfoMap

TopicPartitions with their PartitionState

sendRequestsToBrokers Method

sendRequestsToBrokers(controllerEpoch: Int): Unit

sendRequestsToBrokers…​FIXME

Note

sendRequestsToBrokers is used when:

newBatch Method

newBatch(): Unit

newBatch simply throws a IllegalStateException if one of the leaderAndIsrRequestMap, stopReplicaRequestMap and updateMetadataRequestBrokerSet internal registries are not empty.

Controller to broker state change requests batch is not empty while creating a new one. Some LeaderAndIsr state changes [leaderAndIsrRequestMap] might be lost
Controller to broker state change requests batch is not empty while creating a new one. Some StopReplica state changes [stopReplicaRequestMap] might be lost
Controller to broker state change requests batch is not empty while creating a new one. Some UpdateMetadata state changes to brokers [updateMetadataRequestBrokerSet] with partition info [updateMetadataRequestPartitionInfoMap] might be lost
Note

newBatch is used when:

addLeaderAndIsrRequestForBrokers Method

addLeaderAndIsrRequestForBrokers(
  brokerIds: Seq[Int],
  topicPartition: TopicPartition,
  leaderIsrAndControllerEpoch: LeaderIsrAndControllerEpoch,
  replicas: Seq[Int],
  isNew: Boolean): Unit

addLeaderAndIsrRequestForBrokers…​FIXME

Note

addLeaderAndIsrRequestForBrokers is used when:

addUpdateMetadataRequestForBrokers Method

addUpdateMetadataRequestForBrokers(
  brokerIds: Seq[Int],
  partitions: collection.Set[TopicPartition]): Unit

addUpdateMetadataRequestForBrokers…​FIXME

Note

addUpdateMetadataRequestForBrokers is used when:

addStopReplicaRequestForBrokers Method

addStopReplicaRequestForBrokers(
  brokerIds: Seq[Int],
  topicPartition: TopicPartition,
  deletePartition: Boolean,
  callback: (AbstractResponse, Int) => Unit): Unit

addStopReplicaRequestForBrokers…​FIXME

Note

addStopReplicaRequestForBrokers is used when:

clear Method

clear(): Unit

clear simply removes all bindings in the leaderAndIsrRequestMap, stopReplicaRequestMap and updateMetadataRequestBrokerSet internal registries.

Note
clear is used exclusively when KafkaController is requested to handleIllegalState.

results matching ""

    No results matching ""