org.apache.ignite.internal.processors.cache.distributed.dht

## Class GridNoStorageCacheMap

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheConcurrentMap
  - - org.apache.ignite.internal.processors.cache.distributed.dht.GridNoStorageCacheMap

    public class GridNoStorageCacheMap
    extends GridCacheConcurrentMap

Empty cache map that will never store any entries.

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheConcurrentMap

`ctx, NON_INTERNAL_ARR`

### Constructor Summary

Constructors
Constructor and Description
`GridNoStorageCacheMap(GridCacheContext ctx)`

### Method Summary

Methods
`boolean` `containsKey(Object key)`
`GridCacheMapEntry` `getEntry(Object key)` Returns the entry associated with the specified key in the HashMap.
`boolean` `isEmpty()`
`int` `publicSize()`
`void` `putAll(Map<KeyCacheObject,CacheObject> m, long ttl)` Copies all of the mappings from the specified map to this map These mappings will replace any mappings that this map had for any of the keys currently in the specified map.
`GridCacheMapEntry` `putEntry(AffinityTopologyVersion topVer, KeyCacheObject key, CacheObject val, long ttl)`
`GridTriple<GridCacheMapEntry>` `putEntryIfObsoleteOrAbsent(AffinityTopologyVersion topVer, KeyCacheObject key, CacheObject val, long ttl, boolean create)`
`GridCacheMapEntry` `randomEntry()`
`boolean` `removeEntry(GridCacheEntryEx e)` Removes passed in entry if it presents in the map.
`GridCacheMapEntry` `removeEntryIfObsolete(KeyCacheObject key)` Removes and returns the entry associated with the specified key in the HashMap if entry is obsolete.
`int` `size()` Returns the number of key-value mappings in this map.
`String` `toString()`

### Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheConcurrentMap

`allEntries0, allValues, checkConsistency, decrementSize, entries, entries0, entriesx, hash, incrementSize, keySet, setEntryFactory, stripedEntryIterator, values`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### GridNoStorageCacheMap

    public GridNoStorageCacheMap(GridCacheContext ctx)

Parameters:
  `ctx` - Cache context.

### Method Detail

#### isEmpty

    public boolean isEmpty()

Overrides:
  `isEmpty` in class `GridCacheConcurrentMap`
Returns:
  `True` if this map is empty.

#### size

    public int size()

Returns the number of key-value mappings in this map.

Overrides:
  `size` in class `GridCacheConcurrentMap`
Returns:
  the number of key-value mappings in this map.

#### publicSize

    public int publicSize()

Overrides:
  `publicSize` in class `GridCacheConcurrentMap`
Returns:
  Public size.

#### containsKey

    public boolean containsKey(Object key)

Overrides:
  `containsKey` in class `GridCacheConcurrentMap`
Parameters:
  `key` - Key.
Returns:
  `True` if map contains mapping for provided key.

#### randomEntry

    public GridCacheMapEntry randomEntry()

Overrides:
  `randomEntry` in class `GridCacheConcurrentMap`
Returns:
  Random entry out of hash map.

#### getEntry

    public GridCacheMapEntry getEntry(Object key)

Returns the entry associated with the specified key in the HashMap. Returns null if the HashMap contains no mapping for this key.

Overrides:
  `getEntry` in class `GridCacheConcurrentMap`
Parameters:
  `key` - Key.
Returns:
  Entry.

#### putEntry

    public GridCacheMapEntry putEntry(AffinityTopologyVersion topVer,
                             KeyCacheObject key,
                             @Nullable
                             CacheObject val,
                             long ttl)

Overrides:
  `putEntry` in class `GridCacheConcurrentMap`
Parameters:
  `topVer` - Topology version.
  `key` - Key.
  `val` - Value.
  `ttl` - Time to live.
Returns:
  Cache entry for corresponding key-value pair.

#### putEntryIfObsoleteOrAbsent

    public GridTriple<GridCacheMapEntry> putEntryIfObsoleteOrAbsent(AffinityTopologyVersion topVer,
                                                           KeyCacheObject key,
                                                           @Nullable
                                                           CacheObject val,
                                                           long ttl,
                                                           boolean create)

Overrides:
  `putEntryIfObsoleteOrAbsent` in class `GridCacheConcurrentMap`
Parameters:
  `topVer` - Topology version.
  `key` - Key.
  `val` - Value.
  `ttl` - Time to live.
  `create` - Create flag.
Returns:
  Triple where the first element is current entry associated with the key, the second is created entry and the third is doomed (all may be null).

#### putAll

    public void putAll(Map<KeyCacheObject,CacheObject> m,
              long ttl)

Copies all of the mappings from the specified map to this map These mappings will replace any mappings that this map had for any of the keys currently in the specified map.

Overrides:
  `putAll` in class `GridCacheConcurrentMap`
Parameters:
  `m` - mappings to be stored in this map.
  `ttl` - Time to live.

#### removeEntry

    public boolean removeEntry(GridCacheEntryEx e)

Removes passed in entry if it presents in the map.

Overrides:
  `removeEntry` in class `GridCacheConcurrentMap`
Parameters:
  `e` - Entry to remove.
Returns:
  `True` if remove happened.

#### removeEntryIfObsolete

    public GridCacheMapEntry removeEntryIfObsolete(KeyCacheObject key)

Removes and returns the entry associated with the specified key in the HashMap if entry is obsolete. Returns null if the HashMap contains no mapping for this key.

Overrides:
  `removeEntryIfObsolete` in class `GridCacheConcurrentMap`
Parameters:
  `key` - Key.
Returns:
  Removed entry, possibly `null`.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridCacheConcurrentMap`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0
Release Date | : March 31 2015