private final int getKeySize(Object key, EnableLRU capacityController) { final GemFireCacheImpl.StaticSystemCallbacks sysCb = GemFireCacheImpl.getInternalProductCallbacks(); if (sysCb == null || capacityController.getEvictionAlgorithm().isLRUEntry()) { return capacityController.entrySize(key, null); } else { int tries = 1; do { final int size = sysCb.entryKeySizeInBytes(key, this); if (size >= 0) { return size - ReflectionSingleObjectSizer.REFERENCE_SIZE; } if ((tries % MAX_READ_TRIES_YIELD) == 0) { Thread.yield(); } } while (tries++ <= MAX_READ_TRIES); throw sysCb.checkCacheForNullKeyValue("DiskLRU RegionEntry#getKeySize"); } } private void diskInitialize(RegionEntryContext context, Object value) {
public boolean done() { return cc.getStats().getEvictions() > 0; }
/** * Constructor for the LRUStatistics object * * @param name Description of the Parameter */ public LRUStatistics( StatisticsFactory factory, String name, EnableLRU helper) { String statName = helper.getStatisticsName() + "-" + name; stats = factory.createAtomicStatistics(helper.getStatisticsType(), statName); if(!helper.getEvictionAlgorithm().isLRUHeap()) { limitId = helper.getLimitStatId(); } destroysLimitId = helper.getDestroysLimitStatId(); counterId = helper.getCountStatId(); evictionsId = helper.getEvictionsStatId(); destroysId = helper.getDestroysStatId(); this.evaluationsId = helper.getEvaluationsStatId(); this.greedyReturnsId = helper.getGreedyReturnsStatId(); }
public final synchronized int updateEntrySize(EnableLRU capacityController, Object value) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize(getRawKey(), value); setEntrySize(newSize); int delta = newSize - oldSize; return delta; } private LRUClockNode nextLRU;
if (_getCCHelper().getEvictionAlgorithm().isLRUHeap()) { changeTotalEntrySize(delta); try { while (bytesToEvict > 0 && _getCCHelper().mustEvict(stats, _getOwner(), bytesToEvict)) { boolean evictFromThisRegion = true; if (HeapEvictor.EVICT_HIGH_ENTRY_COUNT_BUCKETS_FIRST && _getOwner() instanceof BucketRegion) { logger.trace(LogMarker.LRU, "evictions={}", stats.getEvictions()); _getCCHelper().afterEviction(); try { while (bytesToEvict > 0 && _getCCHelper().mustEvict(stats, _getOwner(), bytesToEvict)) { LRUEntry removalEntry = (LRUEntry)_getLruList().getLRUEntry(); if (removalEntry != null) { logger.trace(LogMarker.LRU, "evictions={}", stats.getEvictions()); _getCCHelper().afterEviction();
/** * Broken-out so that it can be overridden */ protected int handleLocalDestroy(LRUEntry entry) { assert _getCCHelper().getEvictionAction().isLocalDestroy(); int size = entry.getEntrySize(); if (_getOwner().evictDestroy(entry)) { return size; } else { return 0; } }
logger.debug("evictions={}", stats.getEvictions()); _getCCHelper().afterEviction();
public final synchronized int updateEntrySize(EnableLRU capacityController, Object value) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize(getRawKey(), value); setEntrySize(newSize); int delta = newSize - oldSize; return delta; } private LRUClockNode nextLRU;
if (_getCCHelper().getEvictionAlgorithm().isLRUHeap()) { changeTotalEntrySize(delta); final ArrayList<LRUClockNode> skipped = new ArrayList<>(2); while (bytesToEvict > 0 && _getCCHelper().mustEvict(stats, _getOwner(), bytesToEvict)) { boolean evictFromThisRegion = true; if (HeapEvictor.EVICT_HIGH_ENTRY_COUNT_BUCKETS_FIRST && owner instanceof BucketRegion) { _getCCHelper().afterEviction(); while (bytesToEvict > 0 && _getCCHelper().mustEvict(stats, _getOwner(), bytesToEvict)) { _getCCHelper().afterEviction();
EvictionAction action = _getCCHelper().getEvictionAction(); LocalRegion region = _getOwner(); if (action.isLocalDestroy()) {
if (debug) debugLogging("evictions=" + stats.getEvictions()); _getCCHelper().afterEviction();
private final int getKeySize(Object key, EnableLRU capacityController) { final GemFireCacheImpl.StaticSystemCallbacks sysCb = GemFireCacheImpl.getInternalProductCallbacks(); if (sysCb == null || capacityController.getEvictionAlgorithm().isLRUEntry()) { return capacityController.entrySize(key, null); } else { int tries = 1; do { final int size = sysCb.entryKeySizeInBytes(key, this); if (size >= 0) { return size - ReflectionSingleObjectSizer.REFERENCE_SIZE; } if ((tries % MAX_READ_TRIES_YIELD) == 0) { Thread.yield(); } } while (tries++ <= MAX_READ_TRIES); throw sysCb.checkCacheForNullKeyValue("DiskLRU RegionEntry#getKeySize"); } } private void diskInitialize(RegionEntryContext context, Object value) {
/** * Constructor for the LRUStatistics object * * @param name Description of the Parameter */ public LRUStatistics( StatisticsFactory factory, String name, EnableLRU helper) { regionName = name; String statName = helper.getStatisticsName() + "-" + name; stats = factory.createAtomicStatistics(helper.getStatisticsType(), statName); if(!helper.getEvictionAlgorithm().isLRUHeap()) { limitId = helper.getLimitStatId(); } destroysLimitId = helper.getDestroysLimitStatId(); counterId = helper.getCountStatId(); evictionsId = helper.getEvictionsStatId(); faultInsId = helper.getFaultInsStatId(); destroysId = helper.getDestroysStatId(); this.evaluationsId = helper.getEvaluationsStatId(); this.greedyReturnsId = helper.getGreedyReturnsStatId(); }
public final synchronized int updateEntrySize(EnableLRU capacityController, Object value) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize(getRawKey(), value); setEntrySize(newSize); int delta = newSize - oldSize; return delta; } private LRUClockNode nextLRU;
/** * Returns the <code>LRUStatistics</code> for the given region */ private LRUStatistics getLRUStats(Region region) { final LocalRegion l = (LocalRegion)region; return l.getEvictionController().getLRUHelper().getStats(); }
EvictionAction action = _getCCHelper().getEvictionAction(); LocalRegion region = _getOwner(); if (action.isLocalDestroy()) {
private final int getKeySize(Object key, EnableLRU capacityController) { final GemFireCacheImpl.StaticSystemCallbacks sysCb = GemFireCacheImpl.getInternalProductCallbacks(); if (sysCb == null || capacityController.getEvictionAlgorithm().isLRUEntry()) { return capacityController.entrySize(key, null); } else { int tries = 1; do { final int size = sysCb.entryKeySizeInBytes(key, this); if (size >= 0) { return size - ReflectionSingleObjectSizer.REFERENCE_SIZE; } if ((tries % MAX_READ_TRIES_YIELD) == 0) { Thread.yield(); } } while (tries++ <= MAX_READ_TRIES); throw sysCb.checkCacheForNullKeyValue("DiskLRU RegionEntry#getKeySize"); } } private void diskInitialize(RegionEntryContext context, Object value) {
@Override public final synchronized int updateAsyncEntrySize(EnableLRU capacityController) { int oldSize = getEntrySize(); int newSize = capacityController.entrySize( getKeyForSizing(), null); setEntrySize(newSize); int delta = newSize - oldSize; return delta; } // DO NOT modify this class. It was generated from LeafRegionEntry.cpp
/** * * @param region1 * @return */ protected LRUStatistics getLRUStats(Region region1) { return ((LocalRegion)region1).getEvictionController().getLRUHelper() .getStats(); }
private final int getKeySize(Object key, EnableLRU capacityController) { final GemFireCacheImpl.StaticSystemCallbacks sysCb = GemFireCacheImpl.getInternalProductCallbacks(); if (sysCb == null || capacityController.getEvictionAlgorithm().isLRUEntry()) { return capacityController.entrySize(key, null); } else { int tries = 1; do { final int size = sysCb.entryKeySizeInBytes(key, this); if (size >= 0) { return size - ReflectionSingleObjectSizer.REFERENCE_SIZE; } if ((tries % MAX_READ_TRIES_YIELD) == 0) { Thread.yield(); } } while (tries++ <= MAX_READ_TRIES); throw sysCb.checkCacheForNullKeyValue("DiskLRU RegionEntry#getKeySize"); } } private void diskInitialize(RegionEntryContext context, Object value) {