DefaultMetadataUpdater
is a MetadataUpdater that NetworkClient
uses to…FIXME
DefaultMetadataUpdater
is created exclusively for a NetworkClient.
Tip
|
Enable Add the following line to
Refer to Logging. |
DefaultMetadataUpdater
takes the following to be created:
DefaultMetadataUpdater
initializes the internal properties.
maybeUpdate(long now)
Note
|
maybeUpdate is a part of MetadataUpdater Contract.
|
maybeUpdate
requests Metadata for timeToNextUpdate (with the input now
).
maybeUpdate
takes requestTimeoutMs for the time to wait till metadata fetch in progress finishes if metadataFetchInProgress flag is turned on or 0
otherwise.
maybeUpdate
takes the maximum of the two values above to check if the current cluster metadata has expired.
If not, maybeUpdate
gives the maximum value (that says how long to wait till the current cluster metadata expires).
Otherwise, maybeUpdate
selects the node to request a cluster metadata from and maybeUpdate (with the input now
timestamp and the node).
If no node was found, maybeUpdate
prints out the following DEBUG message to the logs and gives reconnectBackoffMs.
Give up sending metadata request since no node is available
long maybeUpdate(long now, Node node)
maybeUpdate
…FIXME
Note
|
maybeUpdate is used exclusively when DefaultMetadataUpdater is requested to maybeUpdate (with the timestamp only).
|
void handleAuthenticationFailure(AuthenticationException exception)
Note
|
handleAuthenticationFailure is a part of MetadataUpdater Contract.
|
handleCompletedMetadataResponse
turns metadataFetchInProgress flag off.
handleCompletedMetadataResponse
asks Metadata whether metadata update was requested and if so requests it to record a failure (passing on the exception
).
void handleCompletedMetadataResponse(
RequestHeader requestHeader,
long now,
MetadataResponse response)
Note
|
handleCompletedMetadataResponse is a part of MetadataUpdater contract to handle a response to a metadata request.
|
handleCompletedMetadataResponse
…FIXME
void handleDisconnection(
String destination)
Note
|
handleDisconnection is a part of MetadataUpdater contract.
|
handleDisconnection
…FIXME
void handleFatalException(
KafkaException fatalException)
Note
|
handleFatalException is a part of MetadataUpdater contract.
|
handleFatalException
…FIXME
long maybeUpdate(
long now)
Note
|
maybeUpdate is part of the MetadataUpdater contract to…FIXME.
|
maybeUpdate
…FIXME
long maybeUpdate(
long now,
Node node)
maybeUpdate
…FIXME
Note
|
maybeUpdate is used when DefaultMetadataUpdater is requested to maybeUpdate.
|
void requestUpdate()
Note
|
requestUpdate is part of the MetadataUpdater Contract to schedule an update of the current cluster metadata.
|
requestUpdate
simply requests the Metadata for a metadata update.
boolean hasFetchInProgress()
hasFetchInProgress
…FIXME
Note
|
hasFetchInProgress is used when…FIXME
|
boolean isAnyNodeConnecting()
isAnyNodeConnecting
…FIXME
Note
|
isAnyNodeConnecting is used when…FIXME
|
Name | Description |
---|---|
|
Used in hasFetchInProgress and handleCompletedMetadataResponse Initialized to be Set to the requestVersion of the Metadata when Reset to |
|
|