public class InternalClusterService extends AbstractLifecycleComponent<ClusterService> implements ClusterService
Modifier and Type | Field and Description |
---|---|
static String |
UPDATE_THREAD_NAME |
lifecycle
componentSettings, 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.
|
protected void |
doClose() |
protected void |
doStart() |
protected void |
doStop() |
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 task that will update the cluster state (the task has a default priority of
Priority.NORMAL ). |
void |
submitStateUpdateTask(String source,
Priority priority,
ClusterStateUpdateTask updateTask)
Submits a task that will update the cluster state.
|
addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stop
nodeName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addLifecycleListener, lifecycleState, removeLifecycleListener, start, stop
close
public static final String UPDATE_THREAD_NAME
@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 ElasticsearchIllegalStateException
ClusterService
addInitialStateBlock
in interface ClusterService
ElasticsearchIllegalStateException
public void removeInitialStateBlock(ClusterBlock block) throws ElasticsearchIllegalStateException
ClusterService
removeInitialStateBlock
in interface ClusterService
ElasticsearchIllegalStateException
protected void doStart() throws ElasticsearchException
doStart
in class AbstractLifecycleComponent<ClusterService>
ElasticsearchException
protected void doStop() throws ElasticsearchException
doStop
in class AbstractLifecycleComponent<ClusterService>
ElasticsearchException
protected void doClose() throws ElasticsearchException
doClose
in class AbstractLifecycleComponent<ClusterService>
ElasticsearchException
public DiscoveryNode localNode()
ClusterService
localNode
in interface ClusterService
public OperationRouting operationRouting()
ClusterService
operationRouting
in interface ClusterService
public ClusterState state()
ClusterService
state
in interface ClusterService
public void addFirst(ClusterStateListener listener)
ClusterService
addFirst
in interface ClusterService
public void addLast(ClusterStateListener listener)
ClusterService
addLast
in interface ClusterService
public void add(ClusterStateListener listener)
ClusterService
add
in interface ClusterService
public void remove(ClusterStateListener listener)
ClusterService
remove
in interface ClusterService
public void add(LocalNodeMasterListener listener)
ClusterService
add
in interface ClusterService
public void remove(LocalNodeMasterListener listener)
ClusterService
remove
in interface ClusterService
public void add(TimeValue timeout, TimeoutClusterStateListener listener)
ClusterService
ClusterState.ClusterStateStatus.APPLIED
add
in interface ClusterService
public void submitStateUpdateTask(String source, ClusterStateUpdateTask updateTask)
ClusterService
Priority.NORMAL
).submitStateUpdateTask
in interface ClusterService
public void submitStateUpdateTask(String source, Priority priority, ClusterStateUpdateTask updateTask)
ClusterService
submitStateUpdateTask
in interface ClusterService
public List<PendingClusterTask> pendingTasks()
ClusterService
pendingTasks
in interface ClusterService
public int numberOfPendingTasks()
ClusterService
numberOfPendingTasks
in interface ClusterService
Copyright © 2009–2015. All rights reserved.