Record Class ClusterHealthMonitor.ClusterHealth
java.lang.Object
java.lang.Record
com.loomcache.server.cluster.ClusterHealthMonitor.ClusterHealth
- Enclosing class:
ClusterHealthMonitor
public static record ClusterHealthMonitor.ClusterHealth(ClusterHealthMonitor.HealthStatus overallStatus, Map<String, ClusterHealthMonitor.NodeHealth> nodes, boolean quorumReached, @Nullable String leaderNodeId, int partitionCount, long replicationLag)
extends Record
Cluster-wide health aggregation.
-
Constructor Summary
ConstructorsConstructorDescriptionClusterHealth(ClusterHealthMonitor.HealthStatus overallStatus, Map<String, ClusterHealthMonitor.NodeHealth> nodes, boolean quorumReached, @Nullable String leaderNodeId, int partitionCount, long replicationLag) Creates an instance of aClusterHealthrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintGet the number of degraded nodes.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intGet the number of healthy nodes.@Nullable StringReturns the value of theleaderNodeIdrecord component.nodes()Returns the value of thenodesrecord component.Returns the value of theoverallStatusrecord component.intReturns the value of thepartitionCountrecord component.booleanReturns the value of thequorumReachedrecord component.longReturns the value of thereplicationLagrecord component.final StringtoString()Returns a string representation of this record class.intGet the number of unhealthy nodes.
-
Constructor Details
-
ClusterHealth
public ClusterHealth(ClusterHealthMonitor.HealthStatus overallStatus, Map<String, ClusterHealthMonitor.NodeHealth> nodes, boolean quorumReached, @Nullable String leaderNodeId, int partitionCount, long replicationLag) Creates an instance of aClusterHealthrecord class.- Parameters:
overallStatus- the value for theoverallStatusrecord componentnodes- the value for thenodesrecord componentquorumReached- the value for thequorumReachedrecord componentleaderNodeId- the value for theleaderNodeIdrecord componentpartitionCount- the value for thepartitionCountrecord componentreplicationLag- the value for thereplicationLagrecord component
-
-
Method Details
-
healthyNodeCount
public int healthyNodeCount()Get the number of healthy nodes. -
degradedNodeCount
public int degradedNodeCount()Get the number of degraded nodes. -
unhealthyNodeCount
public int unhealthyNodeCount()Get the number of unhealthy nodes. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
overallStatus
Returns the value of theoverallStatusrecord component.- Returns:
- the value of the
overallStatusrecord component
-
nodes
Returns the value of thenodesrecord component.- Returns:
- the value of the
nodesrecord component
-
quorumReached
public boolean quorumReached()Returns the value of thequorumReachedrecord component.- Returns:
- the value of the
quorumReachedrecord component
-
leaderNodeId
Returns the value of theleaderNodeIdrecord component.- Returns:
- the value of the
leaderNodeIdrecord component
-
partitionCount
public int partitionCount()Returns the value of thepartitionCountrecord component.- Returns:
- the value of the
partitionCountrecord component
-
replicationLag
public long replicationLag()Returns the value of thereplicationLagrecord component.- Returns:
- the value of the
replicationLagrecord component
-