org.apache.ignite.cache

## Enum CacheMemoryMode

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

All Implemented Interfaces:
  Serializable, Comparable<CacheMemoryMode>

    public enum CacheMemoryMode
    extends Enum<CacheMemoryMode>

Defines set of memory modes. Memory modes help control whether cache entries are stored on heap memory, offheap memory, or in swap space.

### Enum Constant Summary

Enum Constants
Enum Constant and Description
`OFFHEAP_TIERED` Works the same as `ONHEAP_TIERED`, except that entries never end up in heap memory and get stored in offheap memory right away.
`OFFHEAP_VALUES` Entry keys will be stored on heap memory, and values will be stored in offheap memory.
`ONHEAP_TIERED` Entries will be stored on-heap first.

### Method Summary

Methods
`static CacheMemoryMode` `valueOf(String name)` Returns the enum constant of this type with the specified name.
`static CacheMemoryMode[]` `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

#### ONHEAP_TIERED

    public static final CacheMemoryMode ONHEAP_TIERED

Entries will be stored on-heap first. The onheap tiered storage works as follows: <nl>
Entries are cached on heap memory first.
If offheap memory is enabled and eviction policy evicts an entry from heap memory, entry will be moved to offheap memory. If offheap memory is disabled, then entry is simply discarded.
If swap space is enabled and offheap memory fills up, then entry will be evicted into swap space. If swap space is disabled, then entry will be discarded. If swap is enabled and offheap memory is disabled, then entry will be evicted directly from heap memory into swap.
</nl>

Note that heap memory evictions are handled by configured `EvictionPolicy` implementation. By default, no eviction policy is enabled, so entries never leave heap memory space unless explicitly removed.

#### OFFHEAP_TIERED

    public static final CacheMemoryMode OFFHEAP_TIERED

Works the same as `ONHEAP_TIERED`, except that entries never end up in heap memory and get stored in offheap memory right away. Entries get cached in offheap memory first and then get evicted to swap, if one is configured.

#### OFFHEAP_VALUES

    public static final CacheMemoryMode OFFHEAP_VALUES

Entry keys will be stored on heap memory, and values will be stored in offheap memory. Note that in this mode entries can be evicted only to swap. The evictions will happen according to configured `EvictionPolicy`.

Size returned by `CachePeekMode.OFFHEAP` is always zero, for this mode.

### Method Detail

#### values

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

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

#### valueOf

    public static CacheMemoryMode 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

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.6.0
Release Date | : May 18 2016