HDFS-7419. Improve error messages for DataNode hot swap drive feature (Lei Xu via Colin P. Mccabe)
@@ -480,7 +480,7 @@ public String reconfigurePropertyImpl(String property, String newVal)
LOG.info("Reconfiguring " + property + " to " + newVal);
this.refreshVolumes(newVal);
return conf.get(DFS_DATANODE_DATA_DIR_KEY);
- } catch (Exception e) {
+ } catch (IOException e) {
throw new ReconfigurationException(property, newVal,
getConf().get(property), e);
}
@@ -615,14 +615,15 @@ public IOException call() {
IOException ioe = ioExceptionFuture.get();
if (ioe != null) {
errorMessageBuilder.append(String.format("FAILED TO ADD: %s: %s\n",
- volume.toString(), ioe.getMessage()));
+ volume, ioe.getMessage()));
+ LOG.error("Failed to add volume: " + volume, ioe);
} else {
effectiveVolumes.add(volume.toString());
+ LOG.info("Successfully added volume: " + volume);
}
- LOG.info("Storage directory is loaded: " + volume.toString());
} catch (Exception e) {
errorMessageBuilder.append(String.format("FAILED to ADD: %s: %s\n",
- volume.toString(), e.getMessage()));
+ volume, e.getMessage()));
}
}
}
