From a04cf65d68354c24c3a496aede79ea216ba93e30 Mon Sep 17 00:00:00 2001 From: Andy Yang Date: Fri, 25 Aug 2017 23:57:10 -0700 Subject: [PATCH] HBASE-3935 HServerLoad.storefileIndexSizeMB should be changed to storefileIndexSizeKB --- .../src/main/java/org/apache/hadoop/hbase/ServerLoad.java | 12 ++++++------ .../hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon | 2 +- .../test/java/org/apache/hadoop/hbase/TestServerLoad.java | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java index 8547dfb89a..2a8e160700 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java @@ -43,7 +43,7 @@ public class ServerLoad { private int stores = 0; private int storefiles = 0; private int storeUncompressedSizeMB = 0; - private int storefileSizeMB = 0; + private int storefileSizeKB = 0; private int memstoreSizeMB = 0; private int storefileIndexSizeMB = 0; private long readRequestsCount = 0; @@ -62,7 +62,7 @@ public class ServerLoad { stores += rl.getStores(); storefiles += rl.getStorefiles(); storeUncompressedSizeMB += rl.getStoreUncompressedSizeMB(); - storefileSizeMB += rl.getStorefileSizeMB(); + storefileSizeKB += rl.getStorefileSizeMB()*1024; memstoreSizeMB += rl.getMemstoreSizeMB(); storefileIndexSizeMB += rl.getStorefileIndexSizeMB(); readRequestsCount += rl.getReadRequestsCount(); @@ -131,8 +131,8 @@ public class ServerLoad { return storeUncompressedSizeMB; } - public int getStorefileSizeInMB() { - return storefileSizeMB; + public int getStorefileSizeInKB() { + return storefileSizeKB; } public int getMemstoreSizeInMB() { @@ -289,13 +289,13 @@ public class ServerLoad { sb = Strings.appendKeyValue(sb, "storefileUncompressedSizeMB", Integer.valueOf(this.storeUncompressedSizeMB)); - sb = Strings.appendKeyValue(sb, "storefileSizeMB", Integer.valueOf(this.storefileSizeMB)); + sb = Strings.appendKeyValue(sb, "storefileSizeKB", Integer.valueOf(this.storefileSizeKB)); if (this.storeUncompressedSizeMB != 0) { sb = Strings.appendKeyValue( sb, "compressionRatio", - String.format("%.4f", (float) this.storefileSizeMB + String.format("%.4f", (float) this.storefileSizeKB / (float) this.storeUncompressedSizeMB)); } sb = Strings.appendKeyValue(sb, "memstoreSizeMB", Integer.valueOf(this.memstoreSizeMB)); diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon index a62d5eb5cf..c56d392962 100644 --- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon +++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon @@ -232,7 +232,7 @@ if (sl != null) { <% sl.getStorefiles() %> <% TraditionalBinaryPrefix.long2String( sl.getStoreUncompressedSizeMB() * TraditionalBinaryPrefix.MEGA.value, "B", 1) %> -<% TraditionalBinaryPrefix.long2String(sl.getStorefileSizeInMB() +<% TraditionalBinaryPrefix.long2String(sl.getStorefileSizeInKB() * TraditionalBinaryPrefix.MEGA.value, "B", 1) %> <% TraditionalBinaryPrefix.long2String(sl.getTotalStaticIndexSizeKB() * TraditionalBinaryPrefix.KILO.value, "B", 1) %> diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerLoad.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerLoad.java index cbd76ce6bd..8ccfa505a4 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerLoad.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerLoad.java @@ -41,7 +41,7 @@ public class TestServerLoad { assertEquals(114, sl.getStorefiles()); assertEquals(129, sl.getStoreUncompressedSizeMB()); assertEquals(504, sl.getRootIndexSizeKB()); - assertEquals(820, sl.getStorefileSizeInMB()); + assertEquals(820, sl.getStorefileSizeInKB()); assertEquals(82, sl.getStorefileIndexSizeInMB()); assertEquals(((long)Integer.MAX_VALUE)*2, sl.getReadRequestsCount()); assertEquals(300, sl.getFilteredReadRequestsCount()); -- 2.11.0