Record Class WanPublisher.WanEvent

java.lang.Object
java.lang.Record
com.loomcache.server.wan.WanPublisher.WanEvent
Record Components:
sequence - monotonically increasing event sequence number
mapName - the target data structure name
key - the key being changed
value - the new value (null for DELETE)
changeType - the type of change
timestampMillis - epoch millis when the change occurred
hitCount - successful reads recorded for the key at publish time
lastAccessTimeMillis - epoch millis of the last successful read at publish time
expirationTimeMillis - epoch millis when the key expires, or Long.MAX_VALUE when the key does not expire
All Implemented Interfaces:
Serializable
Enclosing class:
WanPublisher

public static record WanPublisher.WanEvent(long sequence, @NonNull String mapName, @NonNull String key, byte @Nullable [] value, @NonNull WanReplicationManager.ChangeType changeType, long timestampMillis, long hitCount, long lastAccessTimeMillis, long expirationTimeMillis) extends Record implements Serializable
A single WAN replication event.
Since:
2.0
See Also:
  • Constructor Details

    • WanEvent

      public WanEvent(long sequence, @NonNull String mapName, @NonNull String key, byte @Nullable [] value, @NonNull WanReplicationManager.ChangeType changeType, long timestampMillis)
    • WanEvent

      public WanEvent(long sequence, @NonNull String mapName, @NonNull String key, byte @Nullable [] value, @NonNull WanReplicationManager.ChangeType changeType, long timestampMillis, long hitCount)
    • WanEvent

      public WanEvent(long sequence, @NonNull String mapName, @NonNull String key, byte @Nullable [] value, @NonNull WanReplicationManager.ChangeType changeType, long timestampMillis, long hitCount, long lastAccessTimeMillis)
    • WanEvent

      public WanEvent(long sequence, @NonNull String mapName, @NonNull String key, byte @Nullable [] value, @NonNull WanReplicationManager.ChangeType changeType, long timestampMillis, long hitCount, long lastAccessTimeMillis, long expirationTimeMillis)
      Creates an instance of a WanEvent record class.
      Parameters:
      sequence - the value for the sequence record component
      mapName - the value for the mapName record component
      key - the value for the key record component
      value - the value for the value record component
      changeType - the value for the changeType record component
      timestampMillis - the value for the timestampMillis record component
      hitCount - the value for the hitCount record component
      lastAccessTimeMillis - the value for the lastAccessTimeMillis record component
      expirationTimeMillis - the value for the expirationTimeMillis 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.
    • sequence

      public long sequence()
      Returns the value of the sequence record component.
      Returns:
      the value of the sequence record component
    • mapName

      public @NonNull String mapName()
      Returns the value of the mapName record component.
      Returns:
      the value of the mapName record component
    • key

      public @NonNull String key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component
    • value

      public byte @Nullable [] value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component
    • changeType

      public @NonNull WanReplicationManager.ChangeType changeType()
      Returns the value of the changeType record component.
      Returns:
      the value of the changeType record component
    • timestampMillis

      public long timestampMillis()
      Returns the value of the timestampMillis record component.
      Returns:
      the value of the timestampMillis record component
    • hitCount

      public long hitCount()
      Returns the value of the hitCount record component.
      Returns:
      the value of the hitCount record component
    • lastAccessTimeMillis

      public long lastAccessTimeMillis()
      Returns the value of the lastAccessTimeMillis record component.
      Returns:
      the value of the lastAccessTimeMillis record component
    • expirationTimeMillis

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