Record Class RendererCacheOptions

java.lang.Object
java.lang.Record
net.finmath.smartcontracts.representablestate.cache.RendererCacheOptions
Record Components:
maximumWeightBytes - Approximate maximum retained key and value weight.
expireAfterWrite - Duration after which a completed entry expires.
enabled - Whether completed values are retained and reused.

public record RendererCacheOptions(long maximumWeightBytes, Duration expireAfterWrite, boolean enabled) extends Record
Enablement and resource bounds for an in-process renderer cache.

The options are applied independently to the exact-snapshot rendered-XML cache, the optional cross-finalized-block rendered-XML cache, and the transformed-document cache. Enabling all three may therefore retain approximately three times maximumWeightBytes() plus cache overhead.

Bounds are required to be positive while caching is enabled. Disabled options may use zero bounds because no cache is constructed.

  • Field Details

    • DEFAULT_MAXIMUM_WEIGHT_BYTES

      public static final long DEFAULT_MAXIMUM_WEIGHT_BYTES
      Default approximate weight of each cache: 64 MiB.
      See Also:
    • DEFAULT_EXPIRE_AFTER_WRITE

      public static final Duration DEFAULT_EXPIRE_AFTER_WRITE
      Default expiry of each completed entry: ten minutes.
    • DEFAULT_ENABLED

      public static final boolean DEFAULT_ENABLED
      Default cache state.
      See Also:
  • Constructor Details

    • RendererCacheOptions

      public RendererCacheOptions(long maximumWeightBytes, Duration expireAfterWrite)
      Creates enabled cache options with the supplied bounds.
      Parameters:
      maximumWeightBytes - Approximate maximum retained key and value weight.
      expireAfterWrite - Duration after which a completed entry expires.
    • RendererCacheOptions

      public RendererCacheOptions(long maximumWeightBytes, Duration expireAfterWrite, boolean enabled)
      Creates an instance of a RendererCacheOptions record class.
      Parameters:
      maximumWeightBytes - the value for the maximumWeightBytes record component
      expireAfterWrite - the value for the expireAfterWrite record component
      enabled - the value for the enabled record component
  • Method Details

    • defaults

      public static RendererCacheOptions defaults()
      Returns the default bounded, short-lived cache options.
      Returns:
      Default renderer cache options.
    • 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 '=='.
      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.
    • maximumWeightBytes

      public long maximumWeightBytes()
      Returns the value of the maximumWeightBytes record component.
      Returns:
      the value of the maximumWeightBytes record component
    • expireAfterWrite

      public Duration expireAfterWrite()
      Returns the value of the expireAfterWrite record component.
      Returns:
      the value of the expireAfterWrite record component
    • enabled

      public boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component