public LRUStatistics initStats(Object region, StatisticsFactory sf) { setRegionName(region); final LRUStatistics stats = new LRUStatistics(sf, getRegionName(), this); stats.setLimit( LRUAlgorithm.this.getLimit() ); stats.setDestroysLimit( 1000 ); setStats(stats); return stats; }
/** * In addition to initializing the statistics, create an evictor thread to * periodically evict the LRU entry. */ @Override public LRUStatistics initStats(Object region, StatisticsFactory sf) { setRegionName(region); final LRUStatistics stats = new HeapLRUStatistics(sf, getRegionName(), this); setStats(stats); return stats; }
private void initHeadAndTail() { //I'm not sure, but I think it's important that we //drop the references to the old head and tail on a region clear //That will prevent any concurrent operations that are messing //with existing nodes from screwing up the head and tail after //the clear. //Dan 9/23/09 this.head = new GuardNode(); this.tail = new GuardNode(); this.head.setNextLRUNode(this.tail); this.tail.setPrevLRUNode(this.head); this.size = 0; }
private long getSizeFromEvictionStats(LocalRegion region) { long result = region.getEvictionController().getLRUHelper().getStats().getCounter(); // region.getCache().getLogger().info("DEBUG evictionSize=" + result); return result; }
public boolean done() { return cc.getStats().getEvictions() > 0; }
@Override final boolean confirmEvictionDestroy(RegionEntry re) { // We assume here that a LRURegionMap contains LRUEntries LRUEntry lruRe = (LRUEntry) re; if (lruRe.isInUseByTransaction() || lruRe.isDestroyed()) { lruRe.unsetEvicted(); return false; } else { return true; } } }
public long getEntrySize() { if (lruMemoryStats != null) { return lruMemoryStats.getCounter(); } return ManagementConstants.NOT_AVAILABLE_LONG; }
/** * access the getHelper method on the eviction controller to initialize * the ccHelper field. * * @param ec The governing eviction controller. * @return the helper instance from the eviction controller. */ private static EnableLRU getHelper( LRUAlgorithm ec ) { return ec.getLRUHelper(); } @Override
/** * Returns a brief description of this capacity controller. * * @since 4.0 */ @Override public String toString() { return "MemLRUCapacityController with a capacity of " + this.getLimit() + " megabytes and and eviction action " + this.getEvictionAction(); } }
/** return the Entry that is considered least recently used. The entry will no longer * be in the pipe (unless it is the last empty marker). */ public LRUClockNode getLRUEntry() { return getLRUEntry(null); }
@Override public int hashCode() { int result = super.hashCode(); result += this.limit; return result; }
public HeapLRUCapacityController(ObjectSizer sizerImpl,EvictionAction evictionAction, Region region) { super(evictionAction, region); setSizer(sizerImpl); } // ///////////////////// Instance Methods ///////////////////////
/** * Return the size of an object as stored in GemFire... Typically * this is the serialized size in bytes.. This implementation is * slow.... Need to add Sizer interface and call it for customer * objects. */ protected int sizeof( Object o ) throws IllegalArgumentException { return basicSizeof(o, this.sizer); }
public void setMaximum(int maximum) { this.maximum = maximum; if (this.evictionController != null) { this.evictionController.setLimit(this.maximum); } }
public LRUStatistics initStats(Object region, StatisticsFactory sf) { setRegionName(region); final LRUStatistics stats = new LRUStatistics(sf, getRegionName(), this); stats.setLimit( LRUAlgorithm.this.getLimit() ); stats.setDestroysLimit( 1000 ); setStats(stats); return stats; }
/** * In addition to initializing the statistics, create an evictor thread to * periodically evict the LRU entry. */ @Override public LRUStatistics initStats(Object region, StatisticsFactory sf) { setRegionName(region); final LRUStatistics stats = new HeapLRUStatistics(sf, getRegionName(), this); setStats(stats); return stats; }
private void initHeadAndTail() { //I'm not sure, but I think it's important that we //drop the references to the old head and tail on a region clear //That will prevent any concurrent operations that are messing //with existing nodes from screwing up the head and tail after //the clear. //Dan 9/23/09 this.head = new GuardNode(); this.tail = new GuardNode(); this.head.setNextLRUNode(this.tail); this.tail.setPrevLRUNode(this.head); this.size = 0; }
@Override public int hashCode() { int result = super.hashCode(); return result; }
public HeapLRUCapacityController(ObjectSizer sizerImpl,EvictionAction evictionAction, Region region) { super(evictionAction, region); setSizer(sizerImpl); } // ///////////////////// Instance Methods ///////////////////////
@Override public int hashCode() { int result = super.hashCode(); result += this.maximumEntries; return result; }