this.storage.unlockAll(); } catch (IOException ie) { LOG.warn("Exception when unlocking storage", ie);
@After public void tearDown() throws IOException { storage.unlockAll(); FileUtil.fullyDelete(TEST_DIR); }
this.storage.unlockAll(); } catch (IOException ie) {
this.storage.unlockAll(); } catch (IOException ie) {
this.storage.unlockAll(); } catch (IOException ie) {
this.storage.unlockAll(); } catch (IOException ie) { LOG.warn("Exception when unlocking storage: " + ie, ie);
this.storage.unlockAll(); } catch (IOException ie) { LOG.warn("Exception when unlocking storage: " + ie, ie);
/** * This test enforces the behavior that if there is an exception from * doTransition() during DN starts up, the storage directories that have * already been processed are still visible, i.e., in * DataStorage.storageDirs(). */ @Test public void testRecoverTransitionReadDoTransitionFailure() throws IOException { final int numLocations = 3; List<StorageLocation> locations = createStorageLocations(numLocations); // Prepare volumes storage.recoverTransitionRead(mockDN, nsInfo, locations, START_OPT); assertEquals(numLocations, storage.getNumStorageDirs()); // Reset DataStorage storage.unlockAll(); storage = new DataStorage(); // Trigger an exception from doTransition(). nsInfo.clusterID = "cluster1"; try { storage.recoverTransitionRead(mockDN, nsInfo, locations, START_OPT); fail("Expect to throw an exception from doTransition()"); } catch (IOException e) { GenericTestUtils.assertExceptionContains("All specified directories", e); } assertEquals(0, storage.getNumStorageDirs()); } }