|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ClusterNodeHeartbeatService
Provides a heartbeat for nodes of a cluster and utility methods for finding out about the "liveness" of other nodes.
| Method Summary | |
|---|---|
Collection<String> |
findLiveNodes()
Returns all nodes that have sent a heartbeat within the default threshold time. |
Collection<String> |
findLiveNodes(long threshold)
Returns all nodes that have sent a heartbeat within the given threshold. |
Long |
getLastHeartbeatTime(String nodeId)
Returns the last time a heartbeat was sent by the given node. |
String |
getNodeId()
Returns the node ID for this node. |
boolean |
isNodeLive(String nodeId)
Checks whether the given cluster node is considered "live". |
| Method Detail |
|---|
@Nonnull String getNodeId()
boolean isNodeLive(@Nonnull
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
Long getLastHeartbeatTime(@Nonnull
String nodeId)
A null value indicates no heartbeats have ever been sent by the given node.
nodeId - the node
@Nonnull Collection<String> findLiveNodes()
findLiveNodes(long)@Nonnull Collection<String> findLiveNodes(long threshold)
threshold - the threshold in milliseconds
findLiveNodes()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||