/** * @param e Entry to evict if it qualifies for eviction. * @param obsoleteVer Obsolete version. * @return {@code True} if attempt was made to evict the entry. */ protected boolean evictNearEntry(GridCacheEntryEx<K, V> e, GridCacheVersion obsoleteVer) { assert e != null; assert obsoleteVer != null; if (isNearLocallyMapped(e)) { if (log.isDebugEnabled()) log.debug("Evicting dht-local entry from near cache [entry=" + e + ", tx=" + this + ']'); if (e.markObsolete(obsoleteVer, true)) return true; } return false; }
/** * @param e Transaction entry. * @return {@code True} if entry is locally mapped as a primary or back up node. */ protected boolean isNearLocallyMapped(GridCacheEntryEx<K, V> e) { return F.contains(ctx.affinity(e.key(), CU.allNodes(ctx)), ctx.localNode()); }