use of org.apache.geode.cache.DiskStoreFactory in project geode by apache.
the class DiskStoreFactoryJUnitTest method testNonDefaults.
@Test
public void testNonDefaults() {
DiskStoreFactory dsf = cache.createDiskStoreFactory();
String name = "testNonDefaults";
DiskStore ds = dsf.setAutoCompact(!DiskStoreFactory.DEFAULT_AUTO_COMPACT).setCompactionThreshold(DiskStoreFactory.DEFAULT_COMPACTION_THRESHOLD / 2).setAllowForceCompaction(!DiskStoreFactory.DEFAULT_ALLOW_FORCE_COMPACTION).setMaxOplogSize(DiskStoreFactory.DEFAULT_MAX_OPLOG_SIZE + 1).setTimeInterval(DiskStoreFactory.DEFAULT_TIME_INTERVAL + 1).setWriteBufferSize(DiskStoreFactory.DEFAULT_WRITE_BUFFER_SIZE + 1).setQueueSize(DiskStoreFactory.DEFAULT_QUEUE_SIZE + 1).create(name);
assertEquals(!DiskStoreFactory.DEFAULT_AUTO_COMPACT, ds.getAutoCompact());
assertEquals(DiskStoreFactory.DEFAULT_COMPACTION_THRESHOLD / 2, ds.getCompactionThreshold());
assertEquals(!DiskStoreFactory.DEFAULT_ALLOW_FORCE_COMPACTION, ds.getAllowForceCompaction());
assertEquals(DiskStoreFactory.DEFAULT_MAX_OPLOG_SIZE + 1, ds.getMaxOplogSize());
assertEquals(DiskStoreFactory.DEFAULT_TIME_INTERVAL + 1, ds.getTimeInterval());
assertEquals(DiskStoreFactory.DEFAULT_WRITE_BUFFER_SIZE + 1, ds.getWriteBufferSize());
assertEquals(DiskStoreFactory.DEFAULT_QUEUE_SIZE + 1, ds.getQueueSize());
}
use of org.apache.geode.cache.DiskStoreFactory in project geode by apache.
the class DiskStoreFactoryJUnitTest method testForceCompaction.
@Test
public void testForceCompaction() {
DiskStoreFactory dsf = cache.createDiskStoreFactory();
dsf.setAllowForceCompaction(true);
String name = "testForceCompaction";
DiskStore ds = dsf.create(name);
assertEquals(false, ds.forceCompaction());
}
use of org.apache.geode.cache.DiskStoreFactory in project geode by apache.
the class DiskStoreFactoryJUnitTest method testDestroyWithOverflowRegion.
@Test
public void testDestroyWithOverflowRegion() {
DiskStoreFactory dsf = cache.createDiskStoreFactory();
String name = "testDestroy";
DiskStore ds = dsf.create(name);
Region region = cache.createRegionFactory(RegionShortcut.LOCAL_OVERFLOW).setDiskStoreName("testDestroy").create("region");
try {
ds.destroy();
fail("Should have thrown an exception");
} catch (IllegalStateException expected) {
System.err.println("Got expected :" + expected.getMessage());
}
region.close();
// The destroy should now work.
ds.destroy();
}
use of org.apache.geode.cache.DiskStoreFactory in project geode by apache.
the class OffHeapLRURecoveryRegressionTest method createDiskStore.
private void createDiskStore(GemFireCacheImpl gfc) {
DiskStoreFactory dsf = gfc.createDiskStoreFactory();
dsf.create(DS_NAME);
}
use of org.apache.geode.cache.DiskStoreFactory in project geode by apache.
the class QueryMonitorDUnitTest method createRegion.
private void createRegion(final boolean eviction, final String dirName) {
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
factory.setDataPolicy(DataPolicy.REPLICATE);
// setting the eviction attributes.
if (eviction) {
File[] f = new File[1];
f[0] = new File(dirName);
f[0].mkdir();
DiskStoreFactory dsf = GemFireCacheImpl.getInstance().createDiskStoreFactory();
DiskStore ds1 = dsf.setDiskDirs(f).create("ds1");
factory.setDiskStoreName("ds1");
EvictionAttributes evictAttrs = EvictionAttributes.createLRUEntryAttributes(100, EvictionAction.OVERFLOW_TO_DISK);
factory.setEvictionAttributes(evictAttrs);
}
// Create region
createRegion(exampleRegionName, factory.create());
createRegion(exampleRegionName2, factory.create());
}
Aggregations