assertEquals(0, map.size()); assertEquals(false, map.isFull()); assertEquals(2, map.maxSize()); assertEquals(2, map.maxSize()); assertEquals(2, map.maxSize()); it = map.keySet().iterator(); assertSame(keys[0], it.next()); assertEquals(2, map.size()); assertEquals(true, map.isFull()); assertEquals(2, map.maxSize()); it = map.keySet().iterator(); assertSame(keys[1], it.next()); assertEquals(2, map.size()); assertEquals(true, map.isFull()); assertEquals(2, map.maxSize()); it = map.keySet().iterator(); assertSame(keys[1], it.next()); assertEquals(2, map.size()); assertEquals(true, map.isFull()); assertEquals(2, map.maxSize()); it = map.keySet().iterator(); assertSame(keys[2], it.next());
@Override public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env) { TransformingIterator copy; try { copy = getClass().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } copy.setSource(getSource().deepCopy(env)); copy.scanning = scanning; copy.keyPos = keyPos; copy.keys.addAll(keys); copy.seekRange = (seekRange == null) ? null : new Range(seekRange); copy.seekColumnFamilies = (seekColumnFamilies == null) ? null : new HashSet<>(seekColumnFamilies); copy.seekColumnFamiliesInclusive = seekColumnFamiliesInclusive; copy.ve = ve; if (visibleCache != null) { copy.visibleCache = new LRUMap(visibleCache.maxSize()); copy.visibleCache.putAll(visibleCache); } if (parsedVisibilitiesCache != null) { copy.parsedVisibilitiesCache = new LRUMap(parsedVisibilitiesCache.maxSize()); copy.parsedVisibilitiesCache.putAll(parsedVisibilitiesCache); } copy.maxBufferSize = maxBufferSize; return copy; }
/** * Returns maximum allowed cache size. */ public int maximumSize() { return snapshots.maxSize(); }
/** * Returns maximum allowed cache size. */ public int maximumSize() { return snapshots.maxSize(); }
public int maxSize() { return (_max == -1) ? super.maxSize() : _max; }
public int maxSize() { return (_max == -1) ? super.maxSize() : _max; }
public int maxSize() { return (_max == -1) ? super.maxSize() : _max; }
public int maxSize() { return (_max == -1) ? super.maxSize() : _max; }
/** * Returns the max costs for all items within a monitored object.<p> * * <code>obj</code> must be of type {@link CmsLruCache} or {@link LRUMap}.<p> * * @param obj the object * * @return max cost limit or "-" */ protected String getLimit(Object obj) { if (obj instanceof CmsLruCache) { return Long.toString(((CmsLruCache)obj).getMaxCacheCosts()); } if (obj instanceof LRUMap) { return Integer.toString(((LRUMap)obj).maxSize()); } return "-"; }
/** * Returns the max costs for all items within a monitored object.<p> * * <code>obj</code> must be of type {@link CmsLruCache} or {@link LRUMap}.<p> * * @param obj the object * * @return max cost limit or "-" */ protected String getLimit(Object obj) { if (obj instanceof CmsLruCache) { return Long.toString(((CmsLruCache)obj).getMaxCacheCosts()); } if (obj instanceof LRUMap) { return Integer.toString(((LRUMap)obj).maxSize()); } return "-"; }
statistics.append("/").append(docNumbers[0].maxSize() * CACHE_SEGMENTS); statistics.append(", #accesses=").append(accesses); statistics.append(", #hits=").append((accesses - misses));
statistics.append("/").append(docNumbers[0].maxSize() * CACHE_SEGMENTS); statistics.append(", #accesses=").append(accesses); statistics.append(", #hits=").append((accesses - misses));
statistics.append("/").append(docNumbers[0].maxSize() * CACHE_SEGMENTS); statistics.append(", #accesses=").append(accesses); statistics.append(", #hits=").append((accesses - misses));
@Override public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env) { TransformingIterator copy; try { copy = getClass().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } copy.setSource(getSource().deepCopy(env)); copy.scanning = scanning; copy.keyPos = keyPos; copy.keys.addAll(keys); copy.seekRange = (seekRange == null) ? null : new Range(seekRange); copy.seekColumnFamilies = (seekColumnFamilies == null) ? null : new HashSet<>(seekColumnFamilies); copy.seekColumnFamiliesInclusive = seekColumnFamiliesInclusive; copy.ve = ve; if (visibleCache != null) { copy.visibleCache = new LRUMap(visibleCache.maxSize()); copy.visibleCache.putAll(visibleCache); } if (parsedVisibilitiesCache != null) { copy.parsedVisibilitiesCache = new LRUMap(parsedVisibilitiesCache.maxSize()); copy.parsedVisibilitiesCache.putAll(parsedVisibilitiesCache); } copy.maxBufferSize = maxBufferSize; return copy; }