code: @Override // DataNodeMXBean
    public String getVolumeInfo() {
      final Map<String, Object> info = new HashMap<String, Object>();
      try {
        FSVolume[] volumes = ((FSDataset)this.data).volumes.getVolumes();
        for (FSVolume v : volumes) {
          final Map<String, Object> innerInfo = new HashMap<String, Object>();
          innerInfo.put("usedSpace", v.getDfsUsed());
          innerInfo.put("freeSpace", v.getAvailable());
          innerInfo.put("reservedSpace", v.getReserved());
          info.put(v.getDir().toString(), innerInfo);
        }
        return JSON.toString(info);
      } catch (IOException e) {
        LOG.info("Cannot get volume info.", e);
        return "ERROR";
      }
    }
docs: Returned information is a JSON representation of a map with
  volume name as the key and value is a map of volume attribute
  keys to its values