Package org.apache.cassandra.transport
Class PipelineConfigurator
- java.lang.Object
-
- org.apache.cassandra.transport.PipelineConfigurator
-
public class PipelineConfigurator extends java.lang.Object
Takes care of intializing a Netty Channel and Pipeline for client protocol connections. The pipeline is first set up with some common handlers for connection limiting, dropping idle connections and optionally SSL, along with a handler to deal with the handshake between client and server. That handshake handler calls back to this class to reconfigure the pipeline once the protocol version for the connection has been established.
-
-
Constructor Summary
Constructors Constructor Description PipelineConfigurator(boolean epoll, boolean keepAlive, boolean legacyFlusher, EncryptionOptions.TlsEncryptionPolicy encryptionPolicy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configureInitialPipeline(io.netty.channel.Channel channel, Connection.Factory connectionFactory)
void
configureLegacyPipeline(io.netty.channel.ChannelHandlerContext ctx, org.apache.cassandra.transport.ClientResourceLimits.Allocator limits)
void
configureModernPipeline(io.netty.channel.ChannelHandlerContext ctx, org.apache.cassandra.transport.ClientResourceLimits.Allocator resourceAllocator, ProtocolVersion version, java.util.Map<java.lang.String,java.lang.String> options)
protected Dispatcher
dispatcher(boolean useLegacyFlusher)
protected org.apache.cassandra.transport.PipelineConfigurator.EncryptionConfig
encryptionConfig()
protected FrameDecoder
frameDecoder(java.lang.String compression, BufferPoolAllocator allocator)
protected FrameEncoder
frameEncoder(java.lang.String compression)
io.netty.channel.ChannelFuture
initializeChannel(io.netty.channel.EventLoopGroup workerGroup, java.net.InetSocketAddress socket, Connection.Factory connectionFactory)
protected io.netty.channel.ChannelInitializer<io.netty.channel.Channel>
initializer(Connection.Factory connectionFactory)
protected org.apache.cassandra.transport.CQLMessageHandler.MessageConsumer<Message.Request>
messageConsumer()
protected org.apache.cassandra.transport.Message.Decoder<Message.Request>
messageDecoder()
protected void
onInitialPipelineReady(io.netty.channel.ChannelPipeline pipeline)
protected void
onNegotiationComplete(io.netty.channel.ChannelPipeline pipeline)
protected org.apache.cassandra.transport.ClientResourceLimits.ResourceProvider
resourceProvider(org.apache.cassandra.transport.ClientResourceLimits.Allocator allocator)
-
-
-
Constructor Detail
-
PipelineConfigurator
public PipelineConfigurator(boolean epoll, boolean keepAlive, boolean legacyFlusher, EncryptionOptions.TlsEncryptionPolicy encryptionPolicy)
-
-
Method Detail
-
initializeChannel
public io.netty.channel.ChannelFuture initializeChannel(io.netty.channel.EventLoopGroup workerGroup, java.net.InetSocketAddress socket, Connection.Factory connectionFactory)
-
initializer
protected io.netty.channel.ChannelInitializer<io.netty.channel.Channel> initializer(Connection.Factory connectionFactory)
-
encryptionConfig
protected org.apache.cassandra.transport.PipelineConfigurator.EncryptionConfig encryptionConfig()
-
configureInitialPipeline
public void configureInitialPipeline(io.netty.channel.Channel channel, Connection.Factory connectionFactory)
-
configureModernPipeline
public void configureModernPipeline(io.netty.channel.ChannelHandlerContext ctx, org.apache.cassandra.transport.ClientResourceLimits.Allocator resourceAllocator, ProtocolVersion version, java.util.Map<java.lang.String,java.lang.String> options)
-
onInitialPipelineReady
protected void onInitialPipelineReady(io.netty.channel.ChannelPipeline pipeline)
-
onNegotiationComplete
protected void onNegotiationComplete(io.netty.channel.ChannelPipeline pipeline)
-
resourceProvider
protected org.apache.cassandra.transport.ClientResourceLimits.ResourceProvider resourceProvider(org.apache.cassandra.transport.ClientResourceLimits.Allocator allocator)
-
dispatcher
protected Dispatcher dispatcher(boolean useLegacyFlusher)
-
messageConsumer
protected org.apache.cassandra.transport.CQLMessageHandler.MessageConsumer<Message.Request> messageConsumer()
-
messageDecoder
protected org.apache.cassandra.transport.Message.Decoder<Message.Request> messageDecoder()
-
frameDecoder
protected FrameDecoder frameDecoder(java.lang.String compression, BufferPoolAllocator allocator)
-
frameEncoder
protected FrameEncoder frameEncoder(java.lang.String compression)
-
configureLegacyPipeline
public void configureLegacyPipeline(io.netty.channel.ChannelHandlerContext ctx, org.apache.cassandra.transport.ClientResourceLimits.Allocator limits)
-
-