T
- type of the leader to retrieve@ChannelHandler.Sharable public abstract class LeaderRetrievalHandler<T extends RestfulGateway> extends org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler<RoutedRequest>
SimpleChannelInboundHandler
which encapsulates the leader retrieval logic for the REST
endpoints.Modifier and Type | Field and Description |
---|---|
protected GatewayRetriever<? extends T> |
leaderRetriever |
protected org.slf4j.Logger |
logger |
protected Map<String,String> |
responseHeaders |
protected Time |
timeout |
Modifier | Constructor and Description |
---|---|
protected |
LeaderRetrievalHandler(GatewayRetriever<? extends T> leaderRetriever,
Time timeout,
Map<String,String> responseHeaders) |
Modifier and Type | Method and Description |
---|---|
protected void |
channelRead0(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext channelHandlerContext,
RoutedRequest routedRequest) |
protected abstract void |
respondAsLeader(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext channelHandlerContext,
RoutedRequest request,
T gateway) |
acceptInboundMessage, channelRead
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
protected final org.slf4j.Logger logger
protected final GatewayRetriever<? extends T extends RestfulGateway> leaderRetriever
protected final Time timeout
protected void channelRead0(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext channelHandlerContext, RoutedRequest routedRequest)
channelRead0
in class org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler<RoutedRequest>
protected abstract void respondAsLeader(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext channelHandlerContext, RoutedRequest request, T gateway) throws Exception
Exception
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.