Record Class PartitionDetector.PartitionEvent

java.lang.Object
java.lang.Record
com.loomcache.server.cluster.PartitionDetector.PartitionEvent
Record Components:
timestamp - system time when the event occurred (ms since epoch)
eventType - type of event (DETECTED or HEALED)
affectedNodes - set of nodes affected by the partition
duration - duration of the partition in milliseconds (0 if still ongoing)
Enclosing class:
PartitionDetector

public static record PartitionDetector.PartitionEvent(long timestamp, PartitionDetector.PartitionEvent.EventType eventType, Set<String> affectedNodes, long duration) extends Record
Event representing a partition change (detected or healed).
  • Constructor Details

    • PartitionEvent

      public PartitionEvent(long timestamp, PartitionDetector.PartitionEvent.EventType eventType, Set<String> affectedNodes, long duration)
      Creates an instance of a PartitionEvent record class.
      Parameters:
      timestamp - the value for the timestamp record component
      eventType - the value for the eventType record component
      affectedNodes - the value for the affectedNodes record component
      duration - the value for the duration record component
  • Method Details

    • 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.
    • timestamp

      public long timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component
    • eventType

      Returns the value of the eventType record component.
      Returns:
      the value of the eventType record component
    • affectedNodes

      public Set<String> affectedNodes()
      Returns the value of the affectedNodes record component.
      Returns:
      the value of the affectedNodes record component
    • duration

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