org.elasticsearch.transport.netty
Class NettyTransport

java.lang.Object
  extended by org.elasticsearch.common.component.AbstractComponent
      extended by org.elasticsearch.common.component.AbstractLifecycleComponent<Transport>
          extended by org.elasticsearch.transport.netty.NettyTransport
All Implemented Interfaces:
CloseableComponent, LifecycleComponent<Transport>, Transport

public class NettyTransport
extends AbstractLifecycleComponent<Transport>
implements Transport

There are 3 types of connections per node, low/med/high. 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 is for ping type requests (like FD).


Nested Class Summary
static class NettyTransport.CacheFutureListener
           
static class NettyTransport.NodeChannels
           
 
Field Summary
 
Fields inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
lifecycle
 
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
componentSettings, logger, settings
 
Constructor Summary
NettyTransport(Settings settings, ThreadPool threadPool)
           
NettyTransport(Settings settings, ThreadPool threadPool, NetworkService networkService)
           
NettyTransport(ThreadPool threadPool)
           
 
Method Summary
 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.
 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  void doClose()
           
protected  void doStart()
           
protected  void doStop()
           
 boolean nodeConnected(DiscoveryNode node)
          Returns true if the node is connected.
<T extends Streamable>
void
sendRequest(DiscoveryNode node, long requestId, String action, Streamable message, TransportRequestOptions options)
          Sends the request to the node.
 long serverOpen()
           
 Settings settings()
           
 void transportServiceAdapter(TransportServiceAdapter service)
           
 
Methods inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stop
 
Methods inherited from class org.elasticsearch.common.component.AbstractComponent
nodeName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.elasticsearch.common.component.LifecycleComponent
addLifecycleListener, lifecycleState, removeLifecycleListener, start, stop
 
Methods inherited from interface org.elasticsearch.common.component.CloseableComponent
close
 

Constructor Detail

NettyTransport

public NettyTransport(ThreadPool threadPool)

NettyTransport

public NettyTransport(Settings settings,
                      ThreadPool threadPool)

NettyTransport

@Inject
public NettyTransport(Settings settings,
                             ThreadPool threadPool,
                             NetworkService networkService)
Method Detail

settings

public Settings settings()

transportServiceAdapter

public void transportServiceAdapter(TransportServiceAdapter service)
Specified by:
transportServiceAdapter in interface Transport

doStart

protected void doStart()
                throws ElasticSearchException
Specified by:
doStart in class AbstractLifecycleComponent<Transport>
Throws:
ElasticSearchException

doStop

protected void doStop()
               throws ElasticSearchException
Specified by:
doStop in class AbstractLifecycleComponent<Transport>
Throws:
ElasticSearchException

doClose

protected void doClose()
                throws ElasticSearchException
Specified by:
doClose in class AbstractLifecycleComponent<Transport>
Throws:
ElasticSearchException

addressesFromString

public TransportAddress[] addressesFromString(String address)
                                       throws Exception
Description copied from interface: Transport
Returns an address from its string representation.

Specified by:
addressesFromString in interface Transport
Throws:
Exception

addressSupported

public boolean addressSupported(Class<? extends TransportAddress> address)
Description copied from interface: Transport
Is the address type supported.

Specified by:
addressSupported in interface Transport

boundAddress

public BoundTransportAddress boundAddress()
Description copied from interface: Transport
The address the transport is bound on.

Specified by:
boundAddress in interface Transport

serverOpen

public long serverOpen()
Specified by:
serverOpen in interface Transport

sendRequest

public <T extends Streamable> void sendRequest(DiscoveryNode node,
                                               long requestId,
                                               String action,
                                               Streamable message,
                                               TransportRequestOptions options)
                 throws IOException,
                        TransportException
Description copied from interface: Transport
Sends the request to the node.

Specified by:
sendRequest in interface Transport
Throws:
IOException
TransportException

nodeConnected

public boolean nodeConnected(DiscoveryNode node)
Description copied from interface: Transport
Returns true if the node is connected.

Specified by:
nodeConnected in interface Transport

connectToNodeLight

public void connectToNodeLight(DiscoveryNode node)
                        throws ConnectTransportException
Description copied from interface: Transport
Connects to a node in a light manner. Used when just connecting for ping and then disconnecting.

Specified by:
connectToNodeLight in interface Transport
Throws:
ConnectTransportException

connectToNode

public void connectToNode(DiscoveryNode node)
Description copied from interface: Transport
Connects to the given node, if already connected, does nothing.

Specified by:
connectToNode in interface Transport

connectToNode

public void connectToNode(DiscoveryNode node,
                          boolean light)

disconnectFromNode

public void disconnectFromNode(DiscoveryNode node)
Description copied from interface: Transport
Disconnected from the given node, if not connected, will do nothing.

Specified by:
disconnectFromNode in interface Transport


Copyright © 2009-2012. All Rights Reserved.