/** * * @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); }
/** {@inheritDoc} */ @Override public void touch(GridCacheEntryEx e) { if (e.detached()) return; try { boolean evicted = e.evictInternal(GridCacheVersionManager.EVICT_VER, null, false) || e.markObsoleteIfEmpty(null); if (evicted && !e.isDht()) // GridDhtCacheEntry removes entry when obsoleted. cctx.cache().removeEntry(e); } catch (IgniteCheckedException ex) { U.error(log, "Failed to evict entry from cache: " + e, ex); } }
reserved.context().cache().removeEntry(reserved);
onMarkedObsolete(); cctx.cache().removeEntry(this);
/** {@inheritDoc} */ @Override public void touch(IgniteTxEntry txEntry, boolean loc) { assert txEntry.context() == cctx : "Entry from another cache context passed to eviction manager: [" + "entry=" + txEntry + ", cctx=" + cctx + ", entryCtx=" + txEntry.context() + "]"; if (!plcEnabled) return; if (!loc) { if (cctx.isNear()) return; } GridCacheEntryEx e = txEntry.cached(); if (e.detached() || e.isInternal()) return; try { if (e.markObsoleteIfEmpty(null) || e.obsolete()) e.context().cache().removeEntry(e); } catch (IgniteCheckedException ex) { U.error(log, "Failed to evict entry from cache: " + e, ex); } notifyPolicy(e); }
onMarkedObsolete(); cctx.cache().removeEntry(this);
cctx.cache().removeEntry(this); // Clear cache.
/** {@inheritDoc} */ @Override public void touch(GridCacheEntryEx e) { assert e.context() == cctx : "Entry from another cache context passed to eviction manager: [" + "entry=" + e + ", cctx=" + cctx + ", entryCtx=" + e.context() + "]"; if (e.detached() || e.isInternal()) return; try { if (e.markObsoleteIfEmpty(null) || e.obsolete()) e.context().cache().removeEntry(e); } catch (IgniteCheckedException ex) { U.error(log, "Failed to evict entry from cache: " + e, ex); } if (!plcEnabled) return; if (!enterBusy()) return; try { if (log.isDebugEnabled()) log.debug("Touching entry [entry=" + e + ", localNode=" + cctx.nodeId() + ']'); notifyPolicy(e); } finally { busyLock.leaveBusy(); } }
/** {@inheritDoc} */ @Override public IgnitePair<Long> call(Ignite ignite, IgniteCache<String, Integer> cache) throws Exception { GridCacheAdapter<?, ?> internalCache = internalCache0(cache); if (internalCache.context().isNear()) internalCache = internalCache.context().near().dht(); GridCacheEntryEx entry = internalCache.entryEx(key); entry.unswap(); if (!entry.hasValue()) { assertEquals(0, entry.ttl()); assertEquals(0, entry.expireTime()); return null; } IgnitePair<Long> pair = new IgnitePair<>(entry.ttl(), entry.expireTime()); if (!entry.isNear()) entry.context().cache().removeEntry(entry); return pair; } }
cctx.cache().removeEntry(this); // Clear cache.
notifyPolicy(entry); cache.removeEntry(entry);
/** {@inheritDoc} */ @Override public IgnitePair<Long> call(Ignite ignite, IgniteCache<String, Integer> cache) throws Exception { GridCacheAdapter<?, ?> internalCache = internalCache0(cache); if (useDhtForNearCache && internalCache.context().isNear()) internalCache = internalCache.context().near().dht(); GridCacheEntryEx entry = internalCache.entryEx(key); entry.unswap(); IgnitePair<Long> pair = new IgnitePair<>(entry.ttl(), entry.expireTime()); if (!entry.isNear()) entry.context().cache().removeEntry(entry); return pair; } }
onMarkedObsolete(); cctx.cache().removeEntry(this);
onMarkedObsolete(); cctx.cache().removeEntry(this);
removeEntry(entry);
/** * @param tx Transaction. */ private void removeObsolete(IgniteInternalTx tx) { Collection<IgniteTxEntry> entries = tx.local() ? tx.allEntries() : tx.writeEntries(); for (IgniteTxEntry entry : entries) { GridCacheEntryEx cached = entry.cached(); GridCacheContext cacheCtx = entry.context(); if (cached == null) cached = cacheCtx.cache().peekEx(entry.key()); if (cached.detached()) continue; try { if (cached.obsolete() || cached.markObsoleteIfEmpty(tx.xidVersion())) cacheCtx.cache().removeEntry(cached); if (!tx.near() && isNearEnabled(cacheCtx)) { GridNearCacheAdapter near = cacheCtx.isNear() ? cacheCtx.near() : cacheCtx.dht().near(); GridNearCacheEntry e = near.peekExx(entry.key()); if (e != null && e.markObsoleteIfEmpty(null)) near.removeEntry(e); } } catch (IgniteCheckedException e) { U.error(log, "Failed to remove obsolete entry from cache: " + cached, e); } } }
if (cacheCtx.affinity().partitionBelongs(cacheCtx.localNode(), entry.partition(), topVer)) { if (entry.markObsolete(xidVer)) cacheCtx.cache().removeEntry(entry);
onMarkedObsolete(); cctx.cache().removeEntry(this);
/** * * @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); }
/** {@inheritDoc} */ @Override public void touch(GridCacheEntryEx e, AffinityTopologyVersion topVer) { if (e.detached()) return; try { boolean evicted = e.evictInternal(GridCacheVersionManager.EVICT_VER, null, false) || e.markObsoleteIfEmpty(null); if (evicted && !e.isDht()) // GridDhtCacheEntry removes entry when obsoleted. cctx.cache().removeEntry(e); } catch (IgniteCheckedException ex) { U.error(log, "Failed to evict entry from cache: " + e, ex); } }