Class DBLockBasedCacheInitializer
java.lang.Object
org.keycloak.models.sessions.infinispan.initializer.CacheInitializer
org.keycloak.models.sessions.infinispan.initializer.DBLockBasedCacheInitializer
Encapsulates preloading of sessions within the DB Lock. This DB-aware lock ensures that "startLoading" is done on single DC and the other DCs need to wait.
- Author:
- Marek Posolda
-
Constructor Summary
ConstructorDescriptionDBLockBasedCacheInitializer
(KeycloakSession session, CacheInitializer delegate) -
Method Summary
Modifier and TypeMethodDescriptionprotected int
Returns an integer which captures current progress.protected int
void
protected boolean
protected boolean
protected void
Just coordinator will run this.Methods inherited from class org.keycloak.models.sessions.infinispan.initializer.CacheInitializer
loadSessions
-
Constructor Details
-
DBLockBasedCacheInitializer
-
-
Method Details
-
initCache
public void initCache()- Overrides:
initCache
in classCacheInitializer
-
isFinished
protected boolean isFinished()- Specified by:
isFinished
in classCacheInitializer
-
isCoordinator
protected boolean isCoordinator()- Specified by:
isCoordinator
in classCacheInitializer
-
getProgressIndicator
protected int getProgressIndicator()Description copied from class:CacheInitializer
Returns an integer which captures current progress. If there is a progress in loading, this indicator must be different most of the time so that it does not hit 30-seconds limit.- Specified by:
getProgressIndicator
in classCacheInitializer
- Returns:
- See Also:
-
#stalledTimeoutInSeconds
-
getStalledTimeoutInSeconds
protected int getStalledTimeoutInSeconds()- Specified by:
getStalledTimeoutInSeconds
in classCacheInitializer
-
startLoading
protected void startLoading()Just coordinator will run this. And there is DB-lock, so the delegate.startLoading() will be permitted just by the single DC- Specified by:
startLoading
in classCacheInitializer
-