rmc.setEvictionHeapPercentage(parseFloat(ehp)); } else { rmc.setEvictionHeapPercentageToDefault();
rmc.setEvictionHeapPercentage(low); rmc.setCriticalHeapPercentage(high); cache.setResourceManagerCreation(rmc); rmc.setEvictionHeapPercentage(low); rmc.setCriticalHeapPercentage(low + 1); cache.setResourceManagerCreation(rmc); rmc.setEvictionHeapPercentage(high); rmc.setCriticalHeapPercentage(low); cache.setResourceManagerCreation(rmc); rmc.setEvictionHeapPercentage(0); rmc.setCriticalHeapPercentage(low); cache.setResourceManagerCreation(rmc); rmc.setEvictionHeapPercentage(low); rmc.setCriticalHeapPercentage(0); cache.setResourceManagerCreation(rmc); rmc.setEvictionHeapPercentage(0); rmc.setCriticalHeapPercentage(0); cache.setResourceManagerCreation(rmc);
rmc.setEvictionHeapPercentage(parseFloat(ehp)); } else { rmc.setEvictionHeapPercentageToDefault();
public void testPARTITION_REDUNDANT_PERSISTENT_OVERFLOW() throws CacheException { CacheCreation cache = new CacheCreation(); ResourceManagerCreation rmc = new ResourceManagerCreation(); rmc.setEvictionHeapPercentage(0.0f); // test bug 42130 cache.setResourceManagerCreation(rmc); RegionCreation root = (RegionCreation) cache.createRegion("prpartitionoverflow", "PARTITION_REDUNDANT_PERSISTENT_OVERFLOW"); testXml(cache); GemFireCacheImpl c = (GemFireCacheImpl) getCache(); Region r = c.getRegion("prpartitionoverflow"); assertNotNull(r); RegionAttributes ra = r.getAttributes(); assertEquals(DataPolicy.PERSISTENT_PARTITION, ra.getDataPolicy()); assertNotNull(ra.getPartitionAttributes()); assertEquals(1, ra.getPartitionAttributes().getRedundantCopies()); assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes()); assertEquals(0.0f, c.getResourceManager().getEvictionHeapPercentage()); } public void testPARTITION_HEAP_LRU() throws CacheException {
public void testPARTITION_OVERFLOW() throws CacheException { CacheCreation cache = new CacheCreation(); ResourceManagerCreation rmc = new ResourceManagerCreation(); rmc.setEvictionHeapPercentage(55.0f); rmc.setCriticalHeapPercentage(80.0f); cache.setResourceManagerCreation(rmc); RegionCreation root = (RegionCreation) cache.createRegion("partitionoverflow", "PARTITION_OVERFLOW"); testXml(cache); GemFireCacheImpl c = (GemFireCacheImpl) getCache(); Region r = c.getRegion("partitionoverflow"); assertNotNull(r); RegionAttributes ra = r.getAttributes(); assertEquals(DataPolicy.PARTITION, ra.getDataPolicy()); assertNotNull(ra.getPartitionAttributes()); assertEquals(0, ra.getPartitionAttributes().getRedundantCopies()); assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes()); assertEquals(55.0f, c.getResourceManager().getEvictionHeapPercentage()); assertEquals(80.0f, c.getResourceManager().getCriticalHeapPercentage()); } public void testPARTITION_REDUNDANT_OVERFLOW() throws CacheException {