Package org.apache.ignite.cache
Enum CacheRebalanceMode
- java.lang.Object
-
- java.lang.Enum<CacheRebalanceMode>
-
- org.apache.ignite.cache.CacheRebalanceMode
-
- All Implemented Interfaces:
Serializable
,Comparable<CacheRebalanceMode>
public enum CacheRebalanceMode extends Enum<CacheRebalanceMode>
Cache rebalance mode. When rebalancing is enabled (i.e. has value other thanNONE
), distributed caches will attempt to rebalance all necessary values from other grid nodes. This enumeration is used to configure rebalancing viaCacheConfiguration.getRebalanceMode()
configuration property. If not configured explicitly, thenCacheConfiguration.DFLT_REBALANCE_MODE
is used.Replicated caches will try to load the full set of cache entries from other nodes (or as defined by pluggable
AffinityFunction
), while partitioned caches will only load the entries for which current node is primary or back up.Note that rebalance mode only makes sense for
CacheMode.REPLICATED
andCacheMode.PARTITIONED
caches.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ASYNC
Asynchronous rebalance mode.NONE
In this mode no rebalancing will take place which means that caches will be either loaded on demand from persistent store whenever data is accessed, or will be populated explicitly.SYNC
Synchronous rebalance mode.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @Nullable CacheRebalanceMode
fromOrdinal(int ord)
Efficiently gets enumerated value from its ordinal.static CacheRebalanceMode
valueOf(String name)
Returns the enum constant of this type with the specified name.static CacheRebalanceMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SYNC
public static final CacheRebalanceMode SYNC
Synchronous rebalance mode. Distributed caches will not start until all necessary data is loaded from other available grid nodes.
-
ASYNC
public static final CacheRebalanceMode ASYNC
Asynchronous rebalance mode. Distributed caches will start immediately and will load all necessary data from other available grid nodes in the background.
-
NONE
public static final CacheRebalanceMode NONE
In this mode no rebalancing will take place which means that caches will be either loaded on demand from persistent store whenever data is accessed, or will be populated explicitly.
-
-
Method Detail
-
values
public static CacheRebalanceMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CacheRebalanceMode c : CacheRebalanceMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CacheRebalanceMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
fromOrdinal
@Nullable public static @Nullable CacheRebalanceMode fromOrdinal(int ord)
Efficiently gets enumerated value from its ordinal.- Parameters:
ord
- Ordinal value.- Returns:
- Enumerated value or
null
if ordinal out of range.
-
-