Class StreamingInboundHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- org.apache.cassandra.streaming.async.StreamingInboundHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
public class StreamingInboundHandler extends io.netty.channel.ChannelInboundHandlerAdapter
Handles the inbound side of streaming messages and stream data. From the incoming data, we derserialize the message including the actual stream data itself. Because the reading and deserialization of streams is a blocking affair, we can't block the netty event loop. Thus we have a background thread perform all the blocking deserialization.
-
-
Constructor Summary
Constructors Constructor Description StreamingInboundHandler(InetAddressAndPort remoteAddress, int protocolVersion, StreamSession session)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
channelInactive(io.netty.channel.ChannelHandlerContext ctx)
void
channelRead(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object message)
void
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause)
void
handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
static void
shutdown()
Shutdown for in-JVM tests.static void
trackInboundHandlers()
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerRemoved, isSharable
-
-
-
-
Constructor Detail
-
StreamingInboundHandler
public StreamingInboundHandler(InetAddressAndPort remoteAddress, int protocolVersion, @Nullable StreamSession session)
-
-
Method Detail
-
handlerAdded
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
- Specified by:
handlerAdded
in interfaceio.netty.channel.ChannelHandler
- Overrides:
handlerAdded
in classio.netty.channel.ChannelHandlerAdapter
-
channelRead
public void channelRead(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object message)
- Specified by:
channelRead
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelRead
in classio.netty.channel.ChannelInboundHandlerAdapter
-
channelInactive
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
- Specified by:
channelInactive
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelInactive
in classio.netty.channel.ChannelInboundHandlerAdapter
-
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
-
shutdown
public static void shutdown()
Shutdown for in-JVM tests. For any other usage, tracking of active inbound streaming handlers should be revisted first and in-JVM shutdown refactored with it. This does not prevent new inbound handlers being added after shutdown, nor is not thread-safe around new inbound handlers being opened during shutdown.
-
trackInboundHandlers
public static void trackInboundHandlers()
-
-