HDFS-11375. Display the volume storage type in datanode UI. Contributed by Surendra Singh Lilhore

This commit is contained in:
Mingliang Liu 2017-02-15 11:37:26 -08:00
parent 627da6f717
commit 0741dd3b9a
2 changed files with 5 additions and 0 deletions

View File

@ -2606,6 +2606,7 @@ private static class VolumeInfo {
final long reservedSpaceForReplicas; // size of space reserved RBW or
// re-replication
final long numBlocks;
final StorageType storageType;
VolumeInfo(FsVolumeImpl v, long usedSpace, long freeSpace) {
this.directory = v.toString();
@ -2614,6 +2615,7 @@ private static class VolumeInfo {
this.reservedSpace = v.getReserved();
this.reservedSpaceForReplicas = v.getReservedForReplicas();
this.numBlocks = v.getNumBlocks();
this.storageType = v.getStorageType();
}
}
@ -2649,6 +2651,7 @@ public Map<String, Object> getVolumeInfoMap() {
innerInfo.put("reservedSpace", v.reservedSpace);
innerInfo.put("reservedSpaceForReplicas", v.reservedSpaceForReplicas);
innerInfo.put("numBlocks", v.numBlocks);
innerInfo.put("storageType", v.storageType);
info.put(v.directory, innerInfo);
}
return info;

View File

@ -100,6 +100,7 @@
<thead>
<tr>
<th>Directory</th>
<th>StorageType</th>
<th>Capacity Used</th>
<th>Capacity Left</th>
<th>Capacity Reserved</th>
@ -110,6 +111,7 @@
{#dn.VolumeInfo}
<tr>
<td>{name}</td>
<td>{storageType}</td>
<td>{usedSpace|fmt_bytes}</td>
<td>{freeSpace|fmt_bytes}</td>
<td>{reservedSpace|fmt_bytes}</td>