Search in sources :

Example 41 with EvictionAttributes

use of org.apache.geode.cache.EvictionAttributes in project geode by apache.

the class MemberCommandsDUnitTest method createPartitionedRegion.

private void createPartitionedRegion(String regionName) {
    final Cache cache = getCache();
    // Create the data region
    RegionFactory<String, Integer> dataRegionFactory = cache.createRegionFactory(RegionShortcut.PARTITION);
    dataRegionFactory.setConcurrencyLevel(4);
    EvictionAttributes ea = EvictionAttributes.createLIFOEntryAttributes(100, EvictionAction.LOCAL_DESTROY);
    dataRegionFactory.setEvictionAttributes(ea);
    dataRegionFactory.setEnableAsyncConflation(true);
    FixedPartitionAttributes fpa = FixedPartitionAttributes.createFixedPartition("Par1", true);
    PartitionAttributes pa = new PartitionAttributesFactory().setLocalMaxMemory(100).setRecoveryDelay(2).setTotalMaxMemory(200).setRedundantCopies(1).addFixedPartitionAttributes(fpa).create();
    dataRegionFactory.setPartitionAttributes(pa);
    dataRegionFactory.create(regionName);
}
Also used : EvictionAttributes(org.apache.geode.cache.EvictionAttributes) PartitionAttributesFactory(org.apache.geode.cache.PartitionAttributesFactory) FixedPartitionAttributes(org.apache.geode.cache.FixedPartitionAttributes) PartitionAttributes(org.apache.geode.cache.PartitionAttributes) FixedPartitionAttributes(org.apache.geode.cache.FixedPartitionAttributes) Cache(org.apache.geode.cache.Cache)

Aggregations

EvictionAttributes (org.apache.geode.cache.EvictionAttributes)41 AttributesFactory (org.apache.geode.cache.AttributesFactory)25 Region (org.apache.geode.cache.Region)24 Test (org.junit.Test)24 PartitionAttributesFactory (org.apache.geode.cache.PartitionAttributesFactory)21 RegionAttributes (org.apache.geode.cache.RegionAttributes)17 CacheSerializableRunnable (org.apache.geode.cache30.CacheSerializableRunnable)13 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)12 SerializableRunnable (org.apache.geode.test.dunit.SerializableRunnable)11 Host (org.apache.geode.test.dunit.Host)10 VM (org.apache.geode.test.dunit.VM)10 Cache (org.apache.geode.cache.Cache)9 PartitionAttributes (org.apache.geode.cache.PartitionAttributes)9 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)8 DiskWriteAttributesFactory (org.apache.geode.cache.DiskWriteAttributesFactory)7 DistributedRegion (org.apache.geode.internal.cache.DistributedRegion)6 LocalRegion (org.apache.geode.internal.cache.LocalRegion)6 CacheCreation (org.apache.geode.internal.cache.xmlcache.CacheCreation)6 ClientCacheCreation (org.apache.geode.internal.cache.xmlcache.ClientCacheCreation)6 File (java.io.File)5