protected void invalidateCacheEntries(final Iterator<K> keys) { int examined = 0; int evicted = 0; while (keys.hasNext()) { K key = keys.next(); try { TimestampedValue<V> wrappedValue = data.get(key); if (wrappedValue == null) continue; examined++; int now = getTime(); if (wrappedValue.isExpired(now, config)) { evicted++; evict(key, wrappedValue, now); } } catch (Throwable t) { logger.error("Unhandled exception inspecting item for [" + key + "] for expiration", t); } } if (isStatisticsEnabled()) { statistics.increment(examined, evicted); } }
if (entry.isExpired(now, config)) { if (!ManagerUtil.isLockHeldByCurrentThread(lockId, Manager.LOCK_TYPE_READ)) { evict(key, entry, now);