org.apache.ignite.cache

## Enum CacheMode

- java.lang.Object
- - java.lang.Enum<CacheMode>
  - - org.apache.ignite.cache.CacheMode

- All Implemented Interfaces:
    Serializable, Comparable<CacheMode>

      public enum CacheMode
      extends Enum<CacheMode>

  Enumeration of all supported caching modes. Cache mode is specified in `CacheConfiguration` and cannot be changed after cache has started.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `LOCAL` Specifies local-only cache behaviour.
    `PARTITIONED` Specifies partitioned cache behaviour.
    `REPLICATED` Specifies fully replicated cache behavior.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static @Nullable CacheMode` | `fromOrdinal(int ord)` Efficiently gets enumerated value from its ordinal.
    `static CacheMode` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static CacheMode[]` | `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 CacheMode LOCAL

      Specifies local-only cache behaviour. In this mode caches residing on different grid nodes will not know about each other.

      Other than distribution, `local` caches still have all the caching features, such as eviction, expiration, swapping, querying, etc... This mode is very useful when caching read-only data or data that automatically expires at a certain interval and then automatically reloaded from persistence store.

    - #### REPLICATED

          public static final CacheMode REPLICATED

      Specifies fully replicated cache behavior. In this mode all the keys are distributed to all participating nodes. User still has affinity control over subset of nodes for any given key via `AffinityFunction` configuration.

    - #### PARTITIONED

          public static final CacheMode PARTITIONED

      Specifies partitioned cache behaviour. In this mode the overall key set will be divided into partitions and all partitions will be split equally between participating nodes. User has affinity control over key assignment via `AffinityFunction` configuration.

      Note that partitioned cache is always fronted by local `'near'` cache which stores most recent data. You can configure the size of near cache via `NearCacheConfiguration.getNearEvictionPolicyFactory()` configuration property.

  - ### Method Detail

    - #### values

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

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

    - #### valueOf

          public static CacheMode 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 @Nullable CacheMode fromOrdinal(int ord)

      Efficiently gets enumerated value from its ordinal.
      Parameters:
        `ord` - Ordinal value.
      Returns:
        Enumerated value or `null` if ordinal out of range.

2021 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021