public interface ClusterService extends LifecycleComponent<ClusterService>
ClusterStateListener
)
and submit state update tasks (ClusterStateUpdateTask
.Modifier and Type | Method and Description |
---|---|
void |
add(ClusterStateListener listener)
Adds a listener for updated cluster states.
|
void |
add(LocalNodeMasterListener listener)
Add a listener for on/off local node master events
|
void |
add(TimeValue timeout,
TimeoutClusterStateListener listener)
Adds a cluster state listener that will timeout after the provided timeout,
and is executed after the clusterstate has been successfully applied ie.
|
void |
addFirst(ClusterStateListener listener)
Adds a priority listener for updated cluster states.
|
void |
addInitialStateBlock(ClusterBlock block)
Adds an initial block to be set on the first cluster state created.
|
void |
addLast(ClusterStateListener listener)
Adds last listener.
|
TimeValue |
getMaxTaskWaitTime()
Returns the maximum wait time for tasks in the queue
|
TaskManager |
getTaskManager()
Returns task manager created in the cluster service
|
DiscoveryNode |
localNode()
The local node.
|
int |
numberOfPendingTasks()
Returns the number of currently pending tasks.
|
OperationRouting |
operationRouting()
The operation routing.
|
List<PendingClusterTask> |
pendingTasks()
Returns the tasks that are pending.
|
void |
remove(ClusterStateListener listener)
Removes a listener for updated cluster states.
|
void |
remove(LocalNodeMasterListener listener)
Remove the given listener for on/off local master events
|
void |
removeInitialStateBlock(ClusterBlock block)
Remove an initial block to be set on the first cluster state created.
|
ClusterState |
state()
The current state.
|
void |
submitStateUpdateTask(String source,
ClusterStateUpdateTask updateTask)
Submits a cluster state update task; unlike
submitStateUpdateTask(String, Object, ClusterStateTaskConfig, ClusterStateTaskExecutor, ClusterStateTaskListener) ,
submitted updates will not be batched. |
<T> void |
submitStateUpdateTask(String source,
T task,
ClusterStateTaskConfig config,
ClusterStateTaskExecutor<T> executor,
ClusterStateTaskListener listener)
Submits a cluster state update task; submitted updates will be
batched across the same instance of executor.
|
addLifecycleListener, lifecycleState, removeLifecycleListener, start, stop
close
DiscoveryNode localNode()
ClusterState state()
void addInitialStateBlock(ClusterBlock block) throws IllegalStateException
IllegalStateException
void removeInitialStateBlock(ClusterBlock block) throws IllegalStateException
IllegalStateException
OperationRouting operationRouting()
void addFirst(ClusterStateListener listener)
void addLast(ClusterStateListener listener)
void add(ClusterStateListener listener)
void remove(ClusterStateListener listener)
void add(LocalNodeMasterListener listener)
void remove(LocalNodeMasterListener listener)
void add(@Nullable TimeValue timeout, TimeoutClusterStateListener listener)
ClusterState.ClusterStateStatus.APPLIED
NOTE: a null
timeout means that the listener will never be removed
automatically<T> void submitStateUpdateTask(String source, T task, ClusterStateTaskConfig config, ClusterStateTaskExecutor<T> executor, ClusterStateTaskListener listener)
T
- the type of the cluster state update task statesource
- the source of the cluster state update tasktask
- the state needed for the cluster state update taskconfig
- the cluster state update task configurationexecutor
- the cluster state update task executor; tasks
that share the same executor will be executed
batches on this executorlistener
- callback after the cluster state update task
completesvoid submitStateUpdateTask(String source, ClusterStateUpdateTask updateTask)
submitStateUpdateTask(String, Object, ClusterStateTaskConfig, ClusterStateTaskExecutor, ClusterStateTaskListener)
,
submitted updates will not be batched.source
- the source of the cluster state update taskupdateTask
- the full context for the cluster state update
taskList<PendingClusterTask> pendingTasks()
int numberOfPendingTasks()
TimeValue getMaxTaskWaitTime()
TaskManager getTaskManager()
Copyright © 2009–2016. All rights reserved.