void recoverTransitionRead(DataNode datanode, NamespaceInfo nsInfo,
      Collection<StorageLocation> dataDirs, StartupOption startOpt) throws IOException {
    if (addStorageLocations(datanode, nsInfo, dataDirs, startOpt).isEmpty()) {
      throw new IOException("All specified directories have failed to load.");
    }
  }
@Test
  public void testRecoverTransitionReadFailure() throws IOException {
    final int numLocations = 3;
    List<StorageLocation> locations =
        createStorageLocations(numLocations, true);
    try {
      storage.recoverTransitionRead(mockDN, nsInfo, locations, START_OPT);
      fail("An IOException should throw: all StorageLocations are NON_EXISTENT");
    } catch (IOException e) {
      GenericTestUtils.assertExceptionContains(
          "All specified directories have failed to load.", e);
    }
    assertEquals(0, storage.getNumStorageDirs());
  }