com.atlassian.jira.cluster
Class DefaultClusterManager

java.lang.Object
  extended by com.atlassian.jira.cluster.DefaultClusterManager
All Implemented Interfaces:
ClusterManager, Startable

public class DefaultClusterManager
extends Object
implements ClusterManager, Startable

Manages the cluster - addition of nodes, removal, etc

Since:
v6.1

Field Summary
 
Fields inherited from interface com.atlassian.jira.cluster.ClusterManager
ALL_NODES, ANY_NODE
 
Constructor Summary
DefaultClusterManager(ClusterServicesRegistry clusterServicesRegistry, NodeStateManager nodeStateManager, com.atlassian.event.api.EventPublisher eventPublisher)
           
 
Method Summary
 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()
           
 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.
 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 requestCurrentIndexFromNode(String node)
          We send a message to the node we wish a copy from.
 void start()
          This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultClusterManager

public DefaultClusterManager(ClusterServicesRegistry clusterServicesRegistry,
                             NodeStateManager nodeStateManager,
                             com.atlassian.event.api.EventPublisher eventPublisher)
Method Detail

start

public void start()
Description copied from interface: Startable
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.

Specified by:
start in interface Startable

getNodeId

@Nullable
public String getNodeId()
Specified by:
getNodeId in interface ClusterManager
Returns:
node id - null if the server is not in a cluster

isClustered

public boolean isClustered()
If there is a cluster.properties that appears to be valid

Specified by:
isClustered in interface ClusterManager
Returns:
true if clustered

getAllNodes

public Set<Node> getAllNodes()
Description copied from interface: ClusterManager
Returns all the nodes in the cluster. If not clustered this will return an empty set.

Specified by:
getAllNodes in interface ClusterManager
Returns:
a collection of Nodes in a cluster

isActive

public boolean isActive()
Returns true if this node is active.

Specified by:
isActive in interface ClusterManager
Returns:
true if this node is active.

checkIndex

public 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

Specified by:
checkIndex in interface ClusterManager

requestCurrentIndexFromNode

public void requestCurrentIndexFromNode(String node)
Description copied from interface: ClusterManager
We send a message to the node we wish a copy from.

Specified by:
requestCurrentIndexFromNode in interface ClusterManager
Parameters:
node - Node to send the message to get an Index Copy from.

findLiveNodes

public Collection<Node> findLiveNodes()
Description copied from interface: ClusterManager
Returns a snapshot of the live nodes. This collection is refreshed in every heartbeat of the server. Or you can force it calling refreshLiveNodes()

Specified by:
findLiveNodes in interface ClusterManager
Returns:
the list of nodes that are alive.

refreshLiveNodes

public void refreshLiveNodes()
Description copied from interface: ClusterManager
Merges the information from the heartbeat table and the clusternode table to give accurate information of which nodes are alive.

Specified by:
refreshLiveNodes in interface ClusterManager

releaseNodeReindexService

@EventListener
public void releaseNodeReindexService(IndexesRestoredEvent ev)

isClusterLicensed

public boolean isClusterLicensed()
Description copied from interface: ClusterManager
Returns whether or not JIRA is licensed for clustered configurations.

Specified by:
isClusterLicensed in interface ClusterManager
Returns:
whether or not JIRA is licensed for clustered configurations.


Copyright © 2002-2014 Atlassian. All Rights Reserved.