Class LeaderRetrievalHandler<T extends RestfulGateway>
java.lang.Object
org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerAdapter
org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter
org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler<RoutedRequest>
org.apache.flink.runtime.rest.handler.LeaderRetrievalHandler<T>
- Type Parameters:
T- type of the leader to retrieve
- All Implemented Interfaces:
org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler,org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler
- Direct Known Subclasses:
AbstractHandler,StaticFileServerHandler
@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.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler
org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final GatewayRetriever<? extends T>protected final org.slf4j.Loggerprotected final Duration -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLeaderRetrievalHandler(GatewayRetriever<? extends T> leaderRetriever, Duration timeout, Map<String, String> responseHeaders) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidchannelRead0(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext channelHandlerContext, RoutedRequest routedRequest) protected Durationprotected abstract voidrespondAsLeader(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext channelHandlerContext, RoutedRequest request, T gateway) Methods inherited from class org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Field Details
-
logger
protected final org.slf4j.Logger logger -
leaderRetriever
-
timeout
-
responseHeaders
-
-
Constructor Details
-
LeaderRetrievalHandler
-
-
Method Details
-
getTimeout
-
channelRead0
protected void channelRead0(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext channelHandlerContext, RoutedRequest routedRequest) - Specified by:
channelRead0in classorg.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler<RoutedRequest>
-
respondAsLeader
protected abstract void respondAsLeader(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext channelHandlerContext, RoutedRequest request, T gateway) throws Exception - Throws:
Exception
-