public String toString() { StringBuffer aStr = new StringBuffer(); aStr.append(super.toString() + "\n"); aStr.append(" entry evictor settings:\n"); aStr.append(" maximumEntries (in test instance): " + maximumEntries + "\n"); aStr.append(" maximumEntries (in evictor attr) : " + (CacheUtil.getRegion(REGION_NAME).getAttributes().getEvictionAttributes().getMaximum()) + "\n"); aStr.append(" Region limits:\n"); aStr.append(" lowestAllowableEntries: " + lowestAllowableEntries + "\n"); aStr.append(" highestAllowableEntries: " + highestAllowableEntries + "\n"); return aStr.toString(); }
@Override public final int hashCode() { return this.getAlgorithm().hashCode() ^ this.getMaximum(); }
@Override public String toString() { final StringBuilder buffer = new StringBuilder(128); buffer.append(" algorithm=").append(this.getAlgorithm()); if (!this.getAlgorithm().isNone()) { buffer.append("; action=").append(this.getAction()); if (!getAlgorithm().isLRUHeap()) { buffer.append("; maximum=").append(this.getMaximum()); } if (this.getObjectSizer() != null) { buffer.append("; sizer=").append(this.getObjectSizer()); } } return buffer.toString(); }
@Override public void run() { RegionAttributes attributes = getCache().getRegion(alterRegionName).getAttributes(); assertEquals(6963, attributes.getEvictionAttributes().getMaximum()); } });
@Override public void run() { RegionAttributes attributes = getCache().getRegion(alterRegionName).getAttributes(); assertEquals(5764, attributes.getEvictionAttributes().getMaximum()); } });
@Override public void run() { RegionAttributes attributes = getCache().getRegion(alterRegionName).getAttributes(); assertEquals(5764, attributes.getEvictionAttributes().getMaximum()); } });
@Override public void run() { RegionAttributes attributes = getCache().getRegion(alterRegionName).getAttributes(); assertEquals(5764, attributes.getEvictionAttributes().getMaximum()); } });
public EvictionAttributesInfo(EvictionAttributes ea) { EvictionAction evictAction = ea.getAction(); if (evictAction != null) { evictionAction = evictAction.toString(); } EvictionAlgorithm evictionAlgo = ea.getAlgorithm(); if (evictionAlgo != null){ evictionAlgorithm = evictionAlgo.toString(); } if (!EvictionAlgorithm.LRU_HEAP.equals(evictionAlgo)) { evictionMaxValue = ea.getMaximum(); } }
public EvictionAttributesInfo(EvictionAttributes ea) { EvictionAction evictAction = ea.getAction(); if (evictAction != null) { evictionAction = evictAction.toString(); } EvictionAlgorithm evictionAlgo = ea.getAlgorithm(); if (evictionAlgo != null){ evictionAlgorithm = evictionAlgo.toString(); } if (!EvictionAlgorithm.LRU_HEAP.equals(evictionAlgo)) { evictionMaxValue = ea.getMaximum(); } }
public EvictionAttributesInfo(EvictionAttributes ea) { EvictionAction evictAction = ea.getAction(); if (evictAction != null) { evictionAction = evictAction.toString(); } EvictionAlgorithm evictionAlgo = ea.getAlgorithm(); if (evictionAlgo != null){ evictionAlgorithm = evictionAlgo.toString(); } evictionMaxValue = ea.getMaximum(); }
public EvictionAttributesInfo(EvictionAttributes ea) { EvictionAction evictAction = ea.getAction(); if (evictAction != null) { evictionAction = evictAction.toString(); } EvictionAlgorithm evictionAlgo = ea.getAlgorithm(); if (evictionAlgo != null){ evictionAlgorithm = evictionAlgo.toString(); } evictionMaxValue = ea.getMaximum(); }
protected void initialize() { super.initialize(); maximumEntries = CacheUtil.getRegion(regionName).getAttributes().getEvictionAttributes().getMaximum(); }
protected void initialize() { super.initialize(); maximumEntries = CacheUtil.getRegion(regionName).getAttributes().getEvictionAttributes().getMaximum(); }
public synchronized static void HydraTask_initialize() { if (testInstance == null) { testInstance = new LRUTest(); testInstance.initialize(); ((LRUTest)testInstance).maximumEntries = CacheUtil.getRegion(REGION_NAME).getAttributes(). getEvictionAttributes().getMaximum(); ((LRUTest)testInstance).initFields(); Log.getLogWriter().info(testInstance.toString()); } }
@Override public final int hashCode() { if (getAlgorithm().isLRUHeap()) { return getAlgorithm().hashCode(); } else { return this.getAlgorithm().hashCode() ^ this.getMaximum(); } }
public synchronized static void HydraTask_initializeWithLogListener() { if (testInstance == null) { testInstance = new LRUEvict(); ((LRUEvict)testInstance).initialize(new event.LogListener()); ((LRUEvict)testInstance).maximumEntries = CacheUtil.getRegion(REGION_NAME).getAttributes(). getEvictionAttributes().getMaximum(); ((LRUEvict)testInstance).initFields(); Log.getLogWriter().info(testInstance.toString()); } }
public synchronized static void HydraTask_initializeWithEvictListener() { if (testInstance == null) { testInstance = new LRUEvict(); ((LRUEvict)testInstance).initialize(new EvictListener()); ((LRUEvict)testInstance).maximumEntries = CacheUtil.getRegion(REGION_NAME).getAttributes(). getEvictionAttributes().getMaximum(); ((LRUEvict)testInstance).initFields(); EvictTest.initEvictTest(testInstance.getWorkRegion()); Log.getLogWriter().info(testInstance.toString()); } }
public void testEntryLruEvictions() { int extraEntries=1; createCache(); maxEnteries=3; createPartitionedRegion(true, EvictionAlgorithm.LRU_ENTRY, "PR1", 4, 1, 1000,maxEnteries); final PartitionedRegion pr = (PartitionedRegion)cache.getRegion("PR1"); getLogWriter().info( "PR- " +pr.getEvictionAttributes().getMaximum()); for (int counter = 1; counter <= maxEnteries+extraEntries; counter++) { pr.put(new Integer(counter), new byte[1 * 1024 * 1024]); } assertEquals(extraEntries,((AbstractLRURegionMap)pr.entries)._getLruList().stats().getEvictions()); }
public synchronized static void HydraTask_initialize() { if (testInstance == null) { testInstance = new MemLRUEvict(); ((MemLRUEvict)testInstance).initFields(); testInstance.initialize(); Region aRegion = CacheUtil.getRegion(REGION_NAME); maximumMegabytes = aRegion.getAttributes().getEvictionAttributes().getMaximum(); ((MemLRUTest)testInstance).memLRUParams = new MemLRUParameters(KEY_LENGTH, maximumMegabytes, CacheUtil.getRegion(REGION_NAME)); CapConBB.getBB().getSharedMap().put(CapConBB.TEST_SETTINGS, ((MemLRUTest)testInstance).memLRUParams); EvictTest.initEvictTest(testInstance.getWorkRegion()); Log.getLogWriter().info(testInstance.toString()); } }
public void run() { final AttributesFactory factory = new AttributesFactory(); factory.setEnableOffHeapMemory(isOffHeap()); factory.setPartitionAttributes(new PartitionAttributesFactory() .setRedundantCopies(redundantCopies).create()); final EvictionAttributes ea = EvictionAttributes.createLRUEntryAttributes(firstEvictionAttributes.getMaximum()+10, firstEvictionAttributes.getAction()); factory.setEvictionAttributes(ea); final Region pr = createRootRegion(name, factory.create()); assertNotNull(pr); } };