Package com.atlassian.bamboo.beehive
Interface ClusterNodeHeartbeatDao
- All Known Implementing Classes:
BambooClusterNodeHeartBeatRawJdbcDao
@Internal
public interface ClusterNodeHeartbeatDao
Specialised for Bamboo.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteNode(@NotNull String nodeId) Remove node by the given id.voidCreates 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) @Nullable LonggetLastHeartbeatTime(@NotNull String nodeId) Returns the last time a heartbeat was sent by the given node.@NotNull StringReturns the globally unique Identifier for this cluster node.@NotNull StringvoidwriteHeartBeat(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.
-
getNodeName
- Returns:
- the name 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
nullvalue 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()