com.atlassian.jira.cluster.lock
Class NullJiraClusterNodeHeartBeatDao

java.lang.Object
  extended by com.atlassian.jira.cluster.lock.NullJiraClusterNodeHeartBeatDao
All Implemented Interfaces:
com.atlassian.beehive.spi.ClusterNodeHeartBeatDao, TimedClusterNodeHeartBeatDao

public class NullJiraClusterNodeHeartBeatDao
extends Object
implements TimedClusterNodeHeartBeatDao

Created this class to avoid problems of dependencies in non-clustered environments


Constructor Summary
NullJiraClusterNodeHeartBeatDao()
           
 
Method Summary
 Collection<String> findNodesWithHeartbeatsAfter(long time)
           
 Map<String,Long> getActiveNodesDatabaseTimeOffsets(long databaseActiveTime)
          Returns each active cluster node's clock offset from the database clock.
 Long getLastHeartbeatTime(String nodeId)
           
 String getNodeId()
           
 void writeHeartBeat(long time)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullJiraClusterNodeHeartBeatDao

public NullJiraClusterNodeHeartBeatDao()
Method Detail

getNodeId

@Nonnull
public String getNodeId()
Specified by:
getNodeId in interface com.atlassian.beehive.spi.ClusterNodeHeartBeatDao

writeHeartBeat

public void writeHeartBeat(long time)

getLastHeartbeatTime

@Nullable
public Long getLastHeartbeatTime(@Nonnull
                                          String nodeId)

findNodesWithHeartbeatsAfter

@Nonnull
public Collection<String> findNodesWithHeartbeatsAfter(long time)

getActiveNodesDatabaseTimeOffsets

@Nonnull
public Map<String,Long> getActiveNodesDatabaseTimeOffsets(long databaseActiveTime)
Description copied from interface: TimedClusterNodeHeartBeatDao
Returns each active cluster node's clock offset from the database clock.

The returned map maps node IDs to their clock offset times in milliseconds. A clock offset time is the number of milliseconds difference between that node's system clock and the clock of the database. These values can be used to determine how synchronized the node's clocks are.

It is possible that a node's time offset value is returned as null if they have not registered a heartbeat yet after they have started up or if they are upgrading their version and have not written a database time value in the database yet.

Specified by:
getActiveNodesDatabaseTimeOffsets in interface TimedClusterNodeHeartBeatDao
Parameters:
databaseActiveTime - the minimum database time a node should have in the system to regard it as active. Nodes that registered their heartbeat with an associated database time less than this value will not be returned.
Returns:
a map mapping node IDs to offset times in milliseconds.


Copyright © 2002-2014 Atlassian. All Rights Reserved.