public void tearDown() throws Exception { cache.close(); ds.destroy(); if (isLinux()) { cmd("sudo /export/localnew/scripts/umount-file.sh " + dir.getName()); img.delete(); } }
/*** * Only to be used for clean up in DUnits. */ public void destroySharedConfiguration() { Region<String, Configuration> configRegion; try { configRegion = getConfigurationRegion(); if (configRegion != null) { configRegion.destroyRegion(); } DiskStore configDiskStore = this.cache.findDiskStore(CLUSTER_CONFIG_ARTIFACTS_DIR_NAME); if (configDiskStore != null) { configDiskStore.destroy(); File file = new File(CONFIG_DISK_DIR_PATH); FileUtils.deleteDirectory(file); } FileUtils.deleteDirectory(new File(CONFIG_DIR_PATH)); } catch (IOException e) { e.printStackTrace(); } catch (Exception e1) { e1.printStackTrace(); } }
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(); }
public void testDestroyWithPersistentRegion() { DiskStoreFactory dsf = cache.createDiskStoreFactory(); String name = "testDestroy"; DiskStore ds = dsf.create(name); Region region = cache.createRegionFactory(RegionShortcut.LOCAL_PERSISTENT) .setDiskStoreName("testDestroy") .create("region"); try { ds.destroy(); fail("Should have thrown an exception"); } catch(IllegalStateException expected) { //expected } region.destroyRegion(); //This should now work ds.destroy(); }
public void testDestroyWithClosedRegion() { DiskStoreFactory dsf = cache.createDiskStoreFactory(); String name = "testDestroy"; DiskStore ds = dsf.create(name); Region region = cache.createRegionFactory(RegionShortcut.LOCAL_PERSISTENT) .setDiskStoreName("testDestroy") .create("region"); region.close(); //This should now work ds.destroy(); }
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); }
try { FileUtil.copy(dir, newdir); ds.destroy();
diskStore.destroy();
if (diskStore != null) { XmlEntity xmlEntity = new XmlEntity(CacheXml.DISK_STORE, "name", diskStoreName); diskStore.destroy(); result = new CliFunctionResult(memberId, xmlEntity, "Success"); } else {
diskStore.destroy();
diskStore.destroy();
diskStore.destroy();
diskStore.destroy();
diskStore.destroy();
diskStore.destroy();
diskStore.destroy();
diskStore.destroy(); result = new CliFunctionResult(memberId, true, "Success"); } else {