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
deprecationLogger, logger, settings
Constructor and Description |
---|
NettyTransport(Settings settings,
ThreadPool threadPool,
NetworkService networkService,
BigArrays bigArrays,
Version version,
NamedWriteableRegistry namedWriteableRegistry,
CircuitBreakerService circuitBreakerService) |
Modifier and Type | Method and Description |
---|---|
TransportAddress[] |
addressesFromString(String address,
int perAddressLimit)
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 void |
exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ExceptionEvent e) |
List<String> |
getLocalAddresses() |
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
logDeprecatedSetting, logRemovedSetting, 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 PING_SCHEDULE
public static final TimeValue DEFAULT_PING_SCHEDULE
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 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 ConcurrentMap<String,BoundTransportAddress> profileBoundAddresses
protected volatile TransportServiceAdapter transportServiceAdapter
protected volatile BoundTransportAddress boundAddress
protected final NamedWriteableRegistry namedWriteableRegistry
@Inject public NettyTransport(Settings settings, ThreadPool threadPool, NetworkService networkService, BigArrays bigArrays, Version version, NamedWriteableRegistry namedWriteableRegistry, CircuitBreakerService circuitBreakerService)
public Settings settings()
public void transportServiceAdapter(TransportServiceAdapter service)
transportServiceAdapter
in interface Transport
protected void doStart()
doStart
in class AbstractLifecycleComponent<Transport>
public Map<String,BoundTransportAddress> profileBoundAddresses()
Transport
profileBoundAddresses
in interface Transport
protected void doStop()
doStop
in class AbstractLifecycleComponent<Transport>
protected void doClose()
doClose
in class AbstractLifecycleComponent<Transport>
public TransportAddress[] addressesFromString(String address, int perAddressLimit) 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
protected void exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ExceptionEvent e) throws Exception
Exception
public long serverOpen()
Transport
serverOpen
in interface Transport
public List<String> getLocalAddresses()
getLocalAddresses
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–2016. All rights reserved.