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(io.netty.channel.Channel channel, StreamingChannel.Kind kind)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StreamingDataOutputPlus
acquireOut()
until closed, cannot invokeStreamingChannel.send(Send)
void
channelInactive(io.netty.channel.ChannelHandlerContext ctx)
void
channelRead(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object message)
io.netty.util.concurrent.Future<?>
close()
boolean
connected()
java.net.InetSocketAddress
connectedTo()
java.lang.String
description()
void
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause)
java.lang.Object
id()
StreamingDataInputPlus
in()
void
onClose(java.lang.Runnable runOnClose)
java.net.InetSocketAddress
peer()
Future<?>
send(StreamingChannel.Send send)
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, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Constructor Detail
-
NettyStreamingChannel
public NettyStreamingChannel(io.netty.channel.Channel channel, StreamingChannel.Kind kind)
-
-
Method Detail
-
id
public java.lang.Object id()
- Specified by:
id
in interfaceStreamingChannel
-
description
public java.lang.String description()
- Specified by:
description
in interfaceStreamingChannel
-
peer
public java.net.InetSocketAddress peer()
- Specified by:
peer
in interfaceStreamingChannel
-
connectedTo
public java.net.InetSocketAddress connectedTo()
- Specified by:
connectedTo
in interfaceStreamingChannel
-
connected
public boolean connected()
- Specified by:
connected
in interfaceStreamingChannel
-
in
public StreamingDataInputPlus in()
- Specified by:
in
in interfaceStreamingChannel
-
acquireOut
public StreamingDataOutputPlus acquireOut()
Description copied from interface:StreamingChannel
until closed, cannot invokeStreamingChannel.send(Send)
- Specified by:
acquireOut
in interfaceStreamingChannel
-
send
public Future<?> send(StreamingChannel.Send send)
- Specified by:
send
in interfaceStreamingChannel
-
close
public io.netty.util.concurrent.Future<?> close()
- Specified by:
close
in interfaceStreamingChannel
-
onClose
public void onClose(java.lang.Runnable runOnClose)
- Specified by:
onClose
in interfaceStreamingChannel
-
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()
-
-