Class NettyStreamingChannel
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- org.apache.cassandra.streaming.async.NettyStreamingChannel
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,StreamingChannel
public class NettyStreamingChannel extends io.netty.channel.ChannelInboundHandlerAdapter implements StreamingChannel
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Nested classes/interfaces inherited from interface org.apache.cassandra.streaming.StreamingChannel
StreamingChannel.Factory, StreamingChannel.Kind, StreamingChannel.Send
-
-
Constructor Summary
Constructors Constructor Description NettyStreamingChannel(int messagingVersion, io.netty.channel.Channel channel, StreamingChannel.Kind kind)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StreamingDataOutputPlusacquireOut()until closed, cannot invokeStreamingChannel.send(Send)voidchannelInactive(io.netty.channel.ChannelHandlerContext ctx)voidchannelRead(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object message)io.netty.util.concurrent.Future<?>close()booleanconnected()java.net.InetSocketAddressconnectedTo()java.lang.Stringdescription()voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause)java.lang.Objectid()StreamingDataInputPlusin()voidonClose(java.lang.Runnable runOnClose)java.net.InetSocketAddresspeer()Future<?>send(StreamingChannel.Send send)static voidshutdown()Shutdown for in-JVM tests.static voidtrackInboundHandlers()-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Constructor Detail
-
NettyStreamingChannel
public NettyStreamingChannel(int messagingVersion, io.netty.channel.Channel channel, StreamingChannel.Kind kind)
-
-
Method Detail
-
id
public java.lang.Object id()
- Specified by:
idin interfaceStreamingChannel
-
description
public java.lang.String description()
- Specified by:
descriptionin interfaceStreamingChannel
-
peer
public java.net.InetSocketAddress peer()
- Specified by:
peerin interfaceStreamingChannel
-
connectedTo
public java.net.InetSocketAddress connectedTo()
- Specified by:
connectedToin interfaceStreamingChannel
-
connected
public boolean connected()
- Specified by:
connectedin interfaceStreamingChannel
-
in
public StreamingDataInputPlus in()
- Specified by:
inin interfaceStreamingChannel
-
acquireOut
public StreamingDataOutputPlus acquireOut()
Description copied from interface:StreamingChanneluntil closed, cannot invokeStreamingChannel.send(Send)- Specified by:
acquireOutin interfaceStreamingChannel
-
send
public Future<?> send(StreamingChannel.Send send)
- Specified by:
sendin interfaceStreamingChannel
-
close
public io.netty.util.concurrent.Future<?> close()
- Specified by:
closein interfaceStreamingChannel
-
onClose
public void onClose(java.lang.Runnable runOnClose)
- Specified by:
onClosein interfaceStreamingChannel
-
channelRead
public void channelRead(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object message)- Specified by:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classio.netty.channel.ChannelInboundHandlerAdapter
-
channelInactive
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
- Specified by:
channelInactivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelInactivein classio.netty.channel.ChannelInboundHandlerAdapter
-
exceptionCaught
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause)- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin 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()
-
-