Record Class PersistedConsistentHash<CH extends ConsistentHash>

java.lang.Object
java.lang.Record
org.infinispan.distribution.ch.PersistedConsistentHash<CH>
Type Parameters:
CH - The specific implementation type of the ConsistentHash.
Record Components:
consistentHash - The ConsistentHash instance. Note that its ownership information might be incomplete if missingUuids() is not empty.
missingUuids - A collection of UUIDs representing members that were present in the persistent state but are not currently online.

public record PersistedConsistentHash<CH extends ConsistentHash>(CH extends ConsistentHash consistentHash, Collection<UUID> missingUuids) extends Record
A record containing the ConsistentHash restored from persistent state and any missing UUIDs.
See Also:
  • Constructor Details

    • PersistedConsistentHash

      public PersistedConsistentHash(CH consistentHash, Collection<UUID> missingUuids)
      Creates an instance of a PersistedConsistentHash record class.
      Parameters:
      consistentHash - the value for the consistentHash record component
      missingUuids - the value for the missingUuids record component
  • Method Details

    • totalMembers

      public int totalMembers()
      Returns the total number of members that were present in the persistent state, including those currently marked as missing.
      Returns:
      The total number of members, including both online and missing members.
    • hasMissingMembers

      public boolean hasMissingMembers()
      Indicates whether there are missing members that were part of the persistent state but are not currently online.
      Returns:
      true if the missingUuids() collection is not empty, signifying potential incomplete ownership information in the associated ConsistentHash. Otherwise, returns false.
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • consistentHash

      public CH consistentHash()
      Returns the value of the consistentHash record component.
      Returns:
      the value of the consistentHash record component
    • missingUuids

      public Collection<UUID> missingUuids()
      Returns the value of the missingUuids record component.
      Returns:
      the value of the missingUuids record component