/** * Updates the failed volume info in the volumeFailureInfos Map * and calls {@link #removeVolume(FsVolumeImpl)} to remove the volume * from the volume list for each of the failed volumes. * * @param failedVolumes set of volumes marked failed. */ void handleVolumeFailures(Set<FsVolumeSpi> failedVolumes) { try (AutoCloseableLock lock = checkDirsLock.acquire()) { for(FsVolumeSpi vol : failedVolumes) { FsVolumeImpl fsv = (FsVolumeImpl) vol; try (FsVolumeReference ref = fsv.obtainReference()) { addVolumeFailureInfo(fsv); removeVolume(fsv); } catch (ClosedChannelException e) { FsDatasetImpl.LOG.debug("Caught exception when obtaining " + "reference count on closed volume", e); } catch (IOException e) { FsDatasetImpl.LOG.error("Unexpected IOException", e); } } waitVolumeRemoved(5000, checkDirsLockCondition); } }
private void addVolumeFailureInfo(FsVolumeImpl vol) { addVolumeFailureInfo(new VolumeFailureInfo( vol.getStorageLocation(), Time.now(), vol.getCapacity())); }
builder = dataStorage.prepareVolume(datanode, location, nsInfos); } catch (IOException e) { volumes.addVolumeFailureInfo(new VolumeFailureInfo(location, Time.now())); throw e;
private void addVolumeFailureInfo(FsVolumeImpl vol) { addVolumeFailureInfo(new VolumeFailureInfo( new File(vol.getBasePath()).getAbsolutePath(), Time.now(), vol.getCapacity())); }
private void addVolumeFailureInfo(FsVolumeImpl vol) { addVolumeFailureInfo(new VolumeFailureInfo( new File(vol.getBasePath()).getAbsolutePath(), Time.now(), vol.getCapacity())); }
addVolumeFailureInfo(fsv); removeVolume(fsv); } catch (ClosedChannelException e) {
addVolumeFailureInfo(fsv); removeVolume(fsv); } catch (ClosedChannelException e) {
builder = dataStorage.prepareVolume(datanode, location.getFile(), nsInfos); } catch (IOException e) { volumes.addVolumeFailureInfo(new VolumeFailureInfo( location.getFile().getAbsolutePath(), Time.now())); throw e;
builder = dataStorage.prepareVolume(datanode, location.getFile(), nsInfos); } catch (IOException e) { volumes.addVolumeFailureInfo(new VolumeFailureInfo( location.getFile().getAbsolutePath(), Time.now())); throw e;