public interface ClusterManager extends NameResolver, LockFactory
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_EXECUTOR_SVC_NAME
Default name of the executor service to use for executing tasks.
|
Modifier and Type | Method and Description |
---|---|
void |
configure(ClusterConfig config)
Set a new cluster configuration.
|
Collection<ClusterNodeInformation> |
getAllNodesInformation() |
ClusteredLock |
getClusteredLock(String key)
Deprecated.
since 5.6 Use
ClusterLockService.getLockForName(String) instead. |
ClusterInformation |
getClusterInformation()
Get information about the running cluster.
|
ClusterInvariants |
getClusterInvariants()
Get all attributes of the server that must be consistent between the nodes of a stable cluster.
|
ClusterMembershipCriteria |
getClusterMembershipCriteria()
Deprecated.
since 7.13. Use
getClusterInvariants() instead. |
long |
getClusterUptime()
Gets the amount of time that the cluster has been running.
|
<T> com.atlassian.core.task.FifoBuffer<T> |
getFifoBuffer(String name)
Get a distributed FIFO buffer
|
Map<Integer,NodeStatus> |
getNodeStatuses()
Deprecated.
since 5.5 Use
getNodeStatusMap() |
Map<ClusterNodeInformation,NodeStatus> |
getNodeStatusMap()
Gets status information from all members of the cluster.
|
Map<ClusterNodeInformation,CompletionStage<NodeStatus>> |
getNodeStatusMapAsync()
Gets
CompletionStage of status information from all members of the cluster. |
@Nullable ClusterNodeInformation |
getThisNodeInformation()
Get the identity of this node in the cluster.
|
boolean |
isClustered() |
boolean |
isClusterSupported()
Check whether this Confluence distribution is capable of running in a cluster.
|
boolean |
isConfigured() |
void |
publishEvent(ConfluenceEvent event)
Publish an event as a ClusterEventWrapper to other nodes
|
void |
publishEventImmediately(ConfluenceEvent event)
Publish immediately, an event as a ClusterEventWrapper to other nodes
|
void |
reconfigure(ClusterConfig config)
Set a new cluster configuration and cycle the service
|
void |
startCluster()
Start the clustering service
|
void |
stopCluster()
Stop the clustering service
|
<T> List<ClusterNodeExecution<T>> |
submitToAllNodes(Callable<T> task,
String serviceName)
Submit a task to be executed on all nodes in the cluster.
|
<T> CompletionStage<T> |
submitToKeyOwner(Callable<T> task,
String serviceName,
Object key)
Submit a task to be executed by a service given by its name on one node of the cluster that own a given key.
|
<T> ClusterNodeExecution<T> |
submitToNode(@Nullable String nodeId,
Callable<T> task,
String serviceName)
Submit a task to be executed on a node with the specified ID
|
resolveName
getLock
static final String DEFAULT_EXECUTOR_SVC_NAME
boolean isClusterSupported()
isClustered()
in that it will return true if the code to support clustering is present,
even if this instance does not have a clustered license or a current clustering configuration.@EnsuresNonNullIf(expression="getThisNodesInformation()", result=true) boolean isClustered()
ClusterInformation getClusterInformation()
@Deprecated ClusteredLock getClusteredLock(String key)
ClusterLockService.getLockForName(String)
instead.Lock.tryLock()
or Lock.lock()
on the returned object to
acquire the lock.<T> com.atlassian.core.task.FifoBuffer<T> getFifoBuffer(String name)
void publishEvent(ConfluenceEvent event)
This waits for any current transaction to be committed successfully before scheduling the event for publishing.
void publishEventImmediately(ConfluenceEvent event)
This is done immediately regardless of the state of any current transactions.
@Nullable ClusterNodeInformation getThisNodeInformation()
Get the identity of this node in the cluster. ClusterNodeInformation implements equals().
Collection<ClusterNodeInformation> getAllNodesInformation()
void configure(ClusterConfig config)
config
- boolean isConfigured()
configure(ClusterConfig)
has been called with a
valid configuration, otherwise false.void reconfigure(ClusterConfig config)
config
- void stopCluster()
void startCluster()
@Deprecated Map<Integer,NodeStatus> getNodeStatuses()
getNodeStatusMap()
Map<ClusterNodeInformation,NodeStatus> getNodeStatusMap()
Map<ClusterNodeInformation,CompletionStage<NodeStatus>> getNodeStatusMapAsync()
CompletionStage
of status information from all members of the cluster.@Deprecated ClusterMembershipCriteria getClusterMembershipCriteria() throws ClusterException
getClusterInvariants()
instead.ClusterException
- if the criteria cannot be gathered for some reasonClusterInvariants getClusterInvariants() throws ClusterException
ClusterException
- if the invariants can not be gathered for some reason<T> CompletionStage<T> submitToKeyOwner(Callable<T> task, String serviceName, Object key)
task
- task to be executed on the node that owns the provided key, it must be Serializable
serviceName
- name of service used to execute the taskkey
- key used to determined which node is going to execute the task, it must be Serializable
<T> ClusterNodeExecution<T> submitToNode(@Nullable String nodeId, Callable<T> task, String serviceName) throws NoSuchClusterNodeException
nodeId
- ID of the node that should execute the task. If null, task will be executed locally.task
- task to be executed on the specified nodeserviceName
- name of service used to execute the taskNoSuchClusterNodeException
- if there's no node in the cluster with the specified ID<T> List<ClusterNodeExecution<T>> submitToAllNodes(Callable<T> task, String serviceName)
task
- task to be executed on the node that owns the provided key, it must be Serializable
serviceName
- name of service used to execute the taskClusterNodeExecution
, one element from each nodelong getClusterUptime()
Copyright © 2003–2023 Atlassian. All rights reserved.
View cookie preferences