/** * Version-dependent support for generating a dummy resource manager. */ protected static void generateDummyResourceManager(CacheDescription cd, CacheCreation dummyCache) { if (cd.getResourceManagerDescription() != null) { ResourceManagerCreation dummyResourceManager = new ResourceManagerCreation(); dummyCache.setResourceManagerCreation(dummyResourceManager); } }
ResourceManagerCreation rmc = new ResourceManagerCreation();
ResourceManagerCreation rmc = new ResourceManagerCreation();
/** * Generates a dummy cache from the given client cache description. */ private static ClientCacheCreation generateDummyCache( String cacheConfig, ClientCacheDescription ccd, DynamicRegionFactory.Config dynamicRegionConfig, String fn) { if (dynamicRegionConfig != null) { // must open the DynamicRegionFactory before creating the cache log("Opening the configured DynamicRegionFactory"); DynamicRegionFactory.get().open(dynamicRegionConfig); } // create and configure the dummy cache log("Adding dummy cache from: " + ccd); ClientCacheCreation dummyCache = new ClientCacheCreation(); ResourceManagerCreation dummyResourceManager = new ResourceManagerCreation(); dummyCache.setResourceManagerCreation(dummyResourceManager); ccd.configureDummy(dummyCache); // add the dynamic region factory configuration, if any if (dynamicRegionConfig != null) { dummyCache.setDynamicRegionFactoryConfig(dynamicRegionConfig); } log("Added dummy cache: " + ccd.cacheToString(dummyCache)); // save the cache config for future reference XmlCacheConfigs.put(fn, cacheConfig); return dummyCache; }
ResourceManagerCreation rmc = new ResourceManagerCreation(); rmc.setEvictionOffHeapPercentage(low); rmc.setCriticalOffHeapPercentage(high); rmc = new ResourceManagerCreation(); rmc = new ResourceManagerCreation(); rmc.setEvictionOffHeapPercentage(high); rmc.setCriticalOffHeapPercentage(low); rmc = new ResourceManagerCreation(); rmc.setEvictionOffHeapPercentage(0); rmc.setCriticalOffHeapPercentage(low); rmc = new ResourceManagerCreation(); rmc.setEvictionOffHeapPercentage(low); rmc.setCriticalOffHeapPercentage(0); rmc = new ResourceManagerCreation(); rmc.setEvictionOffHeapPercentage(0); rmc.setCriticalOffHeapPercentage(0);
ResourceManagerCreation rmc = new ResourceManagerCreation(); rmc.setEvictionHeapPercentage(low); rmc.setCriticalHeapPercentage(high); rmc = new ResourceManagerCreation(); rmc = new ResourceManagerCreation(); rmc.setEvictionHeapPercentage(high); rmc.setCriticalHeapPercentage(low); rmc = new ResourceManagerCreation(); rmc.setEvictionHeapPercentage(0); rmc.setCriticalHeapPercentage(low); rmc = new ResourceManagerCreation(); rmc.setEvictionHeapPercentage(low); rmc.setCriticalHeapPercentage(0); rmc = new ResourceManagerCreation(); rmc.setEvictionHeapPercentage(0); rmc.setCriticalHeapPercentage(0);
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 {
public void testPARTITION_PERSISTENT_OVERFLOW() throws CacheException { CacheCreation cache = new CacheCreation(); ResourceManagerCreation rmc = new ResourceManagerCreation(); rmc.setCriticalHeapPercentage(80.0f); cache.setResourceManagerCreation(rmc); RegionCreation root = (RegionCreation) cache.createRegion("ppartitionoverflow", "PARTITION_PERSISTENT_OVERFLOW"); testXml(cache); GemFireCacheImpl c = (GemFireCacheImpl) getCache(); Region r = c.getRegion("ppartitionoverflow"); assertNotNull(r); RegionAttributes ra = r.getAttributes(); assertEquals(DataPolicy.PERSISTENT_PARTITION, ra.getDataPolicy()); assertNotNull(ra.getPartitionAttributes()); assertEquals(0, ra.getPartitionAttributes().getRedundantCopies()); assertEquals(EvictionAttributes.createLRUHeapAttributes(null, EvictionAction.OVERFLOW_TO_DISK), ra.getEvictionAttributes()); assertEquals(80.0f, c.getResourceManager().getCriticalHeapPercentage()); assertEquals(75.0f, c.getResourceManager().getEvictionHeapPercentage()); } public void testPARTITION_REDUNDANT_PERSISTENT_OVERFLOW() throws CacheException {
CacheCreation cache = new CacheCreation(); if (getGemFireVersion().equals(CacheXml.VERSION_6_0)) { ResourceManagerCreation rm = new ResourceManagerCreation(); rm.setCriticalHeapPercentage(95); cache.setResourceManagerCreation(rm);