Class IsolatedIngestionServerHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpRequest>
-
- com.linkedin.davinci.ingestion.isolated.IsolatedIngestionServerHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
public class IsolatedIngestionServerHandler extends io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpRequest>
This is the handler class forIsolatedIngestionServer
. This handler will be spawn to handle the followingIngestionAction
request from main process: (1)IngestionAction.COMMAND
: Different kinds of ingestion commands to control the ingestion of a topic (partition). (2)IngestionAction.METRIC
: Request to collect metrics from child process and report to InGraph service. (3)IngestionAction.HEARTBEAT
: Request to check the health of child process for monitoring purpose. (4)IngestionAction.UPDATE_METADATA
: A special kind of request to update metadata of topic partitions opened in main process. As of current ingestion isolation design, metadata partition of a topic will always be opened in child process.MainIngestionStorageMetadataService
maintains in-memory cache of metadata in main process, and it will persist metadata updates via this requests. (5)IngestionAction.SHUTDOWN_COMPONENT
: Request to shut down a specific ingestion component gracefully. This class contains all the logic details to handle above requests and sends backIngestionAction.REPORT
Also, it registers ingestion listener which relays status reporting to main process.
-
-
Constructor Summary
Constructors Constructor Description IsolatedIngestionServerHandler(IsolatedIngestionServer isolatedIngestionServer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
channelRead0(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest msg)
void
channelReadComplete(io.netty.channel.ChannelHandlerContext ctx)
void
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause)
protected void
validateAndExecuteCommand(IngestionCommandType command, IngestionTaskReport report, java.lang.Runnable commandRunnable)
-
Methods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelRead
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Constructor Detail
-
IsolatedIngestionServerHandler
public IsolatedIngestionServerHandler(IsolatedIngestionServer isolatedIngestionServer)
-
-
Method Detail
-
channelReadComplete
public void channelReadComplete(io.netty.channel.ChannelHandlerContext ctx)
- Specified by:
channelReadComplete
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelReadComplete
in classio.netty.channel.ChannelInboundHandlerAdapter
-
channelRead0
protected void channelRead0(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.FullHttpRequest msg) throws java.lang.Exception
- Specified by:
channelRead0
in classio.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.FullHttpRequest>
- Throws:
java.lang.Exception
-
exceptionCaught
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause)
- Specified by:
exceptionCaught
in interfaceio.netty.channel.ChannelHandler
- Specified by:
exceptionCaught
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
exceptionCaught
in classio.netty.channel.ChannelInboundHandlerAdapter
-
validateAndExecuteCommand
protected void validateAndExecuteCommand(IngestionCommandType command, IngestionTaskReport report, java.lang.Runnable commandRunnable)
-
-