From 5073bd6e0472d2876bc5a72cb33678bebdddfb5c Mon Sep 17 00:00:00 2001 From: Deon Huang Date: Sun, 13 Aug 2017 21:52:03 +0800 Subject: [PATCH] HBASE-2631 Decide between InMB and MB as suffix for field names in ClusterStatus objects Signed-off-by: Chia-Ping Tsai --- .../org/apache/hadoop/hbase/ServerLoad.java | 27 +++++++++++++++++++ .../tmpl/master/RegionServerListTmpl.jamon | 4 +-- .../apache/hadoop/hbase/TestServerLoad.java | 6 ++--- 3 files changed, 32 insertions(+), 5 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 8547dfb89a7..8d4c7d36482 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 @@ -131,18 +131,45 @@ public class ServerLoad { return storeUncompressedSizeMB; } + /** + * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 + * Use {@link #getStorefileSizeMB()} instead. + */ + @Deprecated public int getStorefileSizeInMB() { return storefileSizeMB; } + public int getStorefileSizeMB() { + return storefileSizeMB; + } + + /** + * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 + * Use {@link #getMemstoreSizeMB()} instead. + */ + @Deprecated public int getMemstoreSizeInMB() { return memstoreSizeMB; } + public int getMemstoreSizeMB() { + return memstoreSizeMB; + } + + /** + * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 + * Use {@link #getStorefileIndexSizeMB()} instead. + */ + @Deprecated public int getStorefileIndexSizeInMB() { return storefileIndexSizeMB; } + public int getStorefileIndexSizeMB() { + return storefileIndexSizeMB; + } + public long getReadRequestsCount() { return readRequestsCount; } 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 a62d5eb5cf2..5dd10e8435e 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 @@ -153,7 +153,7 @@ for (ServerName serverName: serverNames) { * TraditionalBinaryPrefix.MEGA.value, "B", 1) %> <% TraditionalBinaryPrefix.long2String(sl.getMaxHeapMB() * TraditionalBinaryPrefix.MEGA.value, "B", 1) %> - <% TraditionalBinaryPrefix.long2String(sl.getMemstoreSizeInMB() + <% TraditionalBinaryPrefix.long2String(sl.getMemstoreSizeMB() * TraditionalBinaryPrefix.MEGA.value, "B", 1) %> @@ -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.getStorefileSizeMB() * 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 cbd76ce6bd7..2d248b04c94 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,8 +41,8 @@ public class TestServerLoad { assertEquals(114, sl.getStorefiles()); assertEquals(129, sl.getStoreUncompressedSizeMB()); assertEquals(504, sl.getRootIndexSizeKB()); - assertEquals(820, sl.getStorefileSizeInMB()); - assertEquals(82, sl.getStorefileIndexSizeInMB()); + assertEquals(820, sl.getStorefileSizeMB()); + assertEquals(82, sl.getStorefileIndexSizeMB()); assertEquals(((long)Integer.MAX_VALUE)*2, sl.getReadRequestsCount()); assertEquals(300, sl.getFilteredReadRequestsCount()); @@ -68,7 +68,7 @@ public class TestServerLoad { assertEquals(totalCount, sl.getReadRequestsCount()); assertEquals(totalCount, sl.getWriteRequestsCount()); } - + private ClusterStatusProtos.ServerLoad createServerLoadProto() { HBaseProtos.RegionSpecifier rSpecOne = HBaseProtos.RegionSpecifier.newBuilder()