Package swiss.trustbroker.config.dto
Class StateCacheProperties
java.lang.Object
swiss.trustbroker.config.dto.StateCacheProperties
Configuration for DB state cache.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionStateCacheProperties(int targetMaxEntries, int minSessionLifetimeSec, String reapSchedule, int reapMaxDelaySec, int reapWarnThresholdMs, int txCommitDelay, int txRetryDelayMs, int txRetryCount, boolean schemaMigration) Creates a newStateCachePropertiesinstance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()protected booleanbooleanintPrevents collecting sessions related to a pending login.intDelay at most 25 sec randomly to allow multiple reapers on the same session DB.Use by scheduled job checking for expired sessions and delete them from the session DB StateCache.intExpected reap cycle execution in milliseconds before we start to WARN about bad performance.intIf the session DB runs full (more than targetMaxEntries), XTB starts garbage collecting sessions, that might expire anyway soon to make room for new sessions and prevent storage issues.intDelay before transaction commit in milliseconds.intNumber of retries doubling the txRetryDelayMs on every try.intDelay before transaction retry in milliseconds (negative values indicate no retry).inthashCode()booleanState cache schema migration.voidsetMinSessionLifetimeSec(int minSessionLifetimeSec) Prevents collecting sessions related to a pending login.voidsetReapMaxDelaySec(int reapMaxDelaySec) Delay at most 25 sec randomly to allow multiple reapers on the same session DB.voidsetReapSchedule(String reapSchedule) Use by scheduled job checking for expired sessions and delete them from the session DB StateCache.voidsetReapWarnThresholdMs(int reapWarnThresholdMs) Expected reap cycle execution in milliseconds before we start to WARN about bad performance.voidsetSchemaMigration(boolean schemaMigration) State cache schema migration.voidsetTargetMaxEntries(int targetMaxEntries) If the session DB runs full (more than targetMaxEntries), XTB starts garbage collecting sessions, that might expire anyway soon to make room for new sessions and prevent storage issues.voidsetTxCommitDelay(int txCommitDelay) Delay before transaction commit in milliseconds.voidsetTxRetryCount(int txRetryCount) Number of retries doubling the txRetryDelayMs on every try.voidsetTxRetryDelayMs(int txRetryDelayMs) Delay before transaction retry in milliseconds (negative values indicate no retry).toString()
-
Constructor Details
-
StateCacheProperties
public StateCacheProperties() -
StateCacheProperties
public StateCacheProperties(int targetMaxEntries, int minSessionLifetimeSec, String reapSchedule, int reapMaxDelaySec, int reapWarnThresholdMs, int txCommitDelay, int txRetryDelayMs, int txRetryCount, boolean schemaMigration) Creates a newStateCachePropertiesinstance.- Parameters:
targetMaxEntries- If the session DB runs full (more than targetMaxEntries), XTB starts garbage collecting sessions, that might expire anyway soon to make room for new sessions and prevent storage issues.minSessionLifetimeSec- Prevents collecting sessions related to a pending login.reapSchedule- Use by scheduled job checking for expired sessions and delete them from the session DB StateCache. When multiple pods are running the reapMaxDelaySec is used to randomly delay the reaping to reduce concurrent work on the same data.
Cron expression, default is '30 * * * * *' which means run every 60sec at HH:MM:30reapMaxDelaySec- Delay at most 25 sec randomly to allow multiple reapers on the same session DB.reapWarnThresholdMs- Expected reap cycle execution in milliseconds before we start to WARN about bad performance.
Default: 10000txCommitDelay- Delay before transaction commit in milliseconds. For testing race conditions only, do not set in production environments!
Default: 0txRetryDelayMs- Delay before transaction retry in milliseconds (negative values indicate no retry).
Default: -1txRetryCount- Number of retries doubling the txRetryDelayMs on every try.
Default: 0schemaMigration- State cache schema migration. Currently unused.
Default: true- Since:
- 1.9.0, 1.10.0
-
-
Method Details
-
builder
-
getTargetMaxEntries
public int getTargetMaxEntries()If the session DB runs full (more than targetMaxEntries), XTB starts garbage collecting sessions, that might expire anyway soon to make room for new sessions and prevent storage issues. -
getMinSessionLifetimeSec
public int getMinSessionLifetimeSec()Prevents collecting sessions related to a pending login. -
getReapSchedule
Use by scheduled job checking for expired sessions and delete them from the session DB StateCache. When multiple pods are running the reapMaxDelaySec is used to randomly delay the reaping to reduce concurrent work on the same data.
Cron expression, default is '30 * * * * *' which means run every 60sec at HH:MM:30 -
getReapMaxDelaySec
public int getReapMaxDelaySec()Delay at most 25 sec randomly to allow multiple reapers on the same session DB. -
getReapWarnThresholdMs
public int getReapWarnThresholdMs()Expected reap cycle execution in milliseconds before we start to WARN about bad performance.
Default: 10000 -
getTxCommitDelay
public int getTxCommitDelay()Delay before transaction commit in milliseconds. For testing race conditions only, do not set in production environments!
Default: 0 -
getTxRetryDelayMs
public int getTxRetryDelayMs()Delay before transaction retry in milliseconds (negative values indicate no retry).
Default: -1- Since:
- 1.9.0
-
getTxRetryCount
public int getTxRetryCount()Number of retries doubling the txRetryDelayMs on every try.
Default: 0- Since:
- 1.10.0
-
isSchemaMigration
public boolean isSchemaMigration()State cache schema migration. Currently unused.
Default: true -
setTargetMaxEntries
public void setTargetMaxEntries(int targetMaxEntries) If the session DB runs full (more than targetMaxEntries), XTB starts garbage collecting sessions, that might expire anyway soon to make room for new sessions and prevent storage issues. -
setMinSessionLifetimeSec
public void setMinSessionLifetimeSec(int minSessionLifetimeSec) Prevents collecting sessions related to a pending login. -
setReapSchedule
Use by scheduled job checking for expired sessions and delete them from the session DB StateCache. When multiple pods are running the reapMaxDelaySec is used to randomly delay the reaping to reduce concurrent work on the same data.
Cron expression, default is '30 * * * * *' which means run every 60sec at HH:MM:30 -
setReapMaxDelaySec
public void setReapMaxDelaySec(int reapMaxDelaySec) Delay at most 25 sec randomly to allow multiple reapers on the same session DB. -
setReapWarnThresholdMs
public void setReapWarnThresholdMs(int reapWarnThresholdMs) Expected reap cycle execution in milliseconds before we start to WARN about bad performance.
Default: 10000 -
setTxCommitDelay
public void setTxCommitDelay(int txCommitDelay) Delay before transaction commit in milliseconds. For testing race conditions only, do not set in production environments!
Default: 0 -
setTxRetryDelayMs
public void setTxRetryDelayMs(int txRetryDelayMs) Delay before transaction retry in milliseconds (negative values indicate no retry).
Default: -1- Since:
- 1.9.0
-
setTxRetryCount
public void setTxRetryCount(int txRetryCount) Number of retries doubling the txRetryDelayMs on every try.
Default: 0- Since:
- 1.10.0
-
setSchemaMigration
public void setSchemaMigration(boolean schemaMigration) State cache schema migration. Currently unused.
Default: true -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-