KafkaClient

KafkaClient is the abstraction of Kafka clients.

Note
NetworkClient is the one and only known implementation of the KafkaClient Contract in Apache Kafka.
Table 1. KafkaClient Contract
Method Description

authenticationException

AuthenticationException authenticationException(Node node)

Used when…​FIXME

close

void close(String nodeId)

Closing the Kafka client (releasing resources)

Used when:

connectionDelay

long connectionDelay(Node node, long now)

Used when…​FIXME

connectionFailed

boolean connectionFailed(Node node)

Used when…​FIXME

disconnect

void disconnect(String nodeId)

Used when:

hasInFlightRequests

boolean hasInFlightRequests()
boolean hasInFlightRequests(String nodeId);

Used when…​FIXME

hasReadyNodes

boolean hasReadyNodes(long now)

Used when…​FIXME

inFlightRequestCount

int inFlightRequestCount()
int inFlightRequestCount(String nodeId)

Used when…​FIXME

isReady

boolean isReady(Node node, long now)

Used when:

leastLoadedNode

Node leastLoadedNode(long now)

Used when:

  • DefaultMetadataUpdater is requested to maybeUpdate

  • ConsumerNetworkClient is requested to leastLoadedNode

  • Sender is requested to awaitLeastLoadedNodeReady

  • LeastLoadedNodeProvider and MetadataUpdateNodeIdProvider are requested to provide the least-loaded node

newClientRequest

ClientRequest newClientRequest(
  String nodeId,
  AbstractRequest.Builder<?> requestBuilder,
  long createdTimeMs,
  boolean expectResponse)
ClientRequest newClientRequest(
  String nodeId,
  AbstractRequest.Builder<?> requestBuilder,
  long createdTimeMs,
  boolean expectResponse,
  int requestTimeoutMs,
  RequestCompletionHandler callback)

Used when…​FIXME

poll

List<ClientResponse> poll(
  long timeout,
  long now)

Used when:

pollDelayMs

long pollDelayMs(Node node, long now)

Used when…​FIXME

ready

boolean ready(Node node, long now)

Initiates a connection to the given broker Node (i.e. a connection to a broker node is ready)

Used when:

send

void send(ClientRequest request, long now)

Queues up the ClientRequest for sending

Used when:

wakeup

void wakeup()

Used when…​FIXME

results matching ""

    No results matching ""