@NotThreadSafe public class BlockingSendClient extends Object implements BlockingSend, 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 IOException
sendRequest
in interface BlockingSend
ConnectionException
- - if the connection to the node could not be establishedIOException
- - 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 IOException
InitiateShutdownRequest
to the #targetNode
.
See #sendRequest(AbstractRequest.Builder)
for details.IOException
public void initiateClose()
initiateClose
in interface BlockingSend
public void close() throws Exception
close
in interface BlockingSend
close
in interface AutoCloseable
Exception