ConsumerNetworkClient
is a high-level Kafka consumer that…FIXME
ConsumerNetworkClient
is created for KafkaConsumer and AdminClient.
Tip
|
Enable Add the following line to
Refer to Logging. |
void checkDisconnects(long now)
checkDisconnects
…FIXME
Note
|
checkDisconnects is used exclusively when ConsumerNetworkClient is requested to poll.
|
RequestFuture<ClientResponse> send(Node node, AbstractRequest.Builder<?> requestBuilder)
send
creates a RequestFutureCompletionHandler
and requests the KafkaClient for a new ClientRequest (with the RequestFutureCompletionHandler
and expecting a response).
send
records the new ClientRequest
with the node
in unsent internal registry.
send
requests the KafkaClient to wake up.
Note
|
send is used…FIXME
|
void wakeup()
wakeup
prints out the following DEBUG message to the logs:
Received user wakeup
wakeup
turns the internal wakeup flag on and requests KafkaClient to wakeup
Note
|
wakeup is used when…FIXME
|
void ensureFreshMetadata()
ensureFreshMetadata
waits for metadata update when Metadata was requested for update or time to the next update is now.
Note
|
ensureFreshMetadata is used when ConsumerCoordinator does onJoinComplete, performAssignment and poll.
|
int pendingRequestCount()
int pendingRequestCount(Node node)
pendingRequestCount
…FIXME
Note
|
pendingRequestCount is used when…FIXME
|
Node leastLoadedNode()
leastLoadedNode
…FIXME
Note
|
|
void poll(
RequestFuture<?> future) // (1)
boolean poll(
RequestFuture<?> future,
Timer timer)
void poll(
Timer timer) // (2)
void poll(
Timer timer,
PollCondition pollCondition) // (3)
void poll(
Timer timer,
PollCondition pollCondition,
boolean disableWakeup)
-
Used in tests (and uses a maximum timeout)
-
Uses uninitialized
PollCondition
(null
) -
Turns
disableWakeup
off (false
)
poll
…FIXME
Note
|
|
boolean awaitMetadataUpdate(long timeout)
awaitMetadataUpdate
…FIXME
Note
|
awaitMetadataUpdate is used when…FIXME
|
boolean awaitPendingRequests(Node node, Timer timer)
awaitPendingRequests
…FIXME
Note
|
awaitPendingRequests is used when…FIXME
|
void pollNoWakeup()
pollNoWakeup
…FIXME
Note
|
|
ConsumerNetworkClient
takes the following when created:
ConsumerNetworkClient
initializes the internal registries and counters.
long trySend(long now)
trySend
…FIXME
Note
|
trySend is used exclusively when ConsumerNetworkClient is requested to poll.
|
void tryConnect(Node node)
tryConnect
simply requests the KafkaClient to initiate a connection to the given broker Node.
Note
|
tryConnect is used exclusively when FindCoordinatorResponseHandler is requested to onSuccess.
|
void handlePendingDisconnects()
handlePendingDisconnects
…FIXME
Note
|
handlePendingDisconnects is used exclusively when ConsumerNetworkClient is requested to poll.
|
void maybeTriggerWakeup()
maybeTriggerWakeup
…FIXME
Note
|
maybeTriggerWakeup is used when…FIXME
|
void transmitSends()
transmitSends
…FIXME
Note
|
transmitSends is used when KafkaConsumer is requested to poll.
|