org.apache.ignite.internal.processors.cache

## Class GridNoStorageCacheMap

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

All Implemented Interfaces:
  GridCacheConcurrentMap

    public class GridNoStorageCacheMap
    extends Object
    implements GridCacheConcurrentMap

Empty cache map that will never store any entries.

### Constructor Summary

Constructors
Constructor and Description
`GridNoStorageCacheMap(GridCacheContext ctx)`

### Method Summary

Methods
`Iterable<GridCacheMapEntry>` `allEntries(CacheEntryPredicate... filter)`
`void` `decrementPublicSize(GridCacheEntryEx e)` Decrements public size.
`Iterable<GridCacheMapEntry>` `entries(CacheEntryPredicate... filter)`
`Set<GridCacheMapEntry>` `entrySet(CacheEntryPredicate... filter)`
`GridCacheMapEntry` `getEntry(KeyCacheObject key)` Returns the entry associated with the specified key in the HashMap.
`void` `incrementPublicSize(GridCacheEntryEx e)` Increments public size.
`Set<KeyCacheObject>` `keySet(CacheEntryPredicate... filter)`
`int` `publicSize()` Returns the number of publicly available key-value mappings in this map.
`GridCacheMapEntry` `putEntryIfObsoleteOrAbsent(AffinityTopologyVersion topVer, KeyCacheObject key, CacheObject val, boolean create, boolean touch)`
`boolean` `removeEntry(GridCacheEntryEx entry)` Removes passed in entry if it presents in the map.
`int` `size()` Returns the number of key-value mappings in this map.

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

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

### Constructor Detail

#### GridNoStorageCacheMap

    public GridNoStorageCacheMap(GridCacheContext ctx)

Parameters:
  `ctx` - Cache context.

### Method Detail

#### getEntry

    @Nullable
    public GridCacheMapEntry getEntry(KeyCacheObject key)

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

Specified by:
  `getEntry` in interface `GridCacheConcurrentMap`
Parameters:
  `key` - Key.
Returns:
  Entry.

#### putEntryIfObsoleteOrAbsent

    public GridCacheMapEntry putEntryIfObsoleteOrAbsent(AffinityTopologyVersion topVer,
                                               KeyCacheObject key,
                                               @Nullable
                                               CacheObject val,
                                               boolean create,
                                               boolean touch)

Specified by:
  `putEntryIfObsoleteOrAbsent` in interface `GridCacheConcurrentMap`
Parameters:
  `topVer` - Topology version.
  `key` - Key.
  `val` - Value.
  `create` - Create flag.
Returns:
  Existing or new GridCacheMapEntry. Will return `null` if entry is obsolete or absent and create flag is set to `false`. Will also return `null` if create flag is set to `true`, but entry couldn't be created.

#### removeEntry

    public boolean removeEntry(GridCacheEntryEx entry)

Removes passed in entry if it presents in the map.

Specified by:
  `removeEntry` in interface `GridCacheConcurrentMap`
Parameters:
  `entry` - Entry to remove.
Returns:
  `True` if remove happened.

#### size

    public int size()

Returns the number of key-value mappings in this map. It does not include entries from underlying data store.

Specified by:
  `size` in interface `GridCacheConcurrentMap`
Returns:
  the number of key-value mappings in this map.

#### publicSize

    public int publicSize()

Returns the number of publicly available key-value mappings in this map. It excludes entries that are marked as deleted. It also does not include entries from underlying data store.

Specified by:
  `publicSize` in interface `GridCacheConcurrentMap`
Returns:
  the number of publicly available key-value mappings in this map.

#### incrementPublicSize

    public void incrementPublicSize(GridCacheEntryEx e)

Increments public size.

Specified by:
  `incrementPublicSize` in interface `GridCacheConcurrentMap`
Parameters:
  `e` - Entry that caused public size change.

#### decrementPublicSize

    public void decrementPublicSize(GridCacheEntryEx e)

Decrements public size.

Specified by:
  `decrementPublicSize` in interface `GridCacheConcurrentMap`
Parameters:
  `e` - Entry that caused public size change.

#### keySet

    public Set<KeyCacheObject> keySet(CacheEntryPredicate... filter)

Specified by:
  `keySet` in interface `GridCacheConcurrentMap`
Returns:
  Random entry out of hash map.

#### entries

    public Iterable<GridCacheMapEntry> entries(CacheEntryPredicate... filter)

Specified by:
  `entries` in interface `GridCacheConcurrentMap`
Parameters:
  `filter` - Filter.
Returns:
  Iterable of the mappings contained in this map, excluding entries in unvisitable state.

#### allEntries

    public Iterable<GridCacheMapEntry> allEntries(CacheEntryPredicate... filter)

Specified by:
  `allEntries` in interface `GridCacheConcurrentMap`
Parameters:
  `filter` - Filter.
Returns:
  Iterable of the mappings contained in this map, including entries in unvisitable state.

#### entrySet

    public Set<GridCacheMapEntry> entrySet(CacheEntryPredicate... filter)

Specified by:
  `entrySet` in interface `GridCacheConcurrentMap`
Parameters:
  `filter` - Filter.
Returns:
  Set of the mappings contained in this map.

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.0.0
Release Date | : April 30 2017