/** * 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 */ @Override // DataNodeMXBean public String getVolumeInfo() { Preconditions.checkNotNull(data, "Storage not yet initialized"); return JSON.toString(data.getVolumeInfoMap()); }
@Override public List<DatanodeVolumeInfo> getVolumeReport() throws IOException { checkSuperuserPrivilege(); Map<String, Object> volumeInfoMap = data.getVolumeInfoMap(); if (volumeInfoMap == null) { LOG.warn("DataNode volume info not available."); return new ArrayList<>(0); } List<DatanodeVolumeInfo> volumeInfoList = new ArrayList<>(); for (Entry<String, Object> volume : volumeInfoMap.entrySet()) { @SuppressWarnings("unchecked") Map<String, Object> volumeInfo = (Map<String, Object>) volume.getValue(); DatanodeVolumeInfo dnStorageInfo = new DatanodeVolumeInfo( volume.getKey(), (Long) volumeInfo.get("usedSpace"), (Long) volumeInfo.get("freeSpace"), (Long) volumeInfo.get("reservedSpace"), (Long) volumeInfo.get("reservedSpaceForReplicas"), (Long) volumeInfo.get("numBlocks"), (StorageType) volumeInfo.get("storageType")); volumeInfoList.add(dnStorageInfo); } return volumeInfoList; }
/** * 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 */ @Override // DataNodeMXBean public String getVolumeInfo() { Preconditions.checkNotNull(data, "Storage not yet initialized"); return JSON.toString(data.getVolumeInfoMap()); }
/** * 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 */ @Override // DataNodeMXBean public String getVolumeInfo() { Preconditions.checkNotNull(data, "Storage not yet initialized"); return JSON.toString(data.getVolumeInfoMap()); }
final Map<String, Object> volInfos = dn.data.getVolumeInfoMap(); Assert.assertTrue("No volumes in the fsdataset", volInfos.size() > 0); int i = 0;
final Map<String, Object> volInfos = dn.data.getVolumeInfoMap(); Assert.assertTrue("No volumes in the fsdataset", volInfos.size() > 0); int i = 0;