Record Class InMemoryBackendProperties
java.lang.Object
java.lang.Record
am.ik.redis.adapter.boot.inmemory.InMemoryBackendProperties
- Record Components:
sweeperEnabled- whether to run the background sweep at allsweepInterval- how long to wait between sweeps, which is the longest an expired key can sit there unnoticed
@ConfigurationProperties(prefix="redis-adapter.in-memory")
public record InMemoryBackendProperties(boolean sweeperEnabled, Duration sweepInterval)
extends Record
What the in-memory backend can be tuned with. It is read by this server and no other: a
server built around another backend brings its own properties, under its own
redis-adapter.<backend> prefix, and has never heard of these.
Both settings are about active expiry: the sweep that removes keys whose time
has passed but which nobody has come back to. Keys that are touched expire on that
access whatever these are set to, so turning the sweeper off does not keep a dead
session readable — it only delays the expired notification until something asks
for the key.
-
Constructor Summary
ConstructorsConstructorDescriptionInMemoryBackendProperties(boolean sweeperEnabled, Duration sweepInterval) Creates an instance of aInMemoryBackendPropertiesrecord 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.booleanReturns the value of thesweeperEnabledrecord component.Returns the value of thesweepIntervalrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
InMemoryBackendProperties
public InMemoryBackendProperties(@DefaultValue("true") boolean sweeperEnabled, @DefaultValue("1s") Duration sweepInterval) Creates an instance of aInMemoryBackendPropertiesrecord class.- Parameters:
sweeperEnabled- the value for thesweeperEnabledrecord componentsweepInterval- the value for thesweepIntervalrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
sweeperEnabled
public boolean sweeperEnabled()Returns the value of thesweeperEnabledrecord component.- Returns:
- the value of the
sweeperEnabledrecord component
-
sweepInterval
Returns the value of thesweepIntervalrecord component.- Returns:
- the value of the
sweepIntervalrecord component
-