|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface KafkaClient
The interface for NetworkClient
Method Summary | |
---|---|
void |
close()
Close the client and disconnect from all nodes |
int |
inFlightRequestCount()
The number of currently in-flight requests for which we have not yet returned a response |
boolean |
isReady(Node node,
long now)
Check if we are currently ready to send another request to the given node but don't attempt to connect if we aren't. |
Node |
leastLoadedNode(long now)
Choose the node with the fewest outstanding requests. |
RequestHeader |
nextRequestHeader(ApiKeys key)
Generate a request header for the next request |
java.util.List<ClientResponse> |
poll(java.util.List<ClientRequest> requests,
long timeout,
long now)
Initiate the sending of the given requests and return any completed responses. |
boolean |
ready(Node node,
long now)
Initiate a connection to the given node (if necessary), and return true if already connected. |
void |
wakeup()
Wake up the client if it is currently blocked waiting for I/O |
Method Detail |
---|
boolean isReady(Node node, long now)
node
- The node to checknow
- The current timestampboolean ready(Node node, long now)
node
- The node to connect to.now
- The current time
java.util.List<ClientResponse> poll(java.util.List<ClientRequest> requests, long timeout, long now)
requests
- The requests to sendtimeout
- The maximum amount of time to wait for responses in msnow
- The current time in ms
java.lang.IllegalStateException
- If a request is sent to an unready nodeNode leastLoadedNode(long now)
now
- The current time in ms
int inFlightRequestCount()
RequestHeader nextRequestHeader(ApiKeys key)
key
- The API key of the requestvoid wakeup()
void close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |