Class VeniceChunkedWriteHandler

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
com.linkedin.venice.router.streaming.NettyChunkedWriteHandler
com.linkedin.venice.router.streaming.VeniceChunkedWriteHandler
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler

public class VeniceChunkedWriteHandler extends NettyChunkedWriteHandler
This class is the wrapper of ChunkedWriteHandler, and essentially it will introduce the following logic: 1. Register the ChannelHandlerContext and VeniceChunkedWriteHandler in the request since those objects are not available to Venice directly when using DDS lib; 2. Intercept all the writes to delegate the pre-processing to VeniceChunkedResponse before proceeding;
  • Field Details

    • CHUNKED_WRITE_HANDLER_ATTRIBUTE_KEY

      public static final io.netty.util.AttributeKey<VeniceChunkedWriteHandler> CHUNKED_WRITE_HANDLER_ATTRIBUTE_KEY
    • CHANNEL_HANDLER_CONTEXT_ATTRIBUTE_KEY

      public static final io.netty.util.AttributeKey<io.netty.channel.ChannelHandlerContext> CHANNEL_HANDLER_CONTEXT_ATTRIBUTE_KEY
  • Constructor Details

    • VeniceChunkedWriteHandler

      public VeniceChunkedWriteHandler()
  • Method Details

    • channelRead

      public void channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) throws Exception
      Specified by:
      channelRead in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelRead in class io.netty.channel.ChannelInboundHandlerAdapter
      Throws:
      Exception
    • setWriteMessageCallback

      public void setWriteMessageCallback(VeniceChunkedWriteHandler.WriteMessageCallback callback)
    • write

      public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise)
      Specified by:
      write in interface io.netty.channel.ChannelOutboundHandler
      Overrides:
      write in class NettyChunkedWriteHandler