public class NullJiraClusterNodeHeartBeatDao extends Object implements TimedClusterNodeHeartBeatDao
Constructor and Description |
---|
NullJiraClusterNodeHeartBeatDao() |
Modifier and Type | Method and Description |
---|---|
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)
Returns the last time a heartbeat was sent by the given node.
|
String |
getNodeId()
Returns the globally unique Identifier for this cluster node.
|
void |
writeHeartBeat(long time)
Writes a heartbeat for this node at the given time.
|
@Nonnull public String getNodeId()
ClusterNodeHeartBeatDao
getNodeId
in interface ClusterNodeHeartBeatDao
public void writeHeartBeat(long time)
ClusterNodeHeartBeatDao
System.currentTimeMillis()
.writeHeartBeat
in interface ClusterNodeHeartBeatDao
time
- the time in millis to write as the heartbeat.@Nullable public Long getLastHeartbeatTime(@Nonnull String nodeId)
ClusterNodeHeartBeatDao
A null
value indicates no heartbeats have been sent by this node.
getLastHeartbeatTime
in interface ClusterNodeHeartBeatDao
nodeId
- the node@Nonnull public Collection<String> findNodesWithHeartbeatsAfter(long time)
findNodesWithHeartbeatsAfter
in interface ClusterNodeHeartBeatDao
@Nonnull public Map<String,Long> getActiveNodesDatabaseTimeOffsets(long databaseActiveTime)
TimedClusterNodeHeartBeatDao
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.
getActiveNodesDatabaseTimeOffsets
in interface TimedClusterNodeHeartBeatDao
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.Copyright © 2002-2019 Atlassian. All Rights Reserved.