public enum CacheAtomicityMode extends Enum<CacheAtomicityMode>
ATOMIC
mode is
used whenever transactions and explicit locking are not needed. Note that in ATOMIC
mode cache will still maintain full data consistency across all cache nodes.
Cache atomicity may be set via CacheConfiguration.getAtomicityMode()
configuration property.
Enum Constant and Description |
---|
ATOMIC
Specifies atomic-only cache behaviour.
|
TRANSACTIONAL
Specified fully
ACID -compliant transactional cache behavior. |
Modifier and Type | Method and Description |
---|---|
static CacheAtomicityMode |
fromOrdinal(int ord)
Efficiently gets enumerated value from its ordinal.
|
static CacheAtomicityMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CacheAtomicityMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CacheAtomicityMode TRANSACTIONAL
ACID
-compliant transactional cache behavior. See
Transaction
for more information about transactions.public static final CacheAtomicityMode ATOMIC
In addition to transactions and locking, one of the main differences in ATOMIC
mode
is that bulk writes, such as putAll(...)
, removeAll(...)
, and transformAll(...)
methods, become simple batch operations which can partially fail. In case of partial
failure CachePartialUpdateCheckedException
will be thrown
which will contain a list of keys for which the update failed. It is recommended that bulk writes are used
whenever multiple keys need to be inserted or updated in cache, as they reduce number of network trips and
provide better performance.
Note that even without locking and transactions, ATOMIC
mode still provides
full consistency guarantees across all cache nodes.
Also note that all data modifications in ATOMIC
mode are guaranteed to be atomic
and consistent with writes to the underlying persistent store, if one is configured.
public static CacheAtomicityMode[] values()
for (CacheAtomicityMode c : CacheAtomicityMode.values()) System.out.println(c);
public static CacheAtomicityMode 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 CacheAtomicityMode fromOrdinal(int ord)
ord
- Ordinal value.null
if ordinal out of range.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017