public enum CacheConflictMode extends Enum<CacheConflictMode>
Each cache entry has data center ID. In case cache update is performed and either old or new cache entry has data
center ID which differs from local data center ID defined by GridGainConfiguration.getDataCenterId()
, then
we consider such situation as conflict.
If both entries participating in conflict have the same data center ID (i.e. they both were replicated from the same remote data center), then GridGain can potentially resolve this conflict automatically based on entry metadata.
But in case old and new entries have different data center IDs (i.e. in active-active scenario when cache is updated in both data centers participating in data center replication, or when cache is updated from multiple remote data centers), then explicit conflict resolution is required.
This enumeration provides several different strategies for conflict resolution.
Enum Constant and Description |
---|
ALWAYS
GridGain will always delegate to conflict resolver.
|
AUTO
GridGain will automatically resolve conflicts when possible (i.e. when both old and new entries have the same
data center ID).
|
Modifier and Type | Method and Description |
---|---|
static @Nullable CacheConflictMode |
fromOrdinal(int ord)
Efficiently gets enumerated value from its ordinal.
|
static CacheConflictMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CacheConflictMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CacheConflictMode AUTO
CacheConflictResolver
configured through
GridGainCacheConfiguration.getConflictResolver()
.
In case conflict resolver is not configured, GridGain will overwrite old entry with a new one.
This mode is default.
public static final CacheConflictMode ALWAYS
In this mode GridGainCacheConfiguration.getConflictResolver()
is
mandatory.
public static CacheConflictMode[] values()
for (CacheConflictMode c : CacheConflictMode.values()) System.out.println(c);
public static CacheConflictMode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null@Nullable public static @Nullable CacheConflictMode fromOrdinal(int ord)
ord
- Ordinal value.null
if ordinal out of range.
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024