use of org.apache.geode.internal.cache.xmlcache.RegionCreation in project geode by apache.
the class CacheXml66DUnitTest method testPARTITION_HEAP_LRU.
@Test
public void testPARTITION_HEAP_LRU() throws Exception {
CacheCreation cache = new CacheCreation();
RegionCreation root = (RegionCreation) cache.createRegion("partitionlru", "PARTITION_HEAP_LRU");
testXml(cache);
GemFireCacheImpl c = (GemFireCacheImpl) getCache();
Region r = c.getRegion("partitionlru");
assertNotNull(r);
RegionAttributes ra = r.getAttributes();
assertEquals(DataPolicy.PARTITION, ra.getDataPolicy());
assertNotNull(ra.getPartitionAttributes());
assertEquals(0, ra.getPartitionAttributes().getRedundantCopies());
assertEquals(EvictionAttributes.createLRUHeapAttributes(), ra.getEvictionAttributes());
assertEquals(LocalRegion.DEFAULT_HEAPLRU_EVICTION_HEAP_PERCENTAGE, c.getResourceManager().getEvictionHeapPercentage(), 0);
}
use of org.apache.geode.internal.cache.xmlcache.RegionCreation in project geode by apache.
the class CacheXml66DUnitTest method testMaxOplogSize.
@Test
public void testMaxOplogSize() throws Exception {
CacheCreation cache = new CacheCreation();
// Set properties for Asynch writes
RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
RegionCreation root = (RegionCreation) cache.createRegion("root", attrs);
{
attrs = new RegionAttributesCreation(cache);
DiskWriteAttributesFactory dwaf = new DiskWriteAttributesFactory();
dwaf.setSynchronous(true);
dwaf.setMaxOplogSize(1);
attrs.setDiskWriteAttributes(dwaf.create());
root.createSubregion("sync", attrs);
}
{
attrs = new RegionAttributesCreation(cache);
DiskWriteAttributesFactory dwaf = new DiskWriteAttributesFactory();
dwaf.setTimeInterval(123L);
dwaf.setBytesThreshold(456L);
dwaf.setMaxOplogSize(1);
attrs.setDiskWriteAttributes(dwaf.create());
root.createSubregion("async", attrs);
}
testXml(cache);
}
use of org.apache.geode.internal.cache.xmlcache.RegionCreation in project geode by apache.
the class CacheXml66DUnitTest method testCACHING_PROXY.
@Test
public void testCACHING_PROXY() throws Exception {
ClientCacheCreation cache = new ClientCacheCreation();
RegionCreation root = (RegionCreation) cache.createRegion("cproxy", "CACHING_PROXY");
testXml(cache);
GemFireCacheImpl c = (GemFireCacheImpl) getCache();
assertEquals(true, c.isClient());
Region r = c.getRegion("cproxy");
assertNotNull(r);
RegionAttributes ra = r.getAttributes();
assertEquals(DataPolicy.NORMAL, ra.getDataPolicy());
assertEquals(Scope.LOCAL, ra.getScope());
assertEquals("DEFAULT", ra.getPoolName());
}
use of org.apache.geode.internal.cache.xmlcache.RegionCreation in project geode by apache.
the class CacheXml66DUnitTest method testREPLICATE_PERSISTENT.
@Test
public void testREPLICATE_PERSISTENT() throws Exception {
CacheCreation cache = new CacheCreation();
RegionCreation root = (RegionCreation) cache.createRegion("preplicate", "REPLICATE_PERSISTENT");
testXml(cache);
GemFireCacheImpl c = (GemFireCacheImpl) getCache();
Region r = c.getRegion("preplicate");
assertNotNull(r);
RegionAttributes ra = r.getAttributes();
assertEquals(DataPolicy.PERSISTENT_REPLICATE, ra.getDataPolicy());
assertEquals(Scope.DISTRIBUTED_ACK, ra.getScope());
}
use of org.apache.geode.internal.cache.xmlcache.RegionCreation in project geode by apache.
the class CacheXml66DUnitTest method testPARTITION_PERSISTENT_OVERFLOW.
@Test
public void testPARTITION_PERSISTENT_OVERFLOW() throws Exception {
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(), 0);
assertEquals(75.0f, c.getResourceManager().getEvictionHeapPercentage(), 0);
}
Aggregations