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.

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.apache.ignite.internal.processors.cache.GridCacheConcurrentMap

`GridCacheConcurrentMap.CacheMapHolder`

### Constructor Summary

Constructors
Constructor and Description
`GridNoStorageCacheMap()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `decrementPublicSize(GridCacheConcurrentMap.CacheMapHolder hld, GridCacheEntryEx e)` Decrements public size.
`Iterable<GridCacheMapEntry>` `entries(int cacheId, CacheEntryPredicate... filter)`
`Set<GridCacheMapEntry>` `entrySet(int cacheId, CacheEntryPredicate... filter)`
`@Nullable GridCacheMapEntry` `getEntry(GridCacheContext ctx, KeyCacheObject key)` Returns the entry associated with the specified key in the HashMap.
`void` `incrementPublicSize(GridCacheConcurrentMap.CacheMapHolder hld, GridCacheEntryEx e)` Increments public size.
`int` `internalSize()` Returns the number of key-value mappings in this map.
`int` `publicSize(int cacheId)` Returns the number of publicly available key-value mappings in this map.
`GridCacheMapEntry` `putEntryIfObsoleteOrAbsent(GridCacheContext ctx, AffinityTopologyVersion topVer, KeyCacheObject key, boolean create, boolean skipReserve)`
`boolean` `removeEntry(GridCacheEntryEx entry)` Removes passed in entry if it presents in the map.

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

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

### Constructor Detail

#### GridNoStorageCacheMap

    public GridNoStorageCacheMap()

### Method Detail

#### getEntry

    @Nullable
    public @Nullable GridCacheMapEntry getEntry(GridCacheContext ctx,
                                                          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:
  `ctx` - Cache context.
  `key` - Key.
Returns:
  Entry.

#### putEntryIfObsoleteOrAbsent

    public GridCacheMapEntry putEntryIfObsoleteOrAbsent(GridCacheContext ctx,
                                                        AffinityTopologyVersion topVer,
                                                        KeyCacheObject key,
                                                        boolean create,
                                                        boolean skipReserve)

Specified by:
  `putEntryIfObsoleteOrAbsent` in interface `GridCacheConcurrentMap`
Parameters:
  `ctx` - Cache context.
  `topVer` - Topology version.
  `key` - Key.
  `create` - Create flag.
  `skipReserve` - Skip partition reservation 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.

#### internalSize

    public int internalSize()

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

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

#### publicSize

    public int publicSize(int cacheId)

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`
Parameters:
  `cacheId` - Cache ID.
Returns:
  the number of publicly available key-value mappings in this map.

#### incrementPublicSize

    public void incrementPublicSize(GridCacheConcurrentMap.CacheMapHolder hld,
                                    GridCacheEntryEx e)

Increments public size.

Specified by:
  `incrementPublicSize` in interface `GridCacheConcurrentMap`
Parameters:
  `hld` - Cache map (passed as optimization to avoid cache map lookup for shared groups).
  `e` - Entry that caused public size change.

#### decrementPublicSize

    public void decrementPublicSize(GridCacheConcurrentMap.CacheMapHolder hld,
                                    GridCacheEntryEx e)

Decrements public size.

Specified by:
  `decrementPublicSize` in interface `GridCacheConcurrentMap`
Parameters:
  `hld` - Cache map (passed as optimization to avoid cache map lookup for shared groups).
  `e` - Entry that caused public size change.

#### entries

    public Iterable<GridCacheMapEntry> entries(int cacheId,
                                               CacheEntryPredicate... filter)

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

#### entrySet

    public Set<GridCacheMapEntry> entrySet(int cacheId,
                                           CacheEntryPredicate... filter)

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

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.11.1
Release Date | : December 20 2021