Package com.atlassian.bamboo.beehive
Interface ClusterNodeHeartbeatDao
- All Known Implementing Classes:
BambooClusterNodeHeartBeatRawJdbcDao
@Internal
public interface ClusterNodeHeartbeatDao
Specialised for Bamboo.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteNode
(@NotNull String nodeId) Remove node by the given id.void
Creates heartbeat table if required.findAll()
Deprecated.@NotNull List<BambooNodeInfo>
Get all present in the database nodes together with their heartbeats.@NotNull List<BambooNodeInfo>
findNodesInfoWithHeartbeatsAfter
(long time) Get all nodes in the database together with their heartbeats in the time window specified by the time argument.@NotNull Collection<String>
findNodesWithHeartbeatsAfter
(long time) getLastHeartbeatTime
(@NotNull String nodeId) Returns the last time a heartbeat was sent by the given node.@NotNull String
Returns the globally unique Identifier for this cluster node.void
writeHeartBeat
(long time) Writes a heartbeat for this node at the given time.
-
Method Details
-
getNodeId
Returns the globally unique Identifier for this cluster node.- Returns:
- the globally unique Identifier for this cluster node.
-
writeHeartBeat
void writeHeartBeat(long time) Writes a heartbeat for this node at the given time. Caller will pass the time to stamp; in production this would normally beSystem.currentTimeMillis()
.- Parameters:
time
- the time in millis to write as the heartbeat.
-
getLastHeartbeatTime
Returns the last time a heartbeat was sent by the given node.A
null
value indicates no heartbeats have been sent by this node.- Parameters:
nodeId
- the node- Returns:
- the last time a heartbeat was sent by the given node.
-
findNodesWithHeartbeatsAfter
-
findNodesInfoWithHeartbeatsAfter
Get all nodes in the database together with their heartbeats in the time window specified by the time argument.- Parameters:
time
- the time in millis specifying the time window for the query- Returns:
- list of nodes
- Since:
- 9.4.0
-
findAll
Deprecated.since 9.4.0 usefindAllNodesInfo()
Get all heartbeats. The information about nodes' primary and alive attributes is not accurate. -
findAllNodesInfo
Get all present in the database nodes together with their heartbeats.- Returns:
- list of nodes
- Since:
- 9.4.0
-
deleteNode
Remove node by the given id.- Since:
- 9.4.0
-
ensureNodeHeartbeatTableExists
void ensureNodeHeartbeatTableExists()Creates heartbeat table if required.
-
findAllNodesInfo()