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

    Constructors
    Constructor
    Description
    MemoryThreshold(long softLimitBytes, long hardLimitBytes)
    Creates an instance of a MemoryThreshold record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    fromHeapSize(long maxHeapBytes)
    Create thresholds from heap size with standard percentages.
    long
    Returns the value of the hardLimitBytes record component.
    final int
    Returns a hash code value for this object.
    long
    Returns the value of the softLimitBytes record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MemoryThreshold

      public MemoryThreshold(long softLimitBytes, long hardLimitBytes)
      Creates an instance of a MemoryThreshold record class.
      Parameters:
      softLimitBytes - the value for the softLimitBytes record component
      hardLimitBytes - the value for the hardLimitBytes record component
  • Method Details

    • fromHeapSize

      public static MemoryManager.MemoryThreshold fromHeapSize(long maxHeapBytes)
      Create thresholds from heap size with standard percentages.
    • 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. All components in this record class 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.
    • softLimitBytes

      public long softLimitBytes()
      Returns the value of the softLimitBytes record component.
      Returns:
      the value of the softLimitBytes record component
    • hardLimitBytes

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