/** * Remove volumes from DataNode. * See {@link #removeVolumes(Collection, boolean)} for details. * * @param locations the StorageLocations of the volumes to be removed. * @throws IOException */ private void removeVolumes(final Collection<StorageLocation> locations) throws IOException { if (locations.isEmpty()) { return; } removeVolumes(locations, true); }
private void handleVolumeFailures(Set<FsVolumeSpi> unhealthyVolumes) { if (unhealthyVolumes.isEmpty()) { LOG.debug("handleVolumeFailures done with empty " + "unhealthyVolumes"); return; } data.handleVolumeFailures(unhealthyVolumes); Set<StorageLocation> unhealthyLocations = new HashSet<>( unhealthyVolumes.size()); StringBuilder sb = new StringBuilder("DataNode failed volumes:"); for (FsVolumeSpi vol : unhealthyVolumes) { unhealthyLocations.add(vol.getStorageLocation()); sb.append(vol.getStorageLocation()).append(";"); } try { // Remove all unhealthy volumes from DataNode. removeVolumes(unhealthyLocations, false); } catch (IOException e) { LOG.warn("Error occurred when removing unhealthy storage dirs", e); } LOG.debug("{}", sb); // send blockreport regarding volume failure handleDiskError(sb.toString()); }
removeVolumes(changedVolumes.deactivateLocations); } catch (IOException e) { errorMessageBuilder.append(e.getMessage());
/** * Remove volumes from DataNode. * See {@link removeVolumes(final Set<File>, boolean)} for details. * * @param locations the StorageLocations of the volumes to be removed. * @throws IOException */ private void removeVolumes(final Collection<StorageLocation> locations) throws IOException { if (locations.isEmpty()) { return; } Set<File> volumesToRemove = new HashSet<>(); for (StorageLocation loc : locations) { volumesToRemove.add(loc.getFile().getAbsoluteFile()); } removeVolumes(volumesToRemove, true); }
/** * Remove volumes from DataNode. * See {@link removeVolumes(final Set<File>, boolean)} for details. * * @param locations the StorageLocations of the volumes to be removed. * @throws IOException */ private void removeVolumes(final Collection<StorageLocation> locations) throws IOException { if (locations.isEmpty()) { return; } Set<File> volumesToRemove = new HashSet<>(); for (StorageLocation loc : locations) { volumesToRemove.add(loc.getFile().getAbsoluteFile()); } removeVolumes(volumesToRemove, true); }
/** * Check the disk error */ private void checkDiskError() { Set<File> unhealthyDataDirs = data.checkDataDir(); if (unhealthyDataDirs != null && !unhealthyDataDirs.isEmpty()) { try { // Remove all unhealthy volumes from DataNode. removeVolumes(unhealthyDataDirs, false); } catch (IOException e) { LOG.warn("Error occurred when removing unhealthy storage dirs: " + e.getMessage(), e); } StringBuilder sb = new StringBuilder("DataNode failed volumes:"); for (File dataDir : unhealthyDataDirs) { sb.append(dataDir.getAbsolutePath() + ";"); } handleDiskError(sb.toString()); } }
/** * Check the disk error */ private void checkDiskError() { Set<File> unhealthyDataDirs = data.checkDataDir(); if (unhealthyDataDirs != null && !unhealthyDataDirs.isEmpty()) { try { // Remove all unhealthy volumes from DataNode. removeVolumes(unhealthyDataDirs, false); } catch (IOException e) { LOG.warn("Error occurred when removing unhealthy storage dirs: " + e.getMessage(), e); } StringBuilder sb = new StringBuilder("DataNode failed volumes:"); for (File dataDir : unhealthyDataDirs) { sb.append(dataDir.getAbsolutePath() + ";"); } handleDiskError(sb.toString()); } }
removeVolumes(changedVolumes.deactivateLocations); } catch (IOException e) { errorMessageBuilder.append(e.getMessage());
removeVolumes(changedVolumes.deactivateLocations); } catch (IOException e) { errorMessageBuilder.append(e.getMessage());