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 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 a ClusterHealth record class.
      Parameters:
      overallStatus - the value for the overallStatus record component
      nodes - the value for the nodes record component
      quorumReached - the value for the quorumReached record component
      leaderNodeId - the value for the leaderNodeId record component
      partitionCount - the value for the partitionCount record component
      replicationLag - the value for the replicationLag record 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

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • overallStatus

      public ClusterHealthMonitor.HealthStatus overallStatus()
      Returns the value of the overallStatus record component.
      Returns:
      the value of the overallStatus record component
    • nodes

      Returns the value of the nodes record component.
      Returns:
      the value of the nodes record component
    • quorumReached

      public boolean quorumReached()
      Returns the value of the quorumReached record component.
      Returns:
      the value of the quorumReached record component
    • leaderNodeId

      public @Nullable String leaderNodeId()
      Returns the value of the leaderNodeId record component.
      Returns:
      the value of the leaderNodeId record component
    • partitionCount

      public int partitionCount()
      Returns the value of the partitionCount record component.
      Returns:
      the value of the partitionCount record component
    • replicationLag

      public long replicationLag()
      Returns the value of the replicationLag record component.
      Returns:
      the value of the replicationLag record component