public class

DefaultClusterManager

extends Object
implements ClusterManager Startable
java.lang.Object
   ↳ com.atlassian.jira.cluster.DefaultClusterManager

Class Overview

Manages the cluster - addition of nodes, removal, etc

Summary

[Expand]
Inherited Constants
From interface com.atlassian.jira.cluster.ClusterManager
Public Constructors
DefaultClusterManager(ClusterNodes clusterNodes, EventPublisher eventPublisher, ClusterLicenseCheck licenseCheck, MessageHandlerService messageHandlerService)
Public Methods
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.
@Nullable String getNodeId()
Provides the node ID for this particular cluster node.
boolean isActive()
Returns true if this node is active.
boolean isClusterLicensed()
Returns whether or not JIRA is licensed for clustered configurations.
boolean isClustered()
If there is a cluster.properties that appears to be valid
void refreshLiveNodes()
Merges the information from the heartbeat table and the clusternode table to give accurate information of which nodes are alive.
@EventListener void releaseNodeReindexService(IndexesRestoredEvent ev)
void requestCurrentIndexFromNode(String node)
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.cluster.ClusterInfo
From interface com.atlassian.jira.cluster.ClusterManager
From interface com.atlassian.jira.extension.Startable

Public Constructors

public DefaultClusterManager (ClusterNodes clusterNodes, EventPublisher eventPublisher, ClusterLicenseCheck licenseCheck, MessageHandlerService messageHandlerService)

Public Methods

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

public Collection<Node> findLiveNodes ()

Returns a snapshot of the live nodes. This collection is refreshed in every heartbeat of the server. Or you can force it calling refreshLiveNodes()

Returns
  • the list of nodes that are alive.

public Set<Node> getAllNodes ()

Returns all the nodes in the cluster. If not clustered this will return an empty set.

Returns
  • a collection of Nodes in a cluster

@Nullable public String getNodeId ()

Provides the node ID for this particular cluster node.

Returns
  • node id - null if the server is not in a cluster

public boolean isActive ()

Returns true if this node is active.

Returns
  • true if this node is active.

public boolean isClusterLicensed ()

Returns whether or not JIRA is licensed for clustered configurations.

Returns
  • whether or not JIRA is licensed for clustered configurations.

public boolean isClustered ()

If there is a cluster.properties that appears to be valid

Returns
  • true if clustered

public void refreshLiveNodes ()

Merges the information from the heartbeat table and the clusternode table to give accurate information of which nodes are alive.

@EventListener public void releaseNodeReindexService (IndexesRestoredEvent ev)

public void requestCurrentIndexFromNode (String node)

We send a message to the node we wish a copy from.

Parameters
node Node to send the message to get an Index Copy from.

public void start ()

This method will be called after the plugin system is fully initialised and all components added to the dependency injection framework.