public void testTimeInterval() { DiskStoreFactory dsf = cache.createDiskStoreFactory(); try { dsf.setTimeInterval(-1); fail("expected IllegalArgumentException"); } catch (IllegalArgumentException e) { } dsf.setTimeInterval(1); assertEquals(dsf.create("test").getTimeInterval(), 1); }
public void testTimeInterval() { DiskStoreFactory dsf = cache.createDiskStoreFactory(); String name = "testTimeInterval"; DiskStore ds = dsf .setTimeInterval(0) .create(name); assertEquals(0, ds.getTimeInterval()); name = "testTimeInterval2"; ds = dsf .setTimeInterval(Long.MAX_VALUE) .create(name); assertEquals(Long.MAX_VALUE, ds.getTimeInterval()); // check illegal stuff try { dsf.setTimeInterval(-1); fail("expected IllegalArgumentException"); } catch (IllegalArgumentException expected) { } } public void testMaxOplogSize() {
/** * Configures the disk store factory using this disk store description. */ public void configure(DiskStoreFactory f) { f.setAllowForceCompaction(this.getAllowForceCompaction().booleanValue()); f.setAutoCompact(this.getAutoCompact().booleanValue()); f.setCompactionThreshold(this.getCompactionThreshold().intValue()); f.setDiskDirsAndSizes(this.getDiskDirs(), this.getDiskDirSizes()); f.setMaxOplogSize(this.getMaxOplogSize().longValue()); f.setQueueSize(this.getQueueSize().intValue()); f.setTimeInterval(this.getTimeInterval().longValue()); f.setWriteBufferSize(this.getWriteBufferSize().intValue()); }
dsf.setTimeInterval(ncn.getValue().getInt());
protected RegionAttributes getDiskRegionAttributes() { AttributesFactory factory = new AttributesFactory(getRegionAttributes()); File[] diskDirs = new File[1]; diskDirs[0] = new File("diskRegionDirs/" + ProcessMgr.getProcessId()); diskDirs[0].mkdirs(); factory.setDiskStoreName(getCache().createDiskStoreFactory() .setDiskDirs(diskDirs) .setTimeInterval(1000) .setQueueSize(0) .create("TXRestrictionsTest") .getName()); factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); return factory.create(); }
dsf.setTimeInterval(ncn.getValue().getInt());
dsf.setTimeInterval(ncn.getValue().getInt());
protected RegionAttributes getRegionAttributes() { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_NO_ACK); File[] diskDirs = new File[1]; diskDirs[0] = new File("diskRegionDirs/" + ProcessMgr.getProcessId()); diskDirs[0].mkdirs(); factory.setDiskStoreName(getCache().createDiskStoreFactory() .setDiskDirs(diskDirs) .setTimeInterval(1000) .setQueueSize(0) .create("DiskDistributedNoAckAsyncRegionTest") .getName()); factory.setDiskSynchronous(false); factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); return factory.create(); }
.setMaxOplogSize(60) // does the test want 60 bytes or 60M? .setAutoCompact(false) .setTimeInterval(1000) .create("Bug40299DUnitTest") .getName());
protected RegionAttributes getRegionAttributes() { AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_NO_ACK); File[] diskDirs = new File[1]; diskDirs[0] = new File("diskRegionDirs/" + ProcessMgr.getProcessId()); diskDirs[0].mkdirs(); factory.setDiskStoreName(getCache().createDiskStoreFactory() .setDiskDirs(diskDirs) .setTimeInterval(1000) .setQueueSize(0) .create("DiskDistributedNoAckAsyncOverflowRegionTest") .getName()); factory.setEvictionAttributes(EvictionAttributes .createLRUMemoryAttributes(1, null, EvictionAction.OVERFLOW_TO_DISK)); factory.setDiskSynchronous(false); factory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); return factory.create(); } }
public void run() { Cache cache = getCache(); DiskStoreFactory dsf = cache.createDiskStoreFactory(); File dir = getDiskDirForVM(vm0); dir.mkdirs(); dsf.setDiskDirs(new File[] {dir}); dsf.setMaxOplogSize(1); dsf.setQueueSize(100); dsf.setTimeInterval(1000); DiskStore ds = dsf.create(REGION_NAME); RegionFactory rf = new RegionFactory(); rf.setDiskStoreName(ds.getName()); rf.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); rf.setScope(Scope.DISTRIBUTED_ACK); rf.setDiskSynchronous(false); rf.create(REGION_NAME); } };
.setCompactionThreshold(100) .setMaxOplogSize(2) .setTimeInterval(10) .setWriteBufferSize(15) .setQueueSize(12) .setCompactionThreshold(99) .setMaxOplogSize(1) .setTimeInterval(9) .setWriteBufferSize(14) .setQueueSize(11)
((DiskStoreFactoryImpl)dsf).setMaxOplogSizeInBytes(500); dsf.setQueueSize(0); dsf.setTimeInterval(0); File dir = new File("testingDirectoryDefault"); dir.mkdir();
dsf.setAutoCompact(dwa.isRollOplogs()); dsf.setMaxOplogSize(dwa.getMaxOplogSize()); dsf.setTimeInterval(dwa.getTimeInterval()); if (dwa.getBytesThreshold() > 0) { dsf.setQueueSize(1);
dsf.setAutoCompact(dwa.isRollOplogs()); dsf.setMaxOplogSize(dwa.getMaxOplogSize()); dsf.setTimeInterval(dwa.getTimeInterval()); if (dwa.getBytesThreshold() > 0) { dsf.setQueueSize(1);
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()); }
dsf.setCompactionThreshold(diskProps.getCompactionThreshold()); if (diskProps.getTimeInterval() != -1) { dsf.setTimeInterval(diskProps.getTimeInterval());