org.apache.ignite.internal.processors.cache

## Enum CacheFlag

- java.lang.Object
- - java.lang.Enum<CacheFlag>
  - - org.apache.ignite.internal.processors.cache.CacheFlag

All Implemented Interfaces:
  Serializable, Comparable<CacheFlag>

    public enum CacheFlag
    extends Enum<CacheFlag>

Cache projection flags that specify projection behaviour. This flags can be explicitly passed into the following methods on `CacheProjection`:

- `CacheProjection.flagsOn(CacheFlag...)`
- `CacheProjection.flagsOff(CacheFlag...)`

Also, some flags, like `LOCAL`, or `READ` may be implicitly set whenever creating new projections and passing entries to predicate filters.

### Enum Constant Summary

Enum Constants
Enum Constant and Description
`CLONE` Clone values prior to returning them to user.
`FORCE_TRANSFORM_BACKUP` Skips version check during `IgniteCache.invoke(Object, EntryProcessor, Object[])` writes in `CacheAtomicityMode.ATOMIC` mode.
`INVALIDATE` Switches a cache projection to work in `'invalidation'` mode.
`LOCAL` Only operations that don't require any communication with other cache nodes are allowed.
`READ` Only operations that don't change cached data are allowed.
`SKIP_STORE` Skips store, i.e. no read-through and no write-through behavior.
`SKIP_SWAP` Skip swap space for reads and writes.
`SYNC_COMMIT` Synchronous commit.

### Method Summary

Methods
`static CacheFlag` `fromOrdinal(int ord)` Efficiently gets enumerated value from its ordinal.
`static CacheFlag` `valueOf(String name)` Returns the enum constant of this type with the specified name.
`static CacheFlag[]` `values()` Returns an array containing the constants of this enum type, in the order they are declared.

### Methods inherited from class java.lang.Enum

`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

`getClass, notify, notifyAll, wait, wait, wait`

### Enum Constant Detail

#### LOCAL

    public static final CacheFlag LOCAL

Only operations that don't require any communication with other cache nodes are allowed. This flag is automatically set on underlying projection for all the entries that are given to predicate filters to make sure that no distribution happens from inside of predicate evaluation.

#### READ

    public static final CacheFlag READ

Only operations that don't change cached data are allowed. This flag is automatically set on underlying projection for all the entries that are given to predicate filters to make sure that data cannot be updated during predicate evaluation.

#### CLONE

    public static final CacheFlag CLONE

Clone values prior to returning them to user.

Whenever values are returned from cache, they cannot be directly updated as cache holds the same references internally. If it is needed to update values that are returned from cache, this flag will provide automatic cloning of values prior to returning so they can be directly updated.

See Also:
  `org.apache.ignite.configuration.CacheConfiguration#getCloner()`

#### SKIP_STORE

    public static final CacheFlag SKIP_STORE

Skips store, i.e. no read-through and no write-through behavior.

#### SKIP_SWAP

    public static final CacheFlag SKIP_SWAP

Skip swap space for reads and writes.

#### SYNC_COMMIT

    public static final CacheFlag SYNC_COMMIT

Synchronous commit.

#### INVALIDATE

    public static final CacheFlag INVALIDATE

Switches a cache projection to work in `'invalidation'` mode. Instead of updating remote entries with new values, small invalidation messages will be sent to set the values to `null`.

See Also:
  `Transaction.isInvalidate()`, `CacheConfiguration.isInvalidate()`

#### FORCE_TRANSFORM_BACKUP

    public static final CacheFlag FORCE_TRANSFORM_BACKUP

Skips version check during `IgniteCache.invoke(Object, EntryProcessor, Object[])` writes in `CacheAtomicityMode.ATOMIC` mode. By default, in `ATOMIC` mode, whenever `transform(...)` is called, cache values (and not the `transform` closure) are sent from primary node to backup nodes to ensure proper update ordering.

By setting this flag, version check is skipped, and the `transform` closure is applied on both, primary and backup nodes. Use this flag for better performance if you are sure that there are no concurrent updates happening for the same key when `transform(...)` method is called.

### Method Detail

#### values

    public static CacheFlag[] 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 (CacheFlag c : CacheFlag.values())
        System.out.println(c);

Returns:
  an array containing the constants of this enum type, in the order they are declared

#### valueOf

    public static CacheFlag 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 name
  `NullPointerException` - if the argument is null

#### fromOrdinal

    @Nullable
    public static CacheFlag fromOrdinal(int ord)

Efficiently gets enumerated value from its ordinal.

Parameters:
  `ord` - Ordinal value.
Returns:
  Enumerated value or `null` if ordinal out of range.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015