Record Class MergePolicy.MergeEntry<V>
- Type Parameters:
V- value type- Record Components:
value- the entry value (non-null — use an explicit tombstone if needed)timestampMs- epoch millis of the writewriterNodeId- deterministic identifier of the writing node (non-null)hitCount- successful read count for the entry (non-negative)lastAccessTimeMs- epoch millis of the last successful read (non-negative, 0 when unknown)expirationTimeMs- epoch millis when this entry expires, orMergePolicy.NO_EXPIRATION_TIME_MILLISwhen it does not expire
- Enclosing interface:
MergePolicy<K,V>
timestampMs is the wall-clock time (epoch millis) at which the
write occurred on the originating cluster. writerNodeId is a
deterministic identifier of the writer (e.g. the source cluster id for an
incoming WAN event, or DistributedMap.getLocalWriterId() for an
existing local value) used as a tie-breaker when two writes land on the
same millisecond. hitCount is the number of successful reads recorded
for the entry on the source that produced it, used by HigherHitsMergePolicy.
lastAccessTimeMs is the epoch millis of the last successful read,
used by LatestAccessMergePolicy. expirationTimeMs is the epoch
millis at which the entry expires, or MergePolicy.NO_EXPIRATION_TIME_MILLIS for
entries that do not expire, used by ExpirationTimeMergePolicy.
BLK-2026-04-22-011: replacing the prior long version field with
a String writerNodeId is what gives LatestUpdateMergePolicy
a deterministic same-millisecond tie-break — lexicographic ordering over
writer ids is commutative across replicas, so two clusters seeing the same
pair of events converge to the same winner regardless of arrival order.
- Since:
- 2.0
-
Constructor Summary
ConstructorsConstructorDescriptionMergeEntry(@NonNull V value, long timestampMs, @NonNull String writerNodeId) Backward-compatible constructor for policies that do not use hit metadata.MergeEntry(@NonNull V value, long timestampMs, @NonNull String writerNodeId, long hitCount) Backward-compatible constructor for policies that use hit metadata only.MergeEntry(@NonNull V value, long timestampMs, @NonNull String writerNodeId, long hitCount, long lastAccessTimeMs) Backward-compatible constructor for policies that use hit/access metadata.MergeEntry(@NonNull V value, long timestampMs, @NonNull String writerNodeId, long hitCount, long lastAccessTimeMs, long expirationTimeMs) Compact constructor — validates required fields and non-negative metadata. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longReturns the value of theexpirationTimeMsrecord component.final inthashCode()Returns a hash code value for this object.longhitCount()Returns the value of thehitCountrecord component.longReturns the value of thelastAccessTimeMsrecord component.longReturns the value of thetimestampMsrecord component.final StringtoString()Returns a string representation of this record class.@NonNull Vvalue()Returns the value of thevaluerecord component.@NonNull StringReturns the value of thewriterNodeIdrecord component.
-
Constructor Details
-
MergeEntry
-
MergeEntry
-
MergeEntry
-
MergeEntry
-
-
Method Details
-
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. -
value
-
timestampMs
public long timestampMs()Returns the value of thetimestampMsrecord component.- Returns:
- the value of the
timestampMsrecord component
-
writerNodeId
Returns the value of thewriterNodeIdrecord component.- Returns:
- the value of the
writerNodeIdrecord component
-
hitCount
-
lastAccessTimeMs
public long lastAccessTimeMs()Returns the value of thelastAccessTimeMsrecord component.- Returns:
- the value of the
lastAccessTimeMsrecord component
-
expirationTimeMs
public long expirationTimeMs()Returns the value of theexpirationTimeMsrecord component.- Returns:
- the value of the
expirationTimeMsrecord component
-