Interface GridCacheConcurrentMap
-
- All Known Implementing Classes:
GridCacheConcurrentMapImpl,GridCacheLocalConcurrentMap,GridCachePartitionedConcurrentMap,GridDhtLocalPartition,GridNoStorageCacheMap
public interface GridCacheConcurrentMapConcurrent cache map.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classGridCacheConcurrentMap.CacheMapHolder
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddecrementPublicSize(@Nullable 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(@Nullable 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 @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.- Parameters:
ctx- Cache context.key- Key.- Returns:
- Entry.
-
putEntryIfObsoleteOrAbsent
GridCacheMapEntry putEntryIfObsoleteOrAbsent(GridCacheContext ctx, AffinityTopologyVersion topVer, KeyCacheObject key, boolean create, boolean skipReserve)
- 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
boolean removeEntry(GridCacheEntryEx entry)
Removes passed in entry if it presents in the map.- Parameters:
entry- Entry to remove.- Returns:
Trueif remove happened.
-
internalSize
int internalSize()
Returns the number of key-value mappings in this map. It does not include entries from underlying data store.- Returns:
- the number of key-value mappings in this map.
-
publicSize
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.- Parameters:
cacheId- Cache ID.- Returns:
- the number of publicly available key-value mappings in this map.
-
incrementPublicSize
void incrementPublicSize(@Nullable @Nullable GridCacheConcurrentMap.CacheMapHolder hld, GridCacheEntryEx e)Increments public size.- Parameters:
e- Entry that caused public size change.hld- Cache map (passed as optimization to avoid cache map lookup for shared groups).
-
decrementPublicSize
void decrementPublicSize(@Nullable @Nullable GridCacheConcurrentMap.CacheMapHolder hld, GridCacheEntryEx e)Decrements public size.- Parameters:
e- Entry that caused public size change.hld- Cache map (passed as optimization to avoid cache map lookup for shared groups).
-
entries
Iterable<GridCacheMapEntry> entries(int cacheId, CacheEntryPredicate... filter)
- Parameters:
cacheId- Cache ID.filter- Filter.- Returns:
- Iterable of the mappings contained in this map, excluding entries in unvisitable state.
-
entrySet
Set<GridCacheMapEntry> entrySet(int cacheId, CacheEntryPredicate... filter)
- Parameters:
cacheId- Cache ID.filter- Filter.- Returns:
- Set of the mappings contained in this map.
-
-