Class Netty4Transport
- java.lang.Object
-
- org.elasticsearch.common.component.AbstractComponent
-
- org.elasticsearch.common.component.AbstractLifecycleComponent
-
- org.elasticsearch.transport.TcpTransport
-
- org.elasticsearch.transport.netty4.Netty4Transport
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,org.elasticsearch.common.component.LifecycleComponent,org.elasticsearch.common.lease.Releasable,org.elasticsearch.transport.Transport
public class Netty4Transport extends org.elasticsearch.transport.TcpTransportThere are 4 types of connections per node, low/med/high/ping. Low if for batch oriented APIs (like recovery or batch) with high payload that will cause regular request. (like search or single index) to take longer. Med is for the typical search / single doc index. And High for things like cluster state. Ping is reserved for sending out ping requests to other nodes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classNetty4Transport.ClientChannelInitializerprotected classNetty4Transport.ServerChannelInitializer-
Nested classes/interfaces inherited from class org.elasticsearch.transport.TcpTransport
org.elasticsearch.transport.TcpTransport.HttpOnTransportException, org.elasticsearch.transport.TcpTransport.NodeChannels, org.elasticsearch.transport.TcpTransport.ProfileSettings, org.elasticsearch.transport.TcpTransport.ScheduledPing
-
Nested classes/interfaces inherited from interface org.elasticsearch.transport.Transport
org.elasticsearch.transport.Transport.Connection, org.elasticsearch.transport.Transport.ResponseContext<T extends org.elasticsearch.transport.TransportResponse>, org.elasticsearch.transport.Transport.ResponseHandlers
-
-
Field Summary
Fields Modifier and Type Field Description protected io.netty.bootstrap.Bootstrapbootstrapstatic org.elasticsearch.common.settings.Setting<java.lang.Integer>NETTY_BOSS_COUNTstatic org.elasticsearch.common.settings.Setting<org.elasticsearch.common.unit.ByteSizeValue>NETTY_RECEIVE_PREDICTOR_MAXstatic org.elasticsearch.common.settings.Setting<org.elasticsearch.common.unit.ByteSizeValue>NETTY_RECEIVE_PREDICTOR_MINstatic org.elasticsearch.common.settings.Setting<org.elasticsearch.common.unit.ByteSizeValue>NETTY_RECEIVE_PREDICTOR_SIZEprotected org.elasticsearch.common.unit.ByteSizeValuereceivePredictorMaxprotected org.elasticsearch.common.unit.ByteSizeValuereceivePredictorMinprotected io.netty.channel.RecvByteBufAllocatorrecvByteBufAllocatorprotected java.util.Map<java.lang.String,io.netty.bootstrap.ServerBootstrap>serverBootstrapsstatic org.elasticsearch.common.settings.Setting<java.lang.Integer>WORKER_COUNTprotected intworkerCount-
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
deprecationLogger, logger, settings
-
Fields inherited from class org.elasticsearch.transport.TcpTransport
BIND_HOST, BIND_HOST_PROFILE, compress, CONNECTIONS_PER_NODE_BULK, CONNECTIONS_PER_NODE_PING, CONNECTIONS_PER_NODE_RECOVERY, CONNECTIONS_PER_NODE_REG, CONNECTIONS_PER_NODE_STATE, DEFAULT_FEATURES_SETTING, DEFAULT_PROFILE, defaultConnectionProfile, FEATURE_PREFIX, HOST, networkService, PING_DATA_SIZE, PING_SCHEDULE, PORT, PORT_PROFILE, profileSettings, PUBLISH_HOST, PUBLISH_HOST_PROFILE, PUBLISH_PORT, PUBLISH_PORT_PROFILE, scheduledPing, TCP_CONNECT_TIMEOUT, TCP_KEEP_ALIVE, TCP_KEEP_ALIVE_PROFILE, TCP_NO_DELAY, TCP_NO_DELAY_PROFILE, TCP_RECEIVE_BUFFER_SIZE, TCP_RECEIVE_BUFFER_SIZE_PROFILE, TCP_REUSE_ADDRESS, TCP_REUSE_ADDRESS_PROFILE, TCP_SEND_BUFFER_SIZE, TCP_SEND_BUFFER_SIZE_PROFILE, threadPool, TRANSPORT_CLIENT_BOSS_THREAD_NAME_PREFIX, TRANSPORT_SERVER_WORKER_THREAD_NAME_PREFIX
-
-
Constructor Summary
Constructors Constructor Description Netty4Transport(org.elasticsearch.common.settings.Settings settings, org.elasticsearch.threadpool.ThreadPool threadPool, org.elasticsearch.common.network.NetworkService networkService, org.elasticsearch.common.util.BigArrays bigArrays, org.elasticsearch.common.io.stream.NamedWriteableRegistry namedWriteableRegistry, org.elasticsearch.indices.breaker.CircuitBreakerService circuitBreakerService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NettyTcpChannelbind(java.lang.String name, java.net.InetSocketAddress address)protected voiddoStart()protected voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause)protected io.netty.channel.ChannelHandlergetClientChannelInitializer()protected io.netty.channel.ChannelHandlergetServerChannelInitializer(java.lang.String name)protected NettyTcpChannelinitiateChannel(org.elasticsearch.cluster.node.DiscoveryNode node, org.elasticsearch.common.unit.TimeValue connectTimeout, org.elasticsearch.action.ActionListener<java.lang.Void> listener)protected voidstopInternal()-
Methods inherited from class org.elasticsearch.common.component.AbstractComponent
logDeprecatedSetting, logRemovedSetting, nodeName
-
Methods inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stop
-
Methods inherited from interface org.elasticsearch.common.component.LifecycleComponent
addLifecycleListener, lifecycleState, removeLifecycleListener, start, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class org.elasticsearch.transport.TcpTransport
addConnectionListener, addressesFromString, bindServer, bindToPort, boundAddress, canCompress, connectToNode, disconnectFromNode, doClose, doStop, ensureOpen, executeHandshake, getConnection, getCurrentVersion, getInFlightRequestBreaker, getLocalAddresses, getProfileSettings, getRequestHandler, getResponseHandlers, getStats, handleRequest, messageReceived, nodeConnected, onException, openConnection, profileBoundAddresses, registerRequestHandler, removeConnectionListener, resolveConnectionProfile, resolvePublishPort, sendErrorResponse, sendResponse, serverAcceptedChannel, validateMessageHeader, validateRequest
-
-
-
-
Field Detail
-
WORKER_COUNT
public static final org.elasticsearch.common.settings.Setting<java.lang.Integer> WORKER_COUNT
-
NETTY_RECEIVE_PREDICTOR_SIZE
public static final org.elasticsearch.common.settings.Setting<org.elasticsearch.common.unit.ByteSizeValue> NETTY_RECEIVE_PREDICTOR_SIZE
-
NETTY_RECEIVE_PREDICTOR_MIN
public static final org.elasticsearch.common.settings.Setting<org.elasticsearch.common.unit.ByteSizeValue> NETTY_RECEIVE_PREDICTOR_MIN
-
NETTY_RECEIVE_PREDICTOR_MAX
public static final org.elasticsearch.common.settings.Setting<org.elasticsearch.common.unit.ByteSizeValue> NETTY_RECEIVE_PREDICTOR_MAX
-
NETTY_BOSS_COUNT
public static final org.elasticsearch.common.settings.Setting<java.lang.Integer> NETTY_BOSS_COUNT
-
recvByteBufAllocator
protected final io.netty.channel.RecvByteBufAllocator recvByteBufAllocator
-
workerCount
protected final int workerCount
-
receivePredictorMin
protected final org.elasticsearch.common.unit.ByteSizeValue receivePredictorMin
-
receivePredictorMax
protected final org.elasticsearch.common.unit.ByteSizeValue receivePredictorMax
-
bootstrap
protected volatile io.netty.bootstrap.Bootstrap bootstrap
-
serverBootstraps
protected final java.util.Map<java.lang.String,io.netty.bootstrap.ServerBootstrap> serverBootstraps
-
-
Constructor Detail
-
Netty4Transport
public Netty4Transport(org.elasticsearch.common.settings.Settings settings, org.elasticsearch.threadpool.ThreadPool threadPool, org.elasticsearch.common.network.NetworkService networkService, org.elasticsearch.common.util.BigArrays bigArrays, org.elasticsearch.common.io.stream.NamedWriteableRegistry namedWriteableRegistry, org.elasticsearch.indices.breaker.CircuitBreakerService circuitBreakerService)
-
-
Method Detail
-
doStart
protected void doStart()
- Overrides:
doStartin classorg.elasticsearch.transport.TcpTransport
-
getServerChannelInitializer
protected io.netty.channel.ChannelHandler getServerChannelInitializer(java.lang.String name)
-
getClientChannelInitializer
protected io.netty.channel.ChannelHandler getClientChannelInitializer()
-
exceptionCaught
protected final void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception- Throws:
java.lang.Exception
-
initiateChannel
protected NettyTcpChannel initiateChannel(org.elasticsearch.cluster.node.DiscoveryNode node, org.elasticsearch.common.unit.TimeValue connectTimeout, org.elasticsearch.action.ActionListener<java.lang.Void> listener) throws java.io.IOException
- Specified by:
initiateChannelin classorg.elasticsearch.transport.TcpTransport- Throws:
java.io.IOException
-
bind
protected NettyTcpChannel bind(java.lang.String name, java.net.InetSocketAddress address)
- Specified by:
bindin classorg.elasticsearch.transport.TcpTransport
-
stopInternal
protected void stopInternal()
- Overrides:
stopInternalin classorg.elasticsearch.transport.TcpTransport
-
-