private TimestampedValue<V> newEntry(final V value) { if (value instanceof TimestampedValue) return (TimestampedValue<V>) value; return new DefaultTimestampedValue<V>(value, getTime()); }
private TimestampedValue<V> newEntry(final V value) { if (value instanceof TimestampedValue) return (TimestampedValue<V>) value; return new DefaultTimestampedValue<V>(value, getTime()); }
private TimestampedValue<V> newEntry(final V value) { if (value instanceof TimestampedValue) return (TimestampedValue<V>) value; return new DefaultTimestampedValue<V>(value, getTime()); }
private V getValueSafe(final TimestampedValue<V> entry) { return entry == null ? null : entry.isExpired(getTime(), config) ? null : entry.getValue(); }
private V getValueSafe(final TimestampedValue<V> entry) { return entry == null ? null : entry.isExpired(getTime(), config) ? null : entry.getValue(); }
private V getValueSafe(final TimestampedValue<V> entry) { return entry == null ? null : entry.isExpired(getTime(), config) ? null : entry.getValue(); }
private void invalidateCacheEntries() { int totalCnt = 0; int evaled = 0; Iterator<Entry<K, TimestampedValue<V>>> entryIter = data.entrySet().iterator(); while (entryIter.hasNext()) { Map.Entry<K, TimestampedValue<V>> entry = entryIter.next(); TimestampedValue tsEntry = entry.getValue(); if (tsEntry == null) continue; totalCnt++; if (tsEntry.isExpired(getTime(), config)) { evaled++; entryIter.remove(); } } if (isStatisticsEnabled()) { statistics.increment(totalCnt, evaled); } }
private void invalidateCacheEntries() { int totalCnt = 0; int evaled = 0; Iterator<Entry<K, TimestampedValue<V>>> entryIter = data.entrySet().iterator(); while (entryIter.hasNext()) { Map.Entry<K, TimestampedValue<V>> entry = entryIter.next(); TimestampedValue tsEntry = entry.getValue(); if (tsEntry == null) continue; totalCnt++; if (tsEntry.isExpired(getTime(), config)) { evaled++; entryIter.remove(); } } if (isStatisticsEnabled()) { statistics.increment(totalCnt, evaled); } }
private void invalidateCacheEntries() { int totalCnt = 0; int evaled = 0; int notEvaled = 0; int errors = 0; Iterator<Entry<K, TimestampedValue<V>>> entryIter = data.entrySet().iterator(); while (entryIter.hasNext()) { Map.Entry<K, TimestampedValue<V>> entry = entryIter.next(); try { TimestampedValue tsEntry = entry.getValue(); if (tsEntry == null) continue; totalCnt++; if (tsEntry.isExpired(getTime(), config)) { evaled++; entryIter.remove(); } else { notEvaled++; } } catch (Throwable t) { errors++; } } if (isStatisticsEnabled()) { statistics.increment(totalCnt, evaled); } }
private void checkExpired(final Object key, final boolean markUsed) { TimestampedValue<V> entry = this.data.get(key); if (null == entry) return; if (isEvictionEnabled()) { int now = getTime(); if (entry.isExpired(now, config)) { removeNoReturn(key); } else if (markUsed) { entry.markUsed(now, null, config); } } }
private void checkExpired(final Object key, final boolean markUsed) { TimestampedValue<V> entry = this.data.get(key); if (null == entry) return; if (isEvictionEnabled()) { int now = getTime(); if (entry.isExpired(now, config)) { removeNoReturn(key); } else if (markUsed) { entry.markUsed(now, null, config); } } }
private void checkExpired(final Object key, final boolean markUsed) { TimestampedValue<V> entry = this.data.get(key); if (null == entry) return; if (isEvictionEnabled()) { int now = getTime(); if (entry.isExpired(now, config)) { removeNoReturn(key); } else if (markUsed) { entry.markUsed(now, null, config); } } }