org.keycloak.models.sessions.infinispan.initializer

## Class InitializerState

- java.lang.Object
- - org.keycloak.models.sessions.infinispan.entities.SessionEntity
  - - org.keycloak.models.sessions.infinispan.initializer.InitializerState

- All Implemented Interfaces:
    Serializable

      @SerializeWith(value=InitializerState.ExternalizerImpl.class)
      public class InitializerState
      extends SessionEntity

  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
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `InitializerState.ExternalizerImpl`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InitializerState(int segmentsCount)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `int` | `getSegmentsCount()` Getter for the segments count.
    `List<Integer>` | `getSegmentsToLoad(int segmentToLoad, int maxSegmentCount)` Return next un-finished segments in the next row of segments.
    `int` | `hashCode()`
    `boolean` | `isFinished()` Return true just if computation is entirely finished (all segments are true)
    `void` | `markSegmentFinished(int index)`
    `String` | `toString()`

    - ### Methods inherited from class org.keycloak.models.sessions.infinispan.entities.SessionEntity

      `getRealmId, mergeRemoteEntityWithLocalEntity, setRealmId`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### InitializerState

          public InitializerState(int segmentsCount)

  - ### Method Detail

    - #### getSegmentsCount

          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)

    - #### getSegmentsToLoad

          public List<Integer> getSegmentsToLoad(int segmentToLoad,
                                                 int maxSegmentCount)

      Return next un-finished segments in the next row of segments.
      Parameters:
        `segmentToLoad` - The segment we are loading
        `maxSegmentCount` - The max segment to load
      Returns:
        The list of segments to work on this step

    - #### markSegmentFinished

          public void markSegmentFinished(int index)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in class `SessionEntity`

    - #### equals

          public boolean equals(Object obj)

      Specified by:
        `equals` in class `SessionEntity`

Copyright © 2020 JBoss by Red Hat. All rights reserved.