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.TransportSettingslifecycledeprecationLogger, 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, stoplogDeprecatedSetting, logRemovedSetting, nodeNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddLifecycleListener, lifecycleState, removeLifecycleListener, start, stopclosepublic 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 Transportprotected void doStart()
doStart in class AbstractLifecycleComponent<Transport>public Map<String,BoundTransportAddress> profileBoundAddresses()
TransportprofileBoundAddresses in interface Transportprotected void doStop()
doStop in class AbstractLifecycleComponent<Transport>protected void doClose()
doClose in class AbstractLifecycleComponent<Transport>public TransportAddress[] addressesFromString(String address, int perAddressLimit) throws Exception
TransportaddressesFromString in interface TransportExceptionpublic boolean addressSupported(Class<? extends TransportAddress> address)
TransportaddressSupported in interface Transportpublic BoundTransportAddress boundAddress()
TransportboundAddress in interface Transportprotected void exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ExceptionEvent e)
throws Exception
Exceptionpublic long serverOpen()
TransportserverOpen in interface Transportpublic List<String> getLocalAddresses()
getLocalAddresses in interface Transportpublic void sendRequest(DiscoveryNode node, long requestId, String action, TransportRequest request, TransportRequestOptions options) throws IOException, TransportException
TransportsendRequest in interface TransportIOExceptionTransportExceptionpublic boolean nodeConnected(DiscoveryNode node)
TransportnodeConnected in interface Transportpublic void connectToNodeLight(DiscoveryNode node) throws ConnectTransportException
TransportconnectToNodeLight in interface TransportConnectTransportExceptionpublic void connectToNode(DiscoveryNode node)
TransportconnectToNode in interface Transportpublic 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)
TransportdisconnectFromNode in interface Transportprotected 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
ConnectTransportExceptionpublic org.jboss.netty.channel.ChannelPipelineFactory configureClientChannelPipelineFactory()
Copyright © 2009–2017. All rights reserved.