public class NettyTransport extends AbstractLifecycleComponent<Transport> implements Transport
Modifier and Type | Class and Description |
---|---|
protected class |
NettyTransport.ChannelCloseListener |
protected static class |
NettyTransport.ClientChannelPipelineFactory |
static class |
NettyTransport.NodeChannels |
protected static class |
NettyTransport.ServerChannelPipelineFactory |
Transport.TransportSettings
lifecycle
componentSettings, logger, settings
Constructor and Description |
---|
NettyTransport(Settings settings,
ThreadPool threadPool,
NetworkService networkService,
BigArrays bigArrays,
Version version) |
Modifier and Type | Method and Description |
---|---|
TransportAddress[] |
addressesFromString(String address)
Returns an address from its string representation.
|
boolean |
addressSupported(Class<? extends TransportAddress> address)
Is the address type supported.
|
BoundTransportAddress |
boundAddress()
The address the transport is bound on.
|
org.jboss.netty.channel.ChannelPipelineFactory |
configureClientChannelPipelineFactory() |
org.jboss.netty.channel.ChannelPipelineFactory |
configureServerChannelPipelineFactory(String name,
Settings settings) |
protected void |
connectToChannels(NettyTransport.NodeChannels nodeChannels,
DiscoveryNode node) |
protected NettyTransport.NodeChannels |
connectToChannelsLight(DiscoveryNode node) |
void |
connectToNode(DiscoveryNode node)
Connects to the given node, if already connected, does nothing.
|
void |
connectToNode(DiscoveryNode node,
boolean light) |
void |
connectToNodeLight(DiscoveryNode node)
Connects to a node in a light manner.
|
void |
disconnectFromNode(DiscoveryNode node)
Disconnected from the given node, if not connected, will do nothing.
|
protected boolean |
disconnectFromNode(DiscoveryNode node,
org.jboss.netty.channel.Channel channel,
String reason)
Disconnects from a node, only if the relevant channel is found to be part of the node channels.
|
protected void |
disconnectFromNodeChannel(org.jboss.netty.channel.Channel channel,
Throwable failure)
Disconnects from a node if a channel is found as part of that nodes channels.
|
protected void |
doClose() |
protected void |
doStart() |
protected void |
doStop() |
protected org.jboss.netty.channel.Channel |
nodeChannel(DiscoveryNode node,
TransportRequestOptions options) |
boolean |
nodeConnected(DiscoveryNode node)
Returns true if the node is connected.
|
Map<String,BoundTransportAddress> |
profileBoundAddresses()
Further profile bound addresses
|
void |
sendRequest(DiscoveryNode node,
long requestId,
String action,
TransportRequest request,
TransportRequestOptions options)
Sends the request to the node.
|
long |
serverOpen()
Returns count of currently open connections
|
Settings |
settings() |
void |
transportServiceAdapter(TransportServiceAdapter service) |
addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stop
nodeName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addLifecycleListener, lifecycleState, removeLifecycleListener, start, stop
close
public static final String HTTP_SERVER_WORKER_THREAD_NAME_PREFIX
public static final String HTTP_SERVER_BOSS_THREAD_NAME_PREFIX
public static final String TRANSPORT_CLIENT_WORKER_THREAD_NAME_PREFIX
public static final String TRANSPORT_CLIENT_BOSS_THREAD_NAME_PREFIX
public static final String WORKER_COUNT
public static final String CONNECTIONS_PER_NODE_RECOVERY
public static final String CONNECTIONS_PER_NODE_BULK
public static final String CONNECTIONS_PER_NODE_REG
public static final String CONNECTIONS_PER_NODE_STATE
public static final String CONNECTIONS_PER_NODE_PING
public static final String DEFAULT_PORT_RANGE
public static final String DEFAULT_PROFILE
protected final NetworkService networkService
protected final Version version
protected final boolean blockingClient
protected final TimeValue connectTimeout
protected final ByteSizeValue maxCumulationBufferCapacity
protected final int maxCompositeBufferComponents
protected final boolean compress
protected final org.jboss.netty.channel.ReceiveBufferSizePredictorFactory receiveBufferSizePredictorFactory
protected final int workerCount
protected final ByteSizeValue receivePredictorMin
protected final ByteSizeValue receivePredictorMax
protected final int connectionsPerNodeRecovery
protected final int connectionsPerNodeBulk
protected final int connectionsPerNodeReg
protected final int connectionsPerNodeState
protected final int connectionsPerNodePing
protected final BigArrays bigArrays
protected final ThreadPool threadPool
protected volatile OpenChannelsHandler serverOpenChannels
protected volatile org.jboss.netty.bootstrap.ClientBootstrap clientBootstrap
protected final ConcurrentMap<DiscoveryNode,NettyTransport.NodeChannels> connectedNodes
protected final Map<String,org.jboss.netty.bootstrap.ServerBootstrap> serverBootstraps
protected final Map<String,BoundTransportAddress> profileBoundAddresses
protected volatile TransportServiceAdapter transportServiceAdapter
protected volatile BoundTransportAddress boundAddress
@Inject public NettyTransport(Settings settings, ThreadPool threadPool, NetworkService networkService, BigArrays bigArrays, Version version)
public Settings settings()
public void transportServiceAdapter(TransportServiceAdapter service)
transportServiceAdapter
in interface Transport
protected void doStart() throws ElasticsearchException
doStart
in class AbstractLifecycleComponent<Transport>
ElasticsearchException
public Map<String,BoundTransportAddress> profileBoundAddresses()
Transport
profileBoundAddresses
in interface Transport
protected void doStop() throws ElasticsearchException
doStop
in class AbstractLifecycleComponent<Transport>
ElasticsearchException
protected void doClose() throws ElasticsearchException
doClose
in class AbstractLifecycleComponent<Transport>
ElasticsearchException
public TransportAddress[] addressesFromString(String address) throws Exception
Transport
addressesFromString
in interface Transport
Exception
public boolean addressSupported(Class<? extends TransportAddress> address)
Transport
addressSupported
in interface Transport
public BoundTransportAddress boundAddress()
Transport
boundAddress
in interface Transport
public long serverOpen()
Transport
serverOpen
in interface Transport
public void sendRequest(DiscoveryNode node, long requestId, String action, TransportRequest request, TransportRequestOptions options) throws IOException, TransportException
Transport
sendRequest
in interface Transport
IOException
TransportException
public boolean nodeConnected(DiscoveryNode node)
Transport
nodeConnected
in interface Transport
public void connectToNodeLight(DiscoveryNode node) throws ConnectTransportException
Transport
connectToNodeLight
in interface Transport
ConnectTransportException
public void connectToNode(DiscoveryNode node)
Transport
connectToNode
in interface Transport
public void connectToNode(DiscoveryNode node, boolean light)
protected NettyTransport.NodeChannels connectToChannelsLight(DiscoveryNode node)
protected void connectToChannels(NettyTransport.NodeChannels nodeChannels, DiscoveryNode node)
public void disconnectFromNode(DiscoveryNode node)
Transport
disconnectFromNode
in interface Transport
protected boolean disconnectFromNode(DiscoveryNode node, org.jboss.netty.channel.Channel channel, String reason)
protected void disconnectFromNodeChannel(org.jboss.netty.channel.Channel channel, Throwable failure)
protected org.jboss.netty.channel.Channel nodeChannel(DiscoveryNode node, TransportRequestOptions options) throws ConnectTransportException
ConnectTransportException
public org.jboss.netty.channel.ChannelPipelineFactory configureClientChannelPipelineFactory()
Copyright © 2009–2015. All rights reserved.