AdminClient

AdminClient…​FIXME

AdminClient uses the admin-client-network-thread to poll continuously (using ConsumerNetworkClient).

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

networkThread

admin-client-network-thread

Tip

Enable DEBUG logging level for kafka.admin.AdminClient logger to see what happens inside.

Add the following line to config/tools-log4j.properties:

log4j.logger.kafka.admin.AdminClient=DEBUG

Refer to Logging.

Creating AdminClient — create Method

create(config: AdminConfig): AdminClient

create…​FIXME

Note
create is used when…​FIXME

Sending Request (Using ConsumerNetworkClient) — send Internal Method

send(
  target: Node,
  api: ApiKeys,
  request: AbstractRequest.Builder[_ <: AbstractRequest]): AbstractResponse

send requests ConsumerNetworkClient to send the input request to the target.

AdminClient send.png
Figure 1. AdminClient Sends Requests Using ConsumerNetworkClient

send records the future result in pendingFutures registry.

send waits until the future result has come after which it is removed from pendingFutures registry.

Caution
FIXME Why is the future result registed in pendingFutures?

When the future result has completed, send takes the response body for a successful result or reports a RuntimeException.

Note
send is used when AdminClient does sendAnyNode, listGroups, getApiVersions, listGroupOffsets and describeConsumerGroupHandler.

findAllBrokers Method

findAllBrokers(): List[Node]

findAllBrokers creates a Metadata API request and sends it to one of the bootstrap brokers.

findAllBrokers returns the nodes from the cluster metadata of the MetadataResponse.

Note
findAllBrokers is used when AdminClient does awaitBrokers, lists all groups per broker and listAllBrokerVersionInfo.

Sending API Request to Bootstrap Broker — sendAnyNode Internal Method

sendAnyNode(api: ApiKeys, request: AbstractRequest.Builder[_ <: AbstractRequest]): AbstractResponse

sendAnyNode walks over bootstrapBrokers and sends the input request.

sendAnyNode exits in case of AuthenticationException.

In case of any other Exceptions (but AuthenticationException) sendAnyNode prints DEBUG message to the logs and tries the remaining brokers.

Request [api] failed against node [broker]

When no brokers succeeded, sendAnyNode reports a RuntimeException with the following message:

Request [api] failed on brokers [bootstrapBrokers]
Note
sendAnyNode is used when AdminClient is requested to find the coordinator, finds all brokers and deleteRecordsBefore.

findCoordinator Method

FIXME

findCoordinator…​FIXME

Note
findCoordinator is used when KafkaConsumerGroupService…​FIXME

deleteRecordsBefore Method

FIXME

deleteRecordsBefore…​FIXME

Note
deleteRecordsBefore is used when KafkaConsumerGroupService…​FIXME

listGroups Method

FIXME

listGroups…​FIXME

Note
listGroups is used when KafkaConsumerGroupService…​FIXME

listAllBrokerVersionInfo Method

FIXME

listAllBrokerVersionInfo…​FIXME

Note
listAllBrokerVersionInfo is used when KafkaConsumerGroupService…​FIXME

awaitBrokers Method

FIXME

awaitBrokers…​FIXME

Note
awaitBrokers is used when KafkaConsumerGroupService…​FIXME

listAllConsumerGroups Method

FIXME

listAllConsumerGroups…​FIXME

Note
listAllConsumerGroups is used when KafkaConsumerGroupService…​FIXME

Listing All Groups per Broker — listAllGroups Method

listAllGroups(): Map[Node, List[GroupOverview]]

listAllGroups finds all brokers (in a cluster) and collects their groups.

Note
listAllGroups is used when AdminClient does listAllConsumerGroups and listAllGroupsFlattened.

listAllGroupsFlattened Method

listAllGroupsFlattened(): List[GroupOverview]

listAllGroupsFlattened simply takes all groups (across all brokers in a cluster).

Note
listAllGroupsFlattened is used excusively when AdminClient lists all consumer groups.

Listing All Consumer Groups — listAllConsumerGroupsFlattened Method

listAllConsumerGroupsFlattened(): List[GroupOverview]

listAllConsumerGroupsFlattened takes all groups with consumer protocol type.

Note
listAllConsumerGroupsFlattened is used exclusively when KafkaConsumerGroupService is requested for all consumer groups.

listGroupOffsets Method

FIXME

listGroupOffsets…​FIXME

Note
listGroupOffsets is used when KafkaConsumerGroupService…​FIXME

results matching ""

    No results matching ""