@NotThreadSafe public class BlockingSendClient extends java.lang.Object implements BlockingSend, java.lang.AutoCloseable
BlockingSendClient
is a client used for sending internal inter-broker requests.
It is blocking.
This class is not thread-safe! It is very similar to #ReplicaFetcherBlockingSend
.Modifier and Type | Class and Description |
---|---|
static class |
BlockingSendClient.Builder |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
initiateClose() |
org.apache.kafka.clients.ClientResponse |
sendRequest(org.apache.kafka.common.requests.AbstractRequest.Builder<? extends org.apache.kafka.common.requests.AbstractRequest> requestBuilder) |
org.apache.kafka.common.requests.InitiateShutdownResponse |
sendShutdownRequest(org.apache.kafka.common.requests.InitiateShutdownRequest.Builder shutdownRequestBuilder)
Sends a #
InitiateShutdownRequest to the #targetNode . |
public org.apache.kafka.clients.ClientResponse sendRequest(org.apache.kafka.common.requests.AbstractRequest.Builder<? extends org.apache.kafka.common.requests.AbstractRequest> requestBuilder) throws java.io.IOException
sendRequest
in interface BlockingSend
ConnectionException
- - if the connection to the node could not be establishedjava.io.IOException
- - if any exception occurred when sending/receiving the requestpublic org.apache.kafka.common.requests.InitiateShutdownResponse sendShutdownRequest(org.apache.kafka.common.requests.InitiateShutdownRequest.Builder shutdownRequestBuilder) throws java.io.IOException
InitiateShutdownRequest
to the #targetNode
.
See #sendRequest(AbstractRequest.Builder)
for details.java.io.IOException
public void initiateClose()
initiateClose
in interface BlockingSend
public void close() throws java.lang.Exception
close
in interface BlockingSend
close
in interface java.lang.AutoCloseable
java.lang.Exception