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 all
sweepInterval - 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 Details

    • InMemoryBackendProperties

      public InMemoryBackendProperties(@DefaultValue("true") boolean sweeperEnabled, @DefaultValue("1s") Duration sweepInterval)
      Creates an instance of a InMemoryBackendProperties record class.
      Parameters:
      sweeperEnabled - the value for the sweeperEnabled record component
      sweepInterval - the value for the sweepInterval record component
  • Method Details

    • 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 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.
    • sweeperEnabled

      public boolean sweeperEnabled()
      Returns the value of the sweeperEnabled record component.
      Returns:
      the value of the sweeperEnabled record component
    • sweepInterval

      public Duration sweepInterval()
      Returns the value of the sweepInterval record component.
      Returns:
      the value of the sweepInterval record component