org.elasticsearch.cluster.service
Class InternalClusterService

java.lang.Object
  extended by org.elasticsearch.common.component.AbstractComponent
      extended by org.elasticsearch.common.component.AbstractLifecycleComponent<ClusterService>
          extended by org.elasticsearch.cluster.service.InternalClusterService
All Implemented Interfaces:
ClusterService, CloseableComponent, LifecycleComponent<ClusterService>

public class InternalClusterService
extends AbstractLifecycleComponent<ClusterService>
implements ClusterService


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
InternalClusterService(Settings settings, DiscoveryService discoveryService, OperationRouting operationRouting, TransportService transportService, ThreadPool threadPool)
           
 
Method Summary
 void add(ClusterStateListener listener)
          Adds a listener for updated cluster states.
 void add(TimeValue timeout, TimeoutClusterStateListener listener)
          Adds a cluster state listener that will timeout after the provided timeout.
 void addInitialStateBlock(ClusterBlock block)
          Adds an initial block to be set on the first cluster state created.
 void addPriority(ClusterStateListener listener)
          Adds a priority listener for updated cluster states.
protected  void doClose()
           
protected  void doStart()
           
protected  void doStop()
           
 DiscoveryNode localNode()
          The local node.
 OperationRouting operationRouting()
          The operation routing.
 void remove(ClusterStateListener listener)
          Removes a listener for updated cluster states.
 ClusterState state()
          The current state.
 void submitStateUpdateTask(java.lang.String source, ClusterStateUpdateTask updateTask)
          Submits a task that will update the cluster state.
 
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

InternalClusterService

@Inject
public InternalClusterService(Settings settings,
                                     DiscoveryService discoveryService,
                                     OperationRouting operationRouting,
                                     TransportService transportService,
                                     ThreadPool threadPool)
Method Detail

addInitialStateBlock

public void addInitialStateBlock(ClusterBlock block)
                          throws ElasticSearchIllegalStateException
Description copied from interface: ClusterService
Adds an initial block to be set on the first cluster state created.

Specified by:
addInitialStateBlock in interface ClusterService
Throws:
ElasticSearchIllegalStateException

doStart

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

doStop

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

doClose

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

localNode

public DiscoveryNode localNode()
Description copied from interface: ClusterService
The local node.

Specified by:
localNode in interface ClusterService

operationRouting

public OperationRouting operationRouting()
Description copied from interface: ClusterService
The operation routing.

Specified by:
operationRouting in interface ClusterService

state

public ClusterState state()
Description copied from interface: ClusterService
The current state.

Specified by:
state in interface ClusterService

addPriority

public void addPriority(ClusterStateListener listener)
Description copied from interface: ClusterService
Adds a priority listener for updated cluster states.

Specified by:
addPriority in interface ClusterService

add

public void add(ClusterStateListener listener)
Description copied from interface: ClusterService
Adds a listener for updated cluster states.

Specified by:
add in interface ClusterService

remove

public void remove(ClusterStateListener listener)
Description copied from interface: ClusterService
Removes a listener for updated cluster states.

Specified by:
remove in interface ClusterService

add

public void add(TimeValue timeout,
                TimeoutClusterStateListener listener)
Description copied from interface: ClusterService
Adds a cluster state listener that will timeout after the provided timeout.

Specified by:
add in interface ClusterService

submitStateUpdateTask

public void submitStateUpdateTask(java.lang.String source,
                                  ClusterStateUpdateTask updateTask)
Description copied from interface: ClusterService
Submits a task that will update the cluster state.

Specified by:
submitStateUpdateTask in interface ClusterService