Class InitializerState
java.lang.Object
org.keycloak.models.sessions.infinispan.entities.SessionEntity
org.keycloak.models.sessions.infinispan.initializer.InitializerState
Note that this state is NOT thread safe. Currently it is only used from single thread so it's fine
but further optimizations might need to revisit this (see
InfinispanCacheInitializer
).- Author:
- Marek Posolda
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Return indication of progress - changes upon progressint
Getter for the segments count.getSegmentsToLoad
(int segmentToLoad, int maxSegmentCount) Return next un-finished segments in the next row of segments.int
hashCode()
boolean
Return true just if computation is entirely finished (all segments are true)void
markSegmentFinished
(int index) toString()
Methods inherited from class org.keycloak.models.sessions.infinispan.entities.SessionEntity
getRealmId, isOffline, mergeRemoteEntityWithLocalEntity, setOffline, setRealmId, shouldEvaluateRemoval
-
Constructor Details
-
InitializerState
public InitializerState(int segmentsCount)
-
-
Method Details
-
getSegmentsCount
@ProtoField(2) public int getSegmentsCount()Getter for the segments count.- Returns:
- The number of segments of the state
-
isFinished
public boolean isFinished()Return true just if computation is entirely finished (all segments are true) -
getProgressIndicator
public int getProgressIndicator()Return indication of progress - changes upon progress -
getSegmentsToLoad
Return next un-finished segments in the next row of segments.- Parameters:
segmentToLoad
- The segment we are loadingmaxSegmentCount
- The max segment to load- Returns:
- The list of segments to work on this step
-
markSegmentFinished
public void markSegmentFinished(int index) -
toString
-
hashCode
public int hashCode()- Specified by:
hashCode
in classSessionEntity
-
equals
- Specified by:
equals
in classSessionEntity
-