public Region createRegion() { DiskStoreImpl ds = createDiskStore(); RegionFactory rf = new RegionFactory(); rf.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); rf.setDiskDirs(diskDirs); DiskWriteAttributesFactory daf = new DiskWriteAttributesFactory(); daf.setMaxOplogSize(1); rf.setDiskWriteAttributes(daf.create()); Region region = rf.create("region"); return region; } });
public void run() { Cache cache = getCache(); File dir = getDiskDirForVM(vm); dir.mkdirs(); RegionFactory rf = new RegionFactory(); // rf.setDiskSynchronous(true); rf.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); rf.setScope(Scope.DISTRIBUTED_ACK); rf.setDiskDirs(new File[] {dir}); DiskWriteAttributesFactory dwf = new DiskWriteAttributesFactory(); dwf.setMaxOplogSize(1); dwf.setSynchronous(true); rf.setDiskWriteAttributes(dwf.create()); rf.create(REGION_NAME); } };
/** * This test is in here just to test to make * sure that we don't get a suspect string * with an exception during cache closure. */ public void testOverflowCacheClose() { Cache cache = getCache(); RegionFactory rf = new RegionFactory(); PartitionAttributesFactory paf = new PartitionAttributesFactory(); rf.setPartitionAttributes(paf.create()); rf.setDataPolicy(DataPolicy.PARTITION); rf.setEvictionAttributes(EvictionAttributes.createLRUEntryAttributes(50, EvictionAction.OVERFLOW_TO_DISK)); rf.setDiskDirs(getDiskDirs()); Region region = rf.create(PR_REGION_NAME); region.get(0); cache.getDistributedSystem().disconnect(); // cache.close(); }