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

    Fields
    Modifier and Type
    Field
    Description
    protected final GatewayRetriever<? extends T>
     
    protected final org.slf4j.Logger
     
    protected final Map<String,String>
     
    protected final Duration
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    LeaderRetrievalHandler(GatewayRetriever<? extends T> leaderRetriever, Duration timeout, Map<String,String> responseHeaders)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    channelRead0(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext channelHandlerContext, RoutedRequest routedRequest)
     
    protected Duration
     
    protected abstract void
    respondAsLeader(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, channelRead

    Methods inherited from class org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter

    channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered

    Methods inherited from class org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, handlerAdded, handlerRemoved, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler

    handlerAdded, handlerRemoved
  • Field Details

  • Constructor Details

  • Method Details

    • getTimeout

      protected Duration getTimeout()
    • channelRead0

      protected void channelRead0(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext channelHandlerContext, RoutedRequest routedRequest)
      Specified by:
      channelRead0 in class org.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