/** * @return Set of internal cached entry representations. */ public final Iterable<? extends GridCacheEntryEx> allEntries() { return map.entries(ctx.cacheId()); }
/** * * @param key Entry key. */ public final void removeIfObsolete(KeyCacheObject key) { assert key != null; GridCacheMapEntry entry = map.getEntry(ctx, key); if (entry != null && entry.obsolete()) removeEntry(entry); }
/** * Decrements map public size. * * @param e Map entry. */ public void decrementSize(GridCacheMapEntry e) { map.decrementPublicSize(null, e); }
/** * @param key Entry key. * @param topVer Topology version at the time of creation. * @param create Flag to create entry if it does not exist. * @param touch Flag to touch created entry (only if entry was actually created). * @return Entry or <tt>null</tt>. */ @Nullable private GridCacheEntryEx entry0(KeyCacheObject key, AffinityTopologyVersion topVer, boolean create, boolean touch) { GridCacheMapEntry cur = map.getEntry(ctx, key); if (cur == null || cur.obsolete()) { cur = map.putEntryIfObsoleteOrAbsent( ctx, topVer, key, create, touch); } return cur; }
/** {@inheritDoc} */ @Override public int size() { return map.publicSize(ctx.cacheId()); }
/** {@inheritDoc} */ @Override public final Set<K> keySet() { return new KeySet(map.entrySet(ctx.cacheId())); }
/** * @param entry Removes entry from cache if currently mapped value is the same as passed. */ public final void removeEntry(GridCacheEntryEx entry) { boolean rmvd = map.removeEntry(entry); if (log.isDebugEnabled()) { if (rmvd) log.debug("Removed entry from cache: " + entry); else log.debug("Remove will not be done for key (entry got replaced or removed): " + entry.key()); } }
/** * @param topVer Topology version. * @param key Entry key. * @return Entry (never {@code null}). */ public GridCacheEntryEx entryEx(KeyCacheObject key, AffinityTopologyVersion topVer) { GridCacheEntryEx e = map.putEntryIfObsoleteOrAbsent(ctx, topVer, key, true, false); assert e != null; return e; }
/** * Increments map public size. * * @param e Map entry. */ public void incrementSize(GridCacheMapEntry e) { map.incrementPublicSize(null, e); }
int actual = colocated(i).map().internalSize();
/** * @param key Entry key. * @param topVer Topology version at the time of creation. * @param create Flag to create entry if it does not exist. * @param touch Flag to touch created entry (only if entry was actually created). * @return Entry or <tt>null</tt>. */ @Nullable private GridCacheEntryEx entry0(KeyCacheObject key, AffinityTopologyVersion topVer, boolean create, boolean touch) { GridCacheMapEntry cur = map.getEntry(ctx, key); if (cur == null || cur.obsolete()) { cur = map.putEntryIfObsoleteOrAbsent( ctx, topVer, key, create, touch); } return cur; }
/** {@inheritDoc} */ @Override public long sizeLong() { return map.publicSize(ctx.cacheId()); }
/** * @param filter Filters to evaluate. * @return Entry set. */ public Set<Cache.Entry<K, V>> entrySet(@Nullable CacheEntryPredicate... filter) { boolean keepBinary = ctx.keepBinary(); return new EntrySet(map.entrySet(ctx.cacheId(), filter), keepBinary); }
/** * @param entry Removes entry from cache if currently mapped value is the same as passed. */ public final void removeEntry(GridCacheEntryEx entry) { boolean rmvd = map.removeEntry(entry); if (log.isDebugEnabled()) { if (rmvd) log.debug("Removed entry from cache: " + entry); else log.debug("Remove will not be done for key (entry got replaced or removed): " + entry.key()); } }
/** * @param topVer Topology version. * @param key Entry key. * @return Entry (never {@code null}). */ public GridCacheEntryEx entryEx(KeyCacheObject key, AffinityTopologyVersion topVer) { GridCacheEntryEx e = map.putEntryIfObsoleteOrAbsent(ctx, topVer, key, true, false); assert e != null; return e; }
/** * Increments map public size. * * @param e Map entry. */ public void incrementSize(GridCacheMapEntry e) { map.incrementPublicSize(null, e); }
int actual = colocated(i).map().internalSize();
@Override public void applyx() { // Check that no more entries left in the map. assertNull(g.cache(DEFAULT_CACHE_NAME).get(key)); if (!g.internalCache(DEFAULT_CACHE_NAME).context().deferredDelete()) assertNull(g.internalCache(DEFAULT_CACHE_NAME).map().getEntry(g.internalCache(DEFAULT_CACHE_NAME).context(), g.internalCache(DEFAULT_CACHE_NAME).context().toCacheKeyObject(key))); } });
Iterator<GridCacheMapEntry> entries = cache.map().entries(cache.context().cacheId()).iterator();
/** {@inheritDoc} */ @Override public int primarySize() { return map.publicSize(ctx.cacheId()); }