/** returns true if this object uses a least-recently-used algorithm */ public boolean isLRU() { return this.isLRUEntry() || this.isLRUMemory() || this.isLRUHeap(); }
/** returns true if this object uses a least-recently-used algorithm */ public boolean isLRU() { return this.isLRUEntry() || this.isLRUMemory() || this.isLRUHeap(); }
else if (algorithm.isLRUMemory()) { return EvictionAttributes.createLRUMemoryAttributes(
out.writeObject(attributes.getAction()); else if (algorithm.isLRUMemory()) { out.writeObject(Integer.valueOf(attributes.getMaximum())); out.writeObject(attributes.getObjectSizer());
public Object call() throws Exception { try { final PartitionedRegion pr = (PartitionedRegion)getRootRegion(name); assertNotNull(pr); long entriesEvicted = 0; for (final Iterator i = pr.getDataStore().getAllLocalBuckets() .iterator(); i.hasNext();) { final Map.Entry entry = (Map.Entry)i.next(); final BucketRegion bucketRegion = (BucketRegion)entry.getValue(); if (bucketRegion == null) { continue; } assertTrue(bucketRegion.getAttributes().getEvictionAttributes() .getAlgorithm().isLRUMemory()); assertTrue(bucketRegion.getAttributes().getEvictionAttributes() .getAction().isLocalDestroy()); } entriesEvicted = ((AbstractLRURegionMap)pr.entries)._getLruList().stats() .getEvictions(); return new Long(entriesEvicted); } finally { } } };
EvictionAlgorithm algorithm = info.evictionAttr.getAlgorithm(); expectedValue = null; if (algorithm.isLRUEntry() || algorithm.isLRUMemory()) { expectedValue = info.evictionAttr.getMaximum(); expectedInToString.add("maximum=" + expectedValue);
public Object call() throws Exception { final PartitionedRegion pr = (PartitionedRegion)getRootRegion(name); assertNotNull(pr); assertNull(pr.getDiskRegion()); assertNotNull(pr.getEvictionController()); // assert over-flow behavior in local buckets and number of // entries // overflowed long entriesEvicted = 0; for (final Iterator i = pr.getDataStore().getAllLocalBuckets() .iterator(); i.hasNext();) { final Map.Entry entry = (Map.Entry)i.next(); final BucketRegion bucketRegion = (BucketRegion)entry.getValue(); if (bucketRegion == null) { continue; } assertTrue(bucketRegion.getAttributes().getEvictionAttributes() .getAlgorithm().isLRUMemory()); assertTrue(bucketRegion.getAttributes().getEvictionAttributes() .getAction().isOverflowToDisk()); } entriesEvicted += pr.getDiskRegionStats().getNumOverflowOnDisk(); return new Long(entriesEvicted); } };
/** Hydra CLOSETASK to verify that eviction occurred in rebalancing eviction tests. */ public static void HydraTask_verifyEviction() { double numEvictions = 0; Cache myCache = CacheHelper.getCache(); Set regions = myCache.rootRegions(); for (Iterator iter = regions.iterator(); iter.hasNext(); ) { Region aRegion = (Region)iter.next(); EvictionAlgorithm ea = aRegion.getAttributes().getEvictionAttributes().getAlgorithm(); if (ea.isLRUEntry()) { numEvictions = TestHelper.getNumLRUEvictions(); } else if (ea.isLRUMemory()) { numEvictions = getNumMemLRUEvictions(); } else if (ea.isLRUHeap()) { numEvictions = TestHelper.getNumHeapLRUEvictions(); } else { throw new TestException("TestConfig issue: verifyEviction requires that the region have eviction enabled"); } } if (numEvictions > 0) { Log.getLogWriter().info("Total evictions = " + numEvictions); } else { throw new TestException("Tuning required: no evictions recorded"); } }
private void initialize(Region region) { setNumberOfEntries(region.size()); EvictionAttributes ea = region.getAttributes().getEvictionAttributes(); if (ea != null && ea.getAlgorithm().isLRUMemory()) { LocalRegion lr = (LocalRegion) region; LRUStatistics stats = ((AbstractLRURegionMap) lr.getRegionMap())._getLruList().stats(); setHeapSize(stats.getCounter()); } else { setHeapSize(-1); } }
private void initialize(Region region) { setNumberOfEntries(region.size()); EvictionAttributes ea = region.getAttributes().getEvictionAttributes(); if (ea != null && ea.getAlgorithm().isLRUMemory()) { LocalRegion lr = (LocalRegion) region; LRUStatistics stats = ((AbstractLRURegionMap) lr.getRegionMap())._getLruList().stats(); setHeapSize(stats.getCounter()); } else { setHeapSize(-1); } }
/** Verify eviction (both for all entries in the cache and for the last operation */ protected void verifyEviction() { if (aRegion.getAttributes().getEvictionAttributes().getAlgorithm().isLRUMemory()) { if (aRegion.getAttributes().getDataPolicy().withPartitioning()) { // have memLRU eviction with PR long numBytesInVM = checkMemLRULevelForPR(); //xxxcheckEviction(); add in once Darrel gets product changes checked in saveEvictionStats(numBytesInVM); } else { throw new TestException("Test validation not supported for " + aRegion.getAttributes().getDataPolicy()); } } else { throw new TestException("Test validation not supported for " + aRegion.getAttributes().getEvictionAttributes().getAlgorithm()); } }
isMemLRU = evAttr.getAlgorithm().isLRUMemory(); if (isMemLRU) { Object sampleValue = getNewValue(getFixedLengthKeyForName("Object_1"));
: EvictionAction.OVERFLOW_TO_DISK)); else if (evictionAlgorithm.isLRUMemory()) { factory.setEvictionAttributes(EvictionAttributes .createLRUMemoryAttributes(maxSizeInMb, sizer,
if (ea.isLRUMemory()) { ((MemLRUCapacityController) ec).setEntryOverHead(getEntryOverHead());
: EvictionAction.OVERFLOW_TO_DISK)); else if (evictionAlgorithm.isLRUMemory()) { factory.setEvictionAttributes(EvictionAttributes .createLRUMemoryAttributes(maxSizeInMb, new ObjectSizerImpl(),
if (ea.isLRUMemory()) { ((MemLRUCapacityController) ec).setEntryOverHead(getEntryOverHead());
regionMonitor.addStatisticsToMonitor(stats.getStats()); EvictionAttributes ea = region.getAttributes().getEvictionAttributes(); if (ea != null && ea.getAlgorithm().isLRUMemory()) { this.lruMemoryStats = stats;
regionMonitor.addStatisticsToMonitor(stats.getStats()); EvictionAttributes ea = region.getAttributes().getEvictionAttributes(); if (ea != null && ea.getAlgorithm().isLRUMemory()) { this.lruMemoryStats = stats;
&& attrs.getEvictionAttributes().getAlgorithm().isLRUMemory() && attrs.getPartitionAttributes().getLocalMaxMemory() != 0 && attrs.getEvictionAttributes().getMaximum() != attrs
&& attrs.getEvictionAttributes().getAlgorithm().isLRUMemory() && attrs.getPartitionAttributes().getLocalMaxMemory() > 0 && attrs.getEvictionAttributes().getMaximum() != attrs.getPartitionAttributes().getLocalMaxMemory()) {