public class InternalClusterService extends AbstractLifecycleComponent<ClusterService> implements ClusterService
| Modifier and Type | Field and Description |
|---|---|
static String |
SETTING_CLUSTER_SERVICE_RECONNECT_INTERVAL |
static String |
SETTING_CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD |
static String |
UPDATE_THREAD_NAME |
Map<ClusterStateTaskExecutor,LinkedHashSet<org.elasticsearch.cluster.service.InternalClusterService.UpdateTask>> |
updateTasksPerExecutor |
lifecycledeprecationLogger, logger, settings| Constructor and Description |
|---|
InternalClusterService(Settings settings,
DiscoveryService discoveryService,
OperationRouting operationRouting,
TransportService transportService,
NodeSettingsService nodeSettingsService,
ThreadPool threadPool,
ClusterName clusterName,
DiscoveryNodeService discoveryNodeService,
Version version) |
| 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.
|
boolean |
assertClusterStateThread()
asserts that the current thread is the cluster state update thread
|
protected void |
doClose() |
protected void |
doStart() |
protected void |
doStop() |
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.
|
NodeSettingsService |
settingsService() |
ClusterState |
state()
The current state.
|
void |
submitStateUpdateTask(String source,
ClusterStateUpdateTask updateTask)
Submits a cluster state update task; unlike
ClusterService.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, close, lifecycleState, removeLifecycleListener, start, stoplogDeprecatedSetting, logRemovedSetting, nodeNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddLifecycleListener, lifecycleState, removeLifecycleListener, start, stopclosepublic static final String SETTING_CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD
public static final String SETTING_CLUSTER_SERVICE_RECONNECT_INTERVAL
public static final String UPDATE_THREAD_NAME
public final Map<ClusterStateTaskExecutor,LinkedHashSet<org.elasticsearch.cluster.service.InternalClusterService.UpdateTask>> updateTasksPerExecutor
@Inject public InternalClusterService(Settings settings, DiscoveryService discoveryService, OperationRouting operationRouting, TransportService transportService, NodeSettingsService nodeSettingsService, ThreadPool threadPool, ClusterName clusterName, DiscoveryNodeService discoveryNodeService, Version version)
public NodeSettingsService settingsService()
public void addInitialStateBlock(ClusterBlock block) throws IllegalStateException
ClusterServiceaddInitialStateBlock in interface ClusterServiceIllegalStateExceptionpublic void removeInitialStateBlock(ClusterBlock block) throws IllegalStateException
ClusterServiceremoveInitialStateBlock in interface ClusterServiceIllegalStateExceptionprotected void doStart()
doStart in class AbstractLifecycleComponent<ClusterService>protected void doStop()
doStop in class AbstractLifecycleComponent<ClusterService>protected void doClose()
doClose in class AbstractLifecycleComponent<ClusterService>public DiscoveryNode localNode()
ClusterServicelocalNode in interface ClusterServicepublic OperationRouting operationRouting()
ClusterServiceoperationRouting in interface ClusterServicepublic ClusterState state()
ClusterServicestate in interface ClusterServicepublic void addFirst(ClusterStateListener listener)
ClusterServiceaddFirst in interface ClusterServicepublic void addLast(ClusterStateListener listener)
ClusterServiceaddLast in interface ClusterServicepublic void add(ClusterStateListener listener)
ClusterServiceadd in interface ClusterServicepublic void remove(ClusterStateListener listener)
ClusterServiceremove in interface ClusterServicepublic void add(LocalNodeMasterListener listener)
ClusterServiceadd in interface ClusterServicepublic void remove(LocalNodeMasterListener listener)
ClusterServiceremove in interface ClusterServicepublic void add(@Nullable TimeValue timeout, TimeoutClusterStateListener listener)
ClusterServiceClusterState.ClusterStateStatus.APPLIED
NOTE: a null timeout means that the listener will never be removed
automaticallyadd in interface ClusterServicepublic void submitStateUpdateTask(String source, ClusterStateUpdateTask updateTask)
ClusterServiceClusterService.submitStateUpdateTask(String, Object, ClusterStateTaskConfig, ClusterStateTaskExecutor, ClusterStateTaskListener),
submitted updates will not be batched.submitStateUpdateTask in interface ClusterServicesource - the source of the cluster state update taskupdateTask - the full context for the cluster state update
taskpublic <T> void submitStateUpdateTask(String source, T task, ClusterStateTaskConfig config, ClusterStateTaskExecutor<T> executor, ClusterStateTaskListener listener)
ClusterServicesubmitStateUpdateTask in interface ClusterServiceT - 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
completespublic List<PendingClusterTask> pendingTasks()
ClusterServicependingTasks in interface ClusterServicepublic int numberOfPendingTasks()
ClusterServicenumberOfPendingTasks in interface ClusterServicepublic TimeValue getMaxTaskWaitTime()
ClusterServicegetMaxTaskWaitTime in interface ClusterServicepublic TaskManager getTaskManager()
ClusterServicegetTaskManager in interface ClusterServicepublic boolean assertClusterStateThread()
Copyright © 2009–2016. All rights reserved.