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 Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanDefault cache state.static final DurationDefault expiry of each completed entry: ten minutes.static final longDefault approximate weight of each cache: 64 MiB. -
Constructor Summary
ConstructorsConstructorDescriptionRendererCacheOptions(long maximumWeightBytes, Duration expireAfterWrite) Creates enabled cache options with the supplied bounds.RendererCacheOptions(long maximumWeightBytes, Duration expireAfterWrite, boolean enabled) Creates an instance of aRendererCacheOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic RendererCacheOptionsdefaults()Returns the default bounded, short-lived cache options.booleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpireAfterWriterecord component.final inthashCode()Returns a hash code value for this object.longReturns the value of themaximumWeightBytesrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_MAXIMUM_WEIGHT_BYTES
public static final long DEFAULT_MAXIMUM_WEIGHT_BYTESDefault approximate weight of each cache: 64 MiB.- See Also:
-
DEFAULT_EXPIRE_AFTER_WRITE
Default expiry of each completed entry: ten minutes. -
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDDefault cache state.- See Also:
-
-
Constructor Details
-
RendererCacheOptions
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
Creates an instance of aRendererCacheOptionsrecord class.- Parameters:
maximumWeightBytes- the value for themaximumWeightBytesrecord componentexpireAfterWrite- the value for theexpireAfterWriterecord componentenabled- the value for theenabledrecord component
-
-
Method Details
-
defaults
Returns the default bounded, short-lived cache options.- Returns:
- Default renderer cache options.
-
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 '=='. -
maximumWeightBytes
public long maximumWeightBytes()Returns the value of themaximumWeightBytesrecord component.- Returns:
- the value of the
maximumWeightBytesrecord component
-
expireAfterWrite
Returns the value of theexpireAfterWriterecord component.- Returns:
- the value of the
expireAfterWriterecord component
-
enabled
public boolean enabled()Returns the value of theenabledrecord component.- Returns:
- the value of the
enabledrecord component
-