public static synchronized DiskStore getDiskStore(String diskStoreName) { if (diskStoreName == null) { throw new IllegalArgumentException("diskStoreName cannot be null"); } return CacheHelper.getCache().findDiskStore(diskStoreName); }
@Override public void run() { Cache cache = getCache(); DiskStore ds = cache.findDiskStore(REGION_NAME); ds.flush(); } });
@Override public void run() { getCache().findDiskStore(diskStore).flush(); } });
protected DiskStore createDiskStore(Cache cache, String diskStoreName, String dirName) { // maxOplogSize==1m File dir = new File(dirName); dir.mkdirs(); DiskStore ds = cache.findDiskStore(diskStoreName); if(ds == null) { ds = cache.createDiskStoreFactory() .setDiskDirs(new File[] {dir}).setMaxOplogSize(maxOplogSize).create(diskStoreName); } return ds; }
public void destroyPersistentFiles(Cache cache) { DiskStoreImpl diskStore = (DiskStoreImpl) cache.findDiskStore(this._diskStoreName); String region = "/" + this._regionName; if(diskStore.getDiskInitFile().getDiskRegionByName(region) != null) { diskStore.destroyRegion(region, true); } }
public void run() { Cache cache = getCache(); DiskStore ds = cache.findDiskStore(REGION_NAME); assertFalse(ds.forceCompaction()); } };
public void run() { Cache cache = getCache(); Region region = cache.getRegion("region1"); Region region2 = cache.getRegion("region2"); for(int i =0; i< 12; i++) { region.put(Integer.valueOf(i), "A", new byte[1024 * 512]); } // GEODE-244 - the async event queue uses asnychronous writes. Flush // the default disk store to make sure all values have overflowed cache.findDiskStore(null).flush(); } });
/** Create the pdx disk store if one was specified. * */ private void initPdxDiskStore() { if (CacheHelper.getCache().getPdxPersistent()) { String pdxDiskStoreName = TestConfig.tab().stringAt(CachePrms.pdxDiskStoreName, null); if (pdxDiskStoreName != null) {// pdx disk store name was specified if (CacheHelper.getCache().findDiskStore(pdxDiskStoreName) == null) { DiskStoreHelper.createDiskStore(pdxDiskStoreName); } } } }
/** Create the pdx disk store if one was specified. * */ protected void initPdxDiskStore() { if (CacheHelper.getCache().getPdxPersistent()) { String pdxDiskStoreName = TestConfig.tab().stringAt(CachePrms.pdxDiskStoreName, null); if (pdxDiskStoreName != null) {// pdx disk store name was specified if (CacheHelper.getCache().findDiskStore(pdxDiskStoreName) == null) { DiskStoreHelper.createDiskStore(pdxDiskStoreName); } } } }
public void tearDown() throws Exception { for (Region r : cache.rootRegions()) { if (r != null) { r.close(); } } if (cache.getRegion(getName()) != null) { cache.getRegion(getName()).destroyRegion(); } DiskStore ds = cache.findDiskStore(null); if (ds != null) { ds.destroy(); } ((HDFSStoreImpl)hdfsStore).getFileSystem().delete(new Path(hdfsStore.getHomeDir()), true); }
/** Create the pdx disk store if one was specified. * */ protected static void initPdxDiskStore() { if (CacheHelper.getCache().getPdxPersistent()) { String pdxDiskStoreName = TestConfig.tab().stringAt(hydra.CachePrms.pdxDiskStoreName, null); if (pdxDiskStoreName != null) {// pdx disk store name was specified if (CacheHelper.getCache().findDiskStore(pdxDiskStoreName) == null) { DiskStoreHelper.createDiskStore(pdxDiskStoreName); } } } }
/** * Create the pdx disk store if one was specified. */ private void initPdxDiskStore() { if (CacheHelper.getCache().getPdxPersistent()) { String pdxDiskStoreName = TestConfig.tab().stringAt( CachePrms.pdxDiskStoreName, null); if (pdxDiskStoreName != null) {// pdx disk store name was specified if (CacheHelper.getCache().findDiskStore(pdxDiskStoreName) == null) { DiskStoreHelper.createDiskStore(pdxDiskStoreName); } } } }
/** * Create the pdx disk store if one was specified. * */ private void initPdxDiskStore() { if (CacheHelper.getCache().getPdxPersistent()) { String pdxDiskStoreName = TestConfig.tab().stringAt( CachePrms.pdxDiskStoreName, null); if (pdxDiskStoreName != null) {// pdx disk store name was specified if (CacheHelper.getCache().findDiskStore(pdxDiskStoreName) == null) { DiskStoreHelper.createDiskStore(pdxDiskStoreName); } } } }
/** * Create the pdx disk store if one was specified. * */ private void initPdxDiskStore() { if (CacheHelper.getCache().getPdxPersistent()) { String pdxDiskStoreName = TestConfig.tab().stringAt( CachePrms.pdxDiskStoreName, null); if (pdxDiskStoreName != null) {// pdx disk store name was specified if (CacheHelper.getCache().findDiskStore(pdxDiskStoreName) == null) { DiskStoreHelper.createDiskStore(pdxDiskStoreName); } } } } }
private Region createRegion(String regionName) { if(cache.findDiskStore("store") == null) { cache.createDiskStoreFactory() .setMaxOplogSize(1) .setDiskDirs(dirs) .create("store"); } Region region = cache.createRegionFactory() .setDiskStoreName("store") .setDataPolicy(DataPolicy.PERSISTENT_REPLICATE).create(regionName); return region; }
public void run() { cache = getCache(); DiskStore ds = cache.findDiskStore(diskStoreName); if(ds == null) { ds = cache.createDiskStoreFactory() .setDiskDirs(getDiskDirs()).create(diskStoreName); } AttributesFactory af = new AttributesFactory(); af.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); af.setDiskStoreName(diskStoreName); cache.createRegion(regionName, af.create()); } };
@Override public void run() { getSystem(peer.getDistributedSystemConfiguration()); final Cache cache = getCache(); DiskStore diskStore = cache.findDiskStore(diskStoreName); if (diskStore == null) { final DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory(); diskStoreFactory.setDiskDirs(getDiskDirs()); diskStore = diskStoreFactory.create(diskStoreName); } final RegionFactory regionFactory = cache.createRegionFactory(); regionFactory.setDataPolicy(DataPolicy.PERSISTENT_REPLICATE); regionFactory.setDiskStoreName(diskStore.getName()); regionFactory.setScope(Scope.DISTRIBUTED_NO_ACK); regionFactory.create(regionName); } });
public void run() { Cache cache = getCache(); DiskStore ds = cache.findDiskStore("disk"); if (ds == null) { ds = cache.createDiskStoreFactory().setDiskDirs(getDiskDirs()) .create("disk"); } AttributesFactory af = new AttributesFactory(); PartitionAttributesFactory paf = new PartitionAttributesFactory(); paf.setRedundantCopies(1); af.setPartitionAttributes(paf.create()); af.setDataPolicy(DataPolicy.PERSISTENT_PARTITION); af.setDiskStoreName("disk"); cache.createRegion(PR_REGION_NAME, af.create()); } };
public void run() { Cache cache = getCache(); DiskStore ds = cache.findDiskStore("disk"); if(ds == null) { ds = cache.createDiskStoreFactory() .setDiskDirs(getDiskDirs()).create("disk"); } AttributesFactory af = new AttributesFactory(); PartitionAttributesFactory paf = new PartitionAttributesFactory(); paf.setRedundantCopies(1); paf.setRecoveryDelay(0); af.setPartitionAttributes(paf.create()); af.setDataPolicy(DataPolicy.PERSISTENT_PARTITION); af.setDiskStoreName("disk"); cache.createRegion(PR_REGION_NAME, af.create()); } };
public void run() { Cache cache = getCache(); DiskStore ds = cache.findDiskStore("disk"); if(ds == null) { ds = cache.createDiskStoreFactory() .setDiskDirs(getDiskDirs()).create("disk"); } AttributesFactory af = new AttributesFactory(); PartitionAttributesFactory paf = new PartitionAttributesFactory(); paf.setRedundantCopies(1); paf.setRecoveryDelay(0); af.setPartitionAttributes(paf.create()); af.setDataPolicy(DataPolicy.PERSISTENT_PARTITION); af.setDiskStoreName("disk"); cache.createRegion(PR_REGION_NAME, af.create()); } };