Class HttpRequestHandler
- 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.shaded.netty4.io.netty.handler.codec.http.HttpObject>
-
- org.apache.flink.runtime.webmonitor.HttpRequestHandler
-
- All Implemented Interfaces:
org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler,org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler
@Sharable public class HttpRequestHandler extends org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler<org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpObject>Simple code which handles all HTTP requests from the user, and passes them to the Router handler directly if they do not involve file upload requests. If a file is required to be uploaded, it handles the upload, and in the http request to the next handler, passes the name of the file to the next handler.
-
-
Constructor Summary
Constructors Constructor Description HttpRequestHandler(File tmpDir)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchannelRead0(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx, org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpObject msg)voidchannelUnregistered(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx)static voidcheckAndCreateUploadDir(File uploadDir)Checks whether the given directory exists and is writable.static voidlogExternalUploadDirDeletion(File uploadDir)-
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, channelWritabilityChanged, exceptionCaught, userEventTriggered
-
Methods inherited from class org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Constructor Detail
-
HttpRequestHandler
public HttpRequestHandler(File tmpDir)
-
-
Method Detail
-
channelUnregistered
public void channelUnregistered(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx) throws Exception- Specified by:
channelUnregisteredin interfaceorg.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler- Overrides:
channelUnregisteredin classorg.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
channelRead0
public void channelRead0(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx, org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpObject msg)- Specified by:
channelRead0in classorg.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler<org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpObject>
-
logExternalUploadDirDeletion
public static void logExternalUploadDirDeletion(File uploadDir)
-
checkAndCreateUploadDir
public static void checkAndCreateUploadDir(File uploadDir) throws IOException
Checks whether the given directory exists and is writable. If it doesn't exist this method will attempt to create it.- Parameters:
uploadDir- directory to check- Throws:
IOException- if the directory does not exist and cannot be created, or if the directory isn't writable
-
-