public class DefaultClusterManager extends Object implements ClusterManager, Startable
ALL_NODES, ANY_NODE
Constructor and Description |
---|
DefaultClusterManager(ClusterNodes clusterNodes,
com.atlassian.event.api.EventPublisher eventPublisher,
ClusterLicenseCheck licenseCheck,
MessageHandlerService messageHandlerService,
NodeCutOffManager nodeCutOffManager) |
Modifier and Type | Method and Description |
---|---|
void |
checkIndex()
Forces an index check to see if it is current (or can be rebuilt from current) - if the index is too out of date
request an index replica, only do this on passive nodes for now
|
Collection<Node> |
findLiveNodes()
Returns a snapshot of the live nodes.
|
Set<Node> |
getAllNodes()
Returns all the nodes in the cluster.
|
String |
getNodeId()
Provides the node ID for this particular cluster node.
|
boolean |
isActive()
Returns
true if this node is active. |
boolean |
isClustered()
If there is a cluster.properties that appears to be valid
|
boolean |
isClusterLicensed()
Returns whether or not JIRA is licensed for clustered configurations.
|
boolean |
isNodeAlive(String nodeId) |
boolean |
isNodeOffline(String nodeId) |
boolean |
isNodePresent(String nodeId) |
void |
moveToOffline(String nodeId)
Update nodes's state to OFFLINE if current state is ACTIVE and nonalive
|
void |
refreshLiveNodes()
Merges the information from the heartbeat table and the clusternode table
to give accurate information of which nodes are alive.
|
void |
releaseNodeReindexService(IndexesRestoredEvent ev) |
void |
removeIfOffline(String nodeId)
Remove node from cluster if node is OFFLINE
|
void |
requestCurrentIndexFromNode(String destinationNode)
We send a message to the node we wish a copy from.
|
void |
start()
This method will be called after the plugin system is fully initialised and all components added to the
dependency injection framework.
|
public DefaultClusterManager(ClusterNodes clusterNodes, com.atlassian.event.api.EventPublisher eventPublisher, ClusterLicenseCheck licenseCheck, MessageHandlerService messageHandlerService, NodeCutOffManager nodeCutOffManager)
public void start()
Startable
@Nullable public String getNodeId()
ClusterInfo
getNodeId
in interface ClusterInfo
public boolean isClustered()
isClustered
in interface ClusterInfo
public Set<Node> getAllNodes()
ClusterManager
getAllNodes
in interface ClusterManager
Node
s in a clusterpublic boolean isActive()
true
if this node is active.isActive
in interface ClusterManager
true
if this node is active.public void checkIndex()
checkIndex
in interface ClusterManager
public void requestCurrentIndexFromNode(String destinationNode)
ClusterManager
requestCurrentIndexFromNode
in interface ClusterManager
destinationNode
- Node to send the message to get an Index Copy from.public Collection<Node> findLiveNodes()
ClusterManager
findLiveNodes
in interface ClusterManager
public void refreshLiveNodes()
ClusterManager
refreshLiveNodes
in interface ClusterManager
@EventListener public void releaseNodeReindexService(IndexesRestoredEvent ev)
public boolean isClusterLicensed()
ClusterManager
isClusterLicensed
in interface ClusterManager
public void removeIfOffline(@NotNull String nodeId) throws ClusterStateException
ClusterManager
removeIfOffline
in interface ClusterManager
ClusterStateException
- if node is not offlinepublic void moveToOffline(@NotNull String nodeId) throws ClusterStateException
ClusterManager
moveToOffline
in interface ClusterManager
ClusterStateException
- if node is alivepublic boolean isNodeAlive(@NotNull String nodeId)
isNodeAlive
in interface ClusterManager
public boolean isNodePresent(@NotNull String nodeId)
isNodePresent
in interface ClusterManager
public boolean isNodeOffline(@NotNull String nodeId)
isNodeOffline
in interface ClusterManager
Copyright © 2002-2019 Atlassian. All Rights Reserved.