use of org.apache.geode.cache.RegionAttributes in project geode by apache.
the class DistributedAckOverflowRegionCCEOffHeapDUnitTest method getRegionAttributes.
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected RegionAttributes getRegionAttributes(String type) {
RegionAttributes ra = super.getRegionAttributes(type);
AttributesFactory factory = new AttributesFactory(ra);
if (!ra.getDataPolicy().isEmpty()) {
factory.setOffHeap(true);
}
return factory.create();
}
use of org.apache.geode.cache.RegionAttributes in project geode by apache.
the class DistributedAckOverflowRegionCCEOffHeapDUnitTest method getRegionAttributes.
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected RegionAttributes getRegionAttributes() {
RegionAttributes attrs = super.getRegionAttributes();
AttributesFactory factory = new AttributesFactory(attrs);
factory.setOffHeap(true);
return factory.create();
}
use of org.apache.geode.cache.RegionAttributes in project geode by apache.
the class DistributedAckPersistentRegionCCEOffHeapDUnitTest method getRegionAttributes.
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected RegionAttributes getRegionAttributes() {
RegionAttributes attrs = super.getRegionAttributes();
AttributesFactory factory = new AttributesFactory(attrs);
factory.setOffHeap(true);
return factory.create();
}
use of org.apache.geode.cache.RegionAttributes in project geode by apache.
the class DistAckMapMethodsDUnitTest method createRegionToTestRemove.
public static void createRegionToTestRemove() {
try {
AttributesFactory factory2 = new AttributesFactory();
factory2.setScope(Scope.DISTRIBUTED_ACK);
CacheWriter cacheWriter = new RemoveCacheWriter();
CacheListener cacheListener = new RemoveCacheListener();
factory2.setCacheWriter(cacheWriter);
factory2.setCacheListener(cacheListener);
RegionAttributes attr2 = factory2.create();
remRegion = cache.createRegion("remove", attr2);
} catch (Exception ex) {
ex.printStackTrace();
}
}
use of org.apache.geode.cache.RegionAttributes in project geode by apache.
the class RegionReliabilityTestCase method testFullAccessWithLocalRegionExpiration.
/**
* Tests affect of FULL_ACCESS on local region expiration actions.
*/
@Test
public void testFullAccessWithLocalRegionExpiration() throws Exception {
final String name = this.getUniqueName();
final String roleA = name + "-A";
final String[] requiredRoles = { roleA };
Set requiredRolesSet = new HashSet();
for (int i = 0; i < requiredRoles.length; i++) {
requiredRolesSet.add(InternalRole.getRole(requiredRoles[i]));
}
assertEquals(requiredRoles.length, requiredRolesSet.size());
// connect controller to system...
Properties config = new Properties();
config.setProperty(ROLES, "");
getSystem(config);
getCache();
// create region in controller...
MembershipAttributes ra = new MembershipAttributes(requiredRoles, LossAction.FULL_ACCESS, ResumptionAction.NONE);
AttributesFactory fac = new AttributesFactory();
fac.setMembershipAttributes(ra);
fac.setScope(getRegionScope());
fac.setStatisticsEnabled(true);
RegionAttributes attr = fac.create();
final Region region = createExpiryRootRegion(name, attr);
// wait for memberTimeout to expire
waitForMemberTimeout();
AttributesMutator mutator = region.getAttributesMutator();
mutator.setRegionTimeToLive(new ExpirationAttributes(1, ExpirationAction.LOCAL_DESTROY));
waitForRegionDestroy(region);
}
Aggregations