Record Class RetentionPolicy
java.lang.Object
java.lang.Record
com.societegenerale.failover.dashboard.metrics.source.sharedstore.RetentionPolicy
- Record Components:
maxAge- points older than this are evictedmaxEntries- maximum retained points; the oldest are truncated beyond this
Two independent bounds applied to retained trend history (design ยง5.4): an age bound (
maxAge) and a
size bound (maxEntries, oldest truncated first). Shared by the in-memory series ring and, later, the
JDBC snapshot store so both evict with identical semantics.- Author:
- Anand Manissery
-
Constructor Summary
ConstructorsConstructorDescriptionRetentionPolicy(Duration maxAge, int maxEntries) Creates an instance of aRetentionPolicyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisExpired(long timestampMs, long nowMs) maxAge()Returns the value of themaxAgerecord component.intReturns the value of themaxEntriesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RetentionPolicy
Creates an instance of aRetentionPolicyrecord class.- Parameters:
maxAge- the value for themaxAgerecord componentmaxEntries- the value for themaxEntriesrecord component
-
-
Method Details
-
isExpired
public boolean isExpired(long timestampMs, long nowMs) - Returns:
trueif a point captured attimestampMsis older thanmaxAgerelative tonowMs.
-
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. -
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. -
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 '=='. -
maxAge
Returns the value of themaxAgerecord component.- Returns:
- the value of the
maxAgerecord component
-
maxEntries
public int maxEntries()Returns the value of themaxEntriesrecord component.- Returns:
- the value of the
maxEntriesrecord component
-