use of org.apache.geode.cache.RegionAttributes in project geode by apache.
the class DistributedAckRegionCompressionDUnitTest method getRegionAttributes.
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected RegionAttributes getRegionAttributes(String type) {
Compressor compressor = null;
try {
compressor = SnappyCompressor.getDefaultInstance();
} catch (Throwable t) {
// Not a supported OS
return super.getRegionAttributes(type);
}
RegionAttributes ra = super.getRegionAttributes(type);
AttributesFactory factory = new AttributesFactory(ra);
if (!ra.getDataPolicy().isEmpty()) {
factory.setCompressor(compressor);
}
return factory.create();
}
use of org.apache.geode.cache.RegionAttributes in project geode by apache.
the class DistributedNoAckRegionCCEDUnitTest method getRegionAttributes.
protected RegionAttributes getRegionAttributes(String type) {
RegionAttributes ra = getCache().getRegionAttributes(type);
if (ra == null) {
throw new IllegalStateException("The region shortcut " + type + " has been removed.");
}
AttributesFactory factory = new AttributesFactory(ra);
factory.setScope(Scope.DISTRIBUTED_NO_ACK);
factory.setConcurrencyChecksEnabled(true);
return factory.create();
}
use of org.apache.geode.cache.RegionAttributes in project geode by apache.
the class DistributedNoAckRegionCCEOffHeapDUnitTest 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 DistributedNoAckRegionCCEOffHeapDUnitTest 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 DistributedAckRegionOffHeapDUnitTest method getRegionAttributes.
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
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();
}
Aggregations