Package com.atlassian.bamboo.beehive
Interface ClusterNodeHeartbeatDao
-
- All Known Implementing Classes:
BambooClusterNodeHeartBeatRawJdbcDao
@Internal public interface ClusterNodeHeartbeatDaoSpecialised for Bamboo.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voiddeleteNode(@NotNull String nodeId)Remove node by the given id.voidensureNodeHeartbeatTableExists()Creates heartbeat table if required.List<BambooNodeStatus>findAll()Deprecated.since 9.4.0 usefindAllNodesInfo()@NotNull List<BambooNodeInfo>findAllNodesInfo()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 StringgetNodeId()Returns the globally unique Identifier for this cluster node.voidwriteHeartBeat(long time)Writes a heartbeat for this node at the given time.
-
-
-
Method Detail
-
getNodeId
@NotNull @NotNull String 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
@Nullable @Nullable Long getLastHeartbeatTime(@NotNull @NotNull String nodeId)
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
@NotNull @NotNull Collection<String> findNodesWithHeartbeatsAfter(long time)
-
findNodesInfoWithHeartbeatsAfter
@NotNull @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.- Parameters:
time- the time in millis specifying the time window for the query- Returns:
- list of nodes
- Since:
- 9.4.0
-
findAll
@Deprecated List<BambooNodeStatus> findAll()
Deprecated.since 9.4.0 usefindAllNodesInfo()Get all heartbeats. The information about nodes' primary and alive attributes is not accurate.
-
findAllNodesInfo
@NotNull @NotNull List<BambooNodeInfo> findAllNodesInfo()
Get all present in the database nodes together with their heartbeats.- Returns:
- list of nodes
- Since:
- 9.4.0
-
deleteNode
void deleteNode(@NotNull @NotNull String nodeId)Remove node by the given id.- Since:
- 9.4.0
-
ensureNodeHeartbeatTableExists
void ensureNodeHeartbeatTableExists()
Creates heartbeat table if required.
-
-