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 Description GridNoStorageCacheMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecrementPublicSize(GridCacheConcurrentMap.CacheMapHolder hld, GridCacheEntryEx e)Decrements public size.Iterable<GridCacheMapEntry>entries(int cacheId, CacheEntryPredicate... filter)Set<GridCacheMapEntry>entrySet(int cacheId, CacheEntryPredicate... filter)@Nullable GridCacheMapEntrygetEntry(GridCacheContext ctx, KeyCacheObject key)Returns the entry associated with the specified key in the HashMap.voidincrementPublicSize(GridCacheConcurrentMap.CacheMapHolder hld, GridCacheEntryEx e)Increments public size.intinternalSize()Returns the number of key-value mappings in this map.intpublicSize(int cacheId)Returns the number of publicly available key-value mappings in this map.GridCacheMapEntryputEntryIfObsoleteOrAbsent(GridCacheContext ctx, AffinityTopologyVersion topVer, KeyCacheObject key, boolean create, boolean skipReserve)booleanremoveEntry(GridCacheEntryEx entry)Removes passed in entry if it presents in the map.
-
-
-
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:
getEntryin interfaceGridCacheConcurrentMap- Parameters:
ctx- Cache context.key- Key.- Returns:
- Entry.
-
putEntryIfObsoleteOrAbsent
public GridCacheMapEntry putEntryIfObsoleteOrAbsent(GridCacheContext ctx, AffinityTopologyVersion topVer, KeyCacheObject key, boolean create, boolean skipReserve)
- Specified by:
putEntryIfObsoleteOrAbsentin interfaceGridCacheConcurrentMap- Parameters:
ctx- Cache context.topVer- Topology version.key- Key.create- Create flag.skipReserve- Skip partition reservation flag.- Returns:
- Existing or new GridCacheMapEntry. Will return
nullif entry is obsolete or absent and create flag is set tofalse. Will also returnnullif create flag is set totrue, but entry couldn't be created.
-
removeEntry
public boolean removeEntry(GridCacheEntryEx entry)
Removes passed in entry if it presents in the map.- Specified by:
removeEntryin interfaceGridCacheConcurrentMap- Parameters:
entry- Entry to remove.- Returns:
Trueif 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:
internalSizein interfaceGridCacheConcurrentMap- 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:
publicSizein interfaceGridCacheConcurrentMap- 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:
incrementPublicSizein interfaceGridCacheConcurrentMap- 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:
decrementPublicSizein interfaceGridCacheConcurrentMap- 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:
entriesin interfaceGridCacheConcurrentMap- 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:
entrySetin interfaceGridCacheConcurrentMap- Parameters:
cacheId- Cache ID.filter- Filter.- Returns:
- Set of the mappings contained in this map.
-
-