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 ofChunkedWriteHandler
, and essentially it will introduce the following logic: 1. Register theChannelHandlerContext
andVeniceChunkedWriteHandler
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 toVeniceChunkedResponse
before proceeding;
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
VeniceChunkedWriteHandler.WriteMessageCallback
-
Field Summary
Fields Modifier and Type Field Description static io.netty.util.AttributeKey<io.netty.channel.ChannelHandlerContext>
CHANNEL_HANDLER_CONTEXT_ATTRIBUTE_KEY
static io.netty.util.AttributeKey<VeniceChunkedWriteHandler>
CHUNKED_WRITE_HANDLER_ATTRIBUTE_KEY
-
Constructor Summary
Constructors Constructor Description VeniceChunkedWriteHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
channelRead(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg)
void
setWriteMessageCallback(VeniceChunkedWriteHandler.WriteMessageCallback callback)
void
write(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg, io.netty.channel.ChannelPromise promise)
-
Methods inherited from class com.linkedin.venice.router.streaming.NettyChunkedWriteHandler
channelInactive, channelWritabilityChanged, flush, handlerAdded, resumeTransfer
-
Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, read
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelReadComplete, channelRegistered, channelUnregistered, exceptionCaught, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerRemoved, isSharable
-
-
-
-
Field Detail
-
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
-
-
Method Detail
-
channelRead
public void channelRead(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.Exception
- Specified by:
channelRead
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelRead
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
java.lang.Exception
-
setWriteMessageCallback
public void setWriteMessageCallback(VeniceChunkedWriteHandler.WriteMessageCallback callback)
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg, io.netty.channel.ChannelPromise promise)
- Specified by:
write
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
write
in classNettyChunkedWriteHandler
-
-