HBASE-24381 The Size metrics in Master Webui is wrong if the size is 0 (#1723)
This commit is contained in:
parent
15627bb722
commit
61efb6d5ad
|
@ -171,10 +171,10 @@ if (master.getServerManager() != null) {
|
||||||
</tr>
|
</tr>
|
||||||
<%java>
|
<%java>
|
||||||
final String ZEROMB = "0 MB";
|
final String ZEROMB = "0 MB";
|
||||||
String usedHeapStr = ZEROMB;
|
|
||||||
String maxHeapStr = ZEROMB;
|
|
||||||
String memstoreSizeStr = ZEROMB;
|
|
||||||
for (RSGroupInfo rsGroupInfo: rsGroupInfos) {
|
for (RSGroupInfo rsGroupInfo: rsGroupInfos) {
|
||||||
|
String usedHeapStr = ZEROMB;
|
||||||
|
String maxHeapStr = ZEROMB;
|
||||||
|
String memstoreSizeStr = ZEROMB;
|
||||||
String rsGroupName = rsGroupInfo.getName();
|
String rsGroupName = rsGroupInfo.getName();
|
||||||
long usedHeap = 0;
|
long usedHeap = 0;
|
||||||
long maxHeap = 0;
|
long maxHeap = 0;
|
||||||
|
@ -275,11 +275,11 @@ if (master.getServerManager() != null) {
|
||||||
<%java>
|
<%java>
|
||||||
final String ZEROKB = "0 KB";
|
final String ZEROKB = "0 KB";
|
||||||
final String ZEROMB = "0 MB";
|
final String ZEROMB = "0 MB";
|
||||||
String uncompressedStorefileSizeStr = ZEROMB;
|
|
||||||
String storefileSizeStr = ZEROMB;
|
|
||||||
String indexSizeStr = ZEROKB;
|
|
||||||
String bloomSizeStr = ZEROKB;
|
|
||||||
for (RSGroupInfo rsGroupInfo: rsGroupInfos) {
|
for (RSGroupInfo rsGroupInfo: rsGroupInfos) {
|
||||||
|
String uncompressedStorefileSizeStr = ZEROMB;
|
||||||
|
String storefileSizeStr = ZEROMB;
|
||||||
|
String indexSizeStr = ZEROKB;
|
||||||
|
String bloomSizeStr = ZEROKB;
|
||||||
String rsGroupName = rsGroupInfo.getName();
|
String rsGroupName = rsGroupInfo.getName();
|
||||||
int numStores = 0;
|
int numStores = 0;
|
||||||
long numStorefiles = 0;
|
long numStorefiles = 0;
|
||||||
|
|
|
@ -162,31 +162,31 @@ Arrays.sort(serverNames);
|
||||||
<tbody>
|
<tbody>
|
||||||
<%java>
|
<%java>
|
||||||
final String ZEROMB = "0 MB";
|
final String ZEROMB = "0 MB";
|
||||||
String usedHeapStr = ZEROMB;
|
|
||||||
String maxHeapStr = ZEROMB;
|
|
||||||
String memStoreSizeMBStr = ZEROMB;
|
|
||||||
for (ServerName serverName: serverNames) {
|
for (ServerName serverName: serverNames) {
|
||||||
ServerMetrics sl = master.getServerManager().getLoad(serverName);
|
String usedHeapStr = ZEROMB;
|
||||||
if (sl != null) {
|
String maxHeapStr = ZEROMB;
|
||||||
long memStoreSizeMB = 0;
|
String memStoreSizeMBStr = ZEROMB;
|
||||||
for (RegionMetrics rl : sl.getRegionMetrics().values()) {
|
ServerMetrics sl = master.getServerManager().getLoad(serverName);
|
||||||
memStoreSizeMB += rl.getMemStoreSize().get(Size.Unit.MEGABYTE);
|
if (sl != null) {
|
||||||
}
|
long memStoreSizeMB = 0;
|
||||||
if (memStoreSizeMB > 0) {
|
for (RegionMetrics rl : sl.getRegionMetrics().values()) {
|
||||||
memStoreSizeMBStr = TraditionalBinaryPrefix.long2String(memStoreSizeMB
|
memStoreSizeMB += rl.getMemStoreSize().get(Size.Unit.MEGABYTE);
|
||||||
* TraditionalBinaryPrefix.MEGA.value, "B", 1);
|
}
|
||||||
}
|
if (memStoreSizeMB > 0) {
|
||||||
|
memStoreSizeMBStr = TraditionalBinaryPrefix.long2String(memStoreSizeMB
|
||||||
|
* TraditionalBinaryPrefix.MEGA.value, "B", 1);
|
||||||
|
}
|
||||||
|
|
||||||
double usedHeapSizeMB = sl.getUsedHeapSize().get(Size.Unit.MEGABYTE);
|
double usedHeapSizeMB = sl.getUsedHeapSize().get(Size.Unit.MEGABYTE);
|
||||||
if (usedHeapSizeMB > 0) {
|
if (usedHeapSizeMB > 0) {
|
||||||
usedHeapStr = TraditionalBinaryPrefix.long2String((long) usedHeapSizeMB
|
usedHeapStr = TraditionalBinaryPrefix.long2String((long) usedHeapSizeMB
|
||||||
* TraditionalBinaryPrefix.MEGA.value, "B", 1);
|
* TraditionalBinaryPrefix.MEGA.value, "B", 1);
|
||||||
}
|
}
|
||||||
double maxHeapSizeMB = sl.getMaxHeapSize().get(Size.Unit.MEGABYTE);
|
double maxHeapSizeMB = sl.getMaxHeapSize().get(Size.Unit.MEGABYTE);
|
||||||
if (maxHeapSizeMB > 0) {
|
if (maxHeapSizeMB > 0) {
|
||||||
maxHeapStr = TraditionalBinaryPrefix.long2String((long) maxHeapSizeMB
|
maxHeapStr = TraditionalBinaryPrefix.long2String((long) maxHeapSizeMB
|
||||||
* TraditionalBinaryPrefix.MEGA.value, "B", 1);
|
* TraditionalBinaryPrefix.MEGA.value, "B", 1);
|
||||||
}
|
}
|
||||||
</%java>
|
</%java>
|
||||||
<tr>
|
<tr>
|
||||||
<td><& serverNameLink; serverName=serverName; &></td>
|
<td><& serverNameLink; serverName=serverName; &></td>
|
||||||
|
@ -195,11 +195,11 @@ for (ServerName serverName: serverNames) {
|
||||||
<td><% memStoreSizeMBStr %></td>
|
<td><% memStoreSizeMBStr %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<%java>
|
<%java>
|
||||||
} else {
|
} else {
|
||||||
</%java>
|
</%java>
|
||||||
<& emptyStat; serverName=serverName; &>
|
<& emptyStat; serverName=serverName; &>
|
||||||
<%java>
|
<%java>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</%java>
|
</%java>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -276,44 +276,44 @@ if (sl != null) {
|
||||||
<%java>
|
<%java>
|
||||||
final String ZEROKB = "0 KB";
|
final String ZEROKB = "0 KB";
|
||||||
final String ZEROMB = "0 MB";
|
final String ZEROMB = "0 MB";
|
||||||
String storeUncompressedSizeMBStr = ZEROMB;
|
|
||||||
String storeFileSizeMBStr = ZEROMB;
|
|
||||||
String totalStaticIndexSizeKBStr = ZEROKB;
|
|
||||||
String totalStaticBloomSizeKBStr = ZEROKB;
|
|
||||||
for (ServerName serverName: serverNames) {
|
for (ServerName serverName: serverNames) {
|
||||||
|
|
||||||
ServerMetrics sl = master.getServerManager().getLoad(serverName);
|
String storeUncompressedSizeMBStr = ZEROMB;
|
||||||
if (sl != null) {
|
String storeFileSizeMBStr = ZEROMB;
|
||||||
long storeCount = 0;
|
String totalStaticIndexSizeKBStr = ZEROKB;
|
||||||
long storeFileCount = 0;
|
String totalStaticBloomSizeKBStr = ZEROKB;
|
||||||
long storeUncompressedSizeMB = 0;
|
ServerMetrics sl = master.getServerManager().getLoad(serverName);
|
||||||
long storeFileSizeMB = 0;
|
if (sl != null) {
|
||||||
long totalStaticIndexSizeKB = 0;
|
long storeCount = 0;
|
||||||
long totalStaticBloomSizeKB = 0;
|
long storeFileCount = 0;
|
||||||
for (RegionMetrics rl : sl.getRegionMetrics().values()) {
|
long storeUncompressedSizeMB = 0;
|
||||||
storeCount += rl.getStoreCount();
|
long storeFileSizeMB = 0;
|
||||||
storeFileCount += rl.getStoreFileCount();
|
long totalStaticIndexSizeKB = 0;
|
||||||
storeUncompressedSizeMB += rl.getUncompressedStoreFileSize().get(Size.Unit.MEGABYTE);
|
long totalStaticBloomSizeKB = 0;
|
||||||
storeFileSizeMB += rl.getStoreFileSize().get(Size.Unit.MEGABYTE);
|
for (RegionMetrics rl : sl.getRegionMetrics().values()) {
|
||||||
totalStaticIndexSizeKB += rl.getStoreFileUncompressedDataIndexSize().get(Size.Unit.KILOBYTE);
|
storeCount += rl.getStoreCount();
|
||||||
totalStaticBloomSizeKB += rl.getBloomFilterSize().get(Size.Unit.KILOBYTE);
|
storeFileCount += rl.getStoreFileCount();
|
||||||
}
|
storeUncompressedSizeMB += rl.getUncompressedStoreFileSize().get(Size.Unit.MEGABYTE);
|
||||||
if (storeUncompressedSizeMB > 0) {
|
storeFileSizeMB += rl.getStoreFileSize().get(Size.Unit.MEGABYTE);
|
||||||
storeUncompressedSizeMBStr = TraditionalBinaryPrefix.
|
totalStaticIndexSizeKB += rl.getStoreFileUncompressedDataIndexSize().get(Size.Unit.KILOBYTE);
|
||||||
long2String(storeUncompressedSizeMB * TraditionalBinaryPrefix.MEGA.value, "B", 1);
|
totalStaticBloomSizeKB += rl.getBloomFilterSize().get(Size.Unit.KILOBYTE);
|
||||||
}
|
}
|
||||||
if (storeFileSizeMB > 0) {
|
if (storeUncompressedSizeMB > 0) {
|
||||||
storeFileSizeMBStr = TraditionalBinaryPrefix.
|
storeUncompressedSizeMBStr = TraditionalBinaryPrefix.
|
||||||
long2String(storeFileSizeMB * TraditionalBinaryPrefix.MEGA.value, "B", 1);
|
long2String(storeUncompressedSizeMB * TraditionalBinaryPrefix.MEGA.value, "B", 1);
|
||||||
}
|
}
|
||||||
if (totalStaticIndexSizeKB > 0) {
|
if (storeFileSizeMB > 0) {
|
||||||
totalStaticIndexSizeKBStr = TraditionalBinaryPrefix.
|
storeFileSizeMBStr = TraditionalBinaryPrefix.
|
||||||
long2String(totalStaticIndexSizeKB * TraditionalBinaryPrefix.KILO.value, "B", 1);
|
long2String(storeFileSizeMB * TraditionalBinaryPrefix.MEGA.value, "B", 1);
|
||||||
}
|
}
|
||||||
if (totalStaticBloomSizeKB > 0) {
|
if (totalStaticIndexSizeKB > 0) {
|
||||||
totalStaticBloomSizeKBStr = TraditionalBinaryPrefix.
|
totalStaticIndexSizeKBStr = TraditionalBinaryPrefix.
|
||||||
long2String(totalStaticBloomSizeKB * TraditionalBinaryPrefix.KILO.value, "B", 1);
|
long2String(totalStaticIndexSizeKB * TraditionalBinaryPrefix.KILO.value, "B", 1);
|
||||||
}
|
}
|
||||||
|
if (totalStaticBloomSizeKB > 0) {
|
||||||
|
totalStaticBloomSizeKBStr = TraditionalBinaryPrefix.
|
||||||
|
long2String(totalStaticBloomSizeKB * TraditionalBinaryPrefix.KILO.value, "B", 1);
|
||||||
|
}
|
||||||
</%java>
|
</%java>
|
||||||
<tr>
|
<tr>
|
||||||
<td><& serverNameLink; serverName=serverName; &></td>
|
<td><& serverNameLink; serverName=serverName; &></td>
|
||||||
|
@ -325,11 +325,11 @@ if (sl != null) {
|
||||||
<td><% totalStaticBloomSizeKBStr %></td>
|
<td><% totalStaticBloomSizeKBStr %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<%java>
|
<%java>
|
||||||
} else {
|
} else {
|
||||||
</%java>
|
</%java>
|
||||||
<& emptyStat; serverName=serverName; &>
|
<& emptyStat; serverName=serverName; &>
|
||||||
<%java>
|
<%java>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</%java>
|
</%java>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -213,11 +213,10 @@
|
||||||
<th>Memstore Size</th>
|
<th>Memstore Size</th>
|
||||||
</tr>
|
</tr>
|
||||||
<%
|
<%
|
||||||
String usedHeapSizeMBStr = ZEROMB;
|
|
||||||
String maxHeapSizeMBStr = ZEROMB;
|
|
||||||
String memStoreSizeMBStr = ZEROMB;
|
|
||||||
|
|
||||||
for (Address server: rsGroupServers) {
|
for (Address server: rsGroupServers) {
|
||||||
|
String usedHeapSizeMBStr = ZEROMB;
|
||||||
|
String maxHeapSizeMBStr = ZEROMB;
|
||||||
|
String memStoreSizeMBStr = ZEROMB;
|
||||||
ServerName serverName = serverMaping.get(server);
|
ServerName serverName = serverMaping.get(server);
|
||||||
ServerMetrics sl = onlineServers.get(server);
|
ServerMetrics sl = onlineServers.get(server);
|
||||||
if (sl != null && serverName != null) {
|
if (sl != null && serverName != null) {
|
||||||
|
@ -309,11 +308,11 @@
|
||||||
<th>Bloom Size</th>
|
<th>Bloom Size</th>
|
||||||
</tr>
|
</tr>
|
||||||
<%
|
<%
|
||||||
String storeUncompressedSizeMBStr = ZEROMB;
|
|
||||||
String storeFileSizeMBStr = ZEROMB;
|
|
||||||
String totalStaticIndexSizeKBStr = ZEROKB;
|
|
||||||
String totalStaticBloomSizeKBStr = ZEROKB;
|
|
||||||
for (Address server: rsGroupServers) {
|
for (Address server: rsGroupServers) {
|
||||||
|
String storeUncompressedSizeMBStr = ZEROMB;
|
||||||
|
String storeFileSizeMBStr = ZEROMB;
|
||||||
|
String totalStaticIndexSizeKBStr = ZEROKB;
|
||||||
|
String totalStaticBloomSizeKBStr = ZEROKB;
|
||||||
ServerName serverName = serverMaping.get(server);
|
ServerName serverName = serverMaping.get(server);
|
||||||
ServerMetrics sl = onlineServers.get(server);
|
ServerMetrics sl = onlineServers.get(server);
|
||||||
if (sl != null && serverName != null) {
|
if (sl != null && serverName != null) {
|
||||||
|
|
Loading…
Reference in New Issue