@Internal
public interface BambooClusterNodeHeartbeatService
Modifier and Type | Method and Description |
---|---|
@NotNull Collection<String> |
findLiveNodes()
Returns all nodes that have sent a heartbeat within the default threshold time.
|
@NotNull Collection<String> |
findLiveNodes(long threshold)
Returns all nodes that have sent a heartbeat within the given threshold.
|
@Nullable Long |
getLastHeartbeatTime(@NotNull String nodeId)
Returns the last time a heartbeat was sent by the given node.
|
@NotNull String |
getNodeId()
Returns the node ID for this node.
|
@NotNull List<BambooNodeStatus> |
getNodeStatuses()
Get status of all nodes if DC license applied otherwise empty list.
|
boolean |
isCurrentNodePrimaryBuffered() |
boolean |
isNodeHeartbeatStarted() |
boolean |
isNodeLive(@NotNull String nodeId)
Checks whether the given cluster node is considered "live".
|
void |
setCurrentNodePrimary(boolean primary)
Set current node's primary flag.
|
void |
startNodeHeartbeat()
Starts registering heartbeats for the current node.
|
@NotNull @NotNull String getNodeId()
boolean isNodeLive(@NotNull @NotNull String nodeId)
Each live node will be writing a heartbeat on a set schedule (eg once a minute). A node is considered live if it has written a heartbeat within a reasonable tolerance level (eg 5 minutes).
The tolerance level needs to be large enough to avoid certain expected slow-downs in the system including GC pauses, or just general slowness in the JVM / scheduler / network / database of the remote node.
nodeId
- the cluster node to check@Nullable @Nullable Long getLastHeartbeatTime(@NotNull @NotNull String nodeId)
A null
value indicates no heartbeats have ever been sent by the given node.
nodeId
- the node@NotNull @NotNull Collection<String> findLiveNodes()
findLiveNodes(long)
@NotNull @NotNull Collection<String> findLiveNodes(long threshold)
threshold
- the threshold in millisecondsfindLiveNodes()
void startNodeHeartbeat() throws Exception
Exception
boolean isNodeHeartbeatStarted()
boolean isCurrentNodePrimaryBuffered()
void setCurrentNodePrimary(boolean primary)
@NotNull @NotNull List<BambooNodeStatus> getNodeStatuses()
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.