Class HistoryServerStaticFileServerHandler

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<org.apache.flink.runtime.rest.handler.router.RoutedRequest>
org.apache.flink.runtime.webmonitor.history.HistoryServerStaticFileServerHandler
All Implemented Interfaces:
org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler, org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler

@Sharable public class HistoryServerStaticFileServerHandler extends org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler<org.apache.flink.runtime.rest.handler.router.RoutedRequest>
Simple file server handler used by the HistoryServer that serves requests to web frontend's static files, such as HTML, CSS, JS or JSON files.

This code is based on the "HttpStaticFileServerHandler" from the Netty project's HTTP server example.

This class is a copy of the StaticFileServerHandler. The differences are that the request path is modified to end on ".json" if it does not have a filename extension; when "index.html" is requested we load "index_hs.html" instead to inject the modified HistoryServer WebInterface and that the caching of the "/joboverview" page is prevented.

  • 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
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    channelRead0(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx, org.apache.flink.runtime.rest.handler.router.RoutedRequest routedRequest)
     
    void
    exceptionCaught(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
     

    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, 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
  • Constructor Details

    • HistoryServerStaticFileServerHandler

      public HistoryServerStaticFileServerHandler(File rootPath) throws IOException
      Throws:
      IOException
  • Method Details

    • channelRead0

      public void channelRead0(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx, org.apache.flink.runtime.rest.handler.router.RoutedRequest routedRequest) throws Exception
      Specified by:
      channelRead0 in class org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler<org.apache.flink.runtime.rest.handler.router.RoutedRequest>
      Throws:
      Exception
    • exceptionCaught

      public void exceptionCaught(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
      Specified by:
      exceptionCaught in interface org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler
      Specified by:
      exceptionCaught in interface org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler
      Overrides:
      exceptionCaught in class org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter