@Internal @ChannelHandler.Sharable public class KvStateClientProxyHandler extends AbstractServerHandler<KvStateRequest,KvStateResponse>
queryExecutor
Constructor and Description |
---|
KvStateClientProxyHandler(KvStateClientProxyImpl proxy,
int queryExecutorThreads,
MessageSerializer<KvStateRequest,KvStateResponse> serializer,
KvStateRequestStats stats)
Create the handler used by the
KvStateClientProxyImpl . |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<KvStateResponse> |
handleRequest(long requestId,
KvStateRequest request)
Handles an incoming request and returns a
CompletableFuture containing the
corresponding response. |
CompletableFuture<Void> |
shutdown()
Shuts down any handler-specific resources, e.g. thread pools etc and returns a
CompletableFuture . |
channelActive, channelInactive, channelRead, exceptionCaught, getServerName
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
public KvStateClientProxyHandler(KvStateClientProxyImpl proxy, int queryExecutorThreads, MessageSerializer<KvStateRequest,KvStateResponse> serializer, KvStateRequestStats stats)
KvStateClientProxyImpl
.proxy
- the proxy
using the handler.queryExecutorThreads
- the number of threads used to process incoming requests.serializer
- the MessageSerializer
used to (de-) serialize the different
messages.stats
- server statistics collector.public CompletableFuture<KvStateResponse> handleRequest(long requestId, KvStateRequest request)
AbstractServerHandler
CompletableFuture
containing the
corresponding response.
NOTE: This method is called by multiple threads.
handleRequest
in class AbstractServerHandler<KvStateRequest,KvStateResponse>
requestId
- the id of the received request to be handled.request
- the request to be handled.public CompletableFuture<Void> shutdown()
AbstractServerHandler
CompletableFuture
.
If an exception is thrown during the shutdown process, then that exception will be included in the returned future.
shutdown
in class AbstractServerHandler<KvStateRequest,KvStateResponse>
CompletableFuture
that will be completed when the shutdown process actually
finishes.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.