Package com.atlassian.confluence.cluster
Interface ClusterExecutionService
- All Known Subinterfaces:
ClusterManager
,ClusterManagerInternal
- All Known Implementing Classes:
HazelcastClusterManager
@Internal
public interface ClusterExecutionService
- Since:
- 9.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Default name of the executor service to use for executing tasks. -
Method Summary
Modifier and TypeMethodDescription<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
-
Field Details
-
DEFAULT_EXECUTOR_SVC_NAME
Default name of the executor service to use for executing tasks.- Since:
- 7.14
- See Also:
-
-
Method Details
-
submitToKeyOwner
Submit a task to be executed by a service given by its name on one node of the cluster that own a given key.- Parameters:
task
- task to be executed on the node that owns the provided key, it must beSerializable
serviceName
- name of service used to execute the taskkey
- key used to determined which node is going to execute the task, it must beSerializable
- Returns:
- CompletionStage
- Since:
- 6.5
-
submitToNode
<T> ClusterNodeExecution<T> submitToNode(@Nullable String nodeId, Callable<T> task, String serviceName) throws NoSuchClusterNodeException Submit a task to be executed on a node with the specified ID- Parameters:
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 task- Returns:
- node execution result
- Throws:
NoSuchClusterNodeException
- if there's no node in the cluster with the specified ID- Since:
- 7.18
-
submitToAllNodes
Submit a task to be executed on all nodes in the cluster.- Parameters:
task
- task to be executed on the node that owns the provided key, it must beSerializable
serviceName
- name of service used to execute the task- Returns:
- List of
ClusterNodeExecution
, one element from each node - Since:
- 7.14
-