KafkaClient

KafkaClient is the contract for…​FIXME

Note
NetworkClient is the one and only implementation.

KafkaClient Contract

package org.apache.kafka.clients;

public interface KafkaClient extends Closeable {
  void close(String nodeId);
  long connectionDelay(Node node, long now);
  boolean connectionFailed(Node node);
  void disconnect(String nodeId);
  boolean hasInFlightRequests();
  boolean hasInFlightRequests(String nodeId);
  boolean hasReadyNodes();
  int inFlightRequestCount();
  int inFlightRequestCount(String nodeId);
  boolean isReady(Node node, long now);
  Node leastLoadedNode(long now);
  ClientRequest newClientRequest(String nodeId, AbstractRequest.Builder<?> requestBuilder,
                                 long createdTimeMs, boolean expectResponse);
  ClientRequest newClientRequest(String nodeId, AbstractRequest.Builder<?> requestBuilder, long createdTimeMs,
                                 boolean expectResponse, RequestCompletionHandler callback);
  boolean ready(Node node, long now);
  List<ClientResponse> poll(long timeout, long now);
  void send(ClientRequest request, long now);
  void wakeup();
}
Table 1. KafkaClient Contract
Method Description

newClientRequest

Used when:

  • …​FIXME

wakeup

Used when:

  • …​FIXME

poll

Used when:

  • ConsumerNetworkClient polls

  • (Blocking) NetworkClientUtils does awaitReady, isReady or sendAndReceive

  • AdminClientRunnable is started (and run is executed)

  • Sender is requested to run once

  • InterBrokerSendThread does its work

results matching ""

    No results matching ""