org.elasticsearch.cluster
Interface ClusterService

All Superinterfaces:
CloseableComponent, LifecycleComponent<ClusterService>
All Known Implementing Classes:
InternalClusterService

public interface ClusterService
extends LifecycleComponent<ClusterService>

The cluster service allowing to both register for cluster state events (ClusterStateListener) and submit state update tasks (ClusterStateUpdateTask.


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.
 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 interface org.elasticsearch.common.component.LifecycleComponent
addLifecycleListener, lifecycleState, removeLifecycleListener, start, stop
 
Methods inherited from interface org.elasticsearch.common.component.CloseableComponent
close
 

Method Detail

localNode

DiscoveryNode localNode()
The local node.


state

ClusterState state()
The current state.


addInitialStateBlock

void addInitialStateBlock(ClusterBlock block)
                          throws ElasticSearchIllegalStateException
Adds an initial block to be set on the first cluster state created.

Throws:
ElasticSearchIllegalStateException

operationRouting

OperationRouting operationRouting()
The operation routing.


addPriority

void addPriority(ClusterStateListener listener)
Adds a priority listener for updated cluster states.


add

void add(ClusterStateListener listener)
Adds a listener for updated cluster states.


remove

void remove(ClusterStateListener listener)
Removes a listener for updated cluster states.


add

void add(TimeValue timeout,
         TimeoutClusterStateListener listener)
Adds a cluster state listener that will timeout after the provided timeout.


submitStateUpdateTask

void submitStateUpdateTask(java.lang.String source,
                           ClusterStateUpdateTask updateTask)
Submits a task that will update the cluster state.