Record Class MemoryManager.MemoryThreshold
java.lang.Object
java.lang.Record
com.loomcache.server.cache.MemoryManager.MemoryThreshold
- Enclosing class:
MemoryManager
public static record MemoryManager.MemoryThreshold(long softLimitBytes, long hardLimitBytes)
extends Record
Memory threshold configuration.
softLimit: 80% of heap — triggers background eviction
hardLimit: 90% of heap — rejects new writes
-
Constructor Summary
ConstructorsConstructorDescriptionMemoryThreshold(long softLimitBytes, long hardLimitBytes) Creates an instance of aMemoryThresholdrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.fromHeapSize(long maxHeapBytes) Create thresholds from heap size with standard percentages.longReturns the value of thehardLimitBytesrecord component.final inthashCode()Returns a hash code value for this object.longReturns the value of thesoftLimitBytesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MemoryThreshold
public MemoryThreshold(long softLimitBytes, long hardLimitBytes) Creates an instance of aMemoryThresholdrecord class.- Parameters:
softLimitBytes- the value for thesoftLimitBytesrecord componenthardLimitBytes- the value for thehardLimitBytesrecord component
-
-
Method Details
-
fromHeapSize
Create thresholds from heap size with standard percentages. -
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
softLimitBytes
public long softLimitBytes()Returns the value of thesoftLimitBytesrecord component.- Returns:
- the value of the
softLimitBytesrecord component
-
hardLimitBytes
public long hardLimitBytes()Returns the value of thehardLimitBytesrecord component.- Returns:
- the value of the
hardLimitBytesrecord component
-