HBASE-2631 Decide between InMB and MB as suffix for field names in ClusterStatus objects
Signed-off-by: Chia-Ping Tsai <chia7...@gmail.com> Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/d37266f6 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/d37266f6 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/d37266f6 Branch: refs/heads/HBASE-14070.HLC Commit: d37266f63cf90068415a8cef05b1c63dccc0a9d9 Parents: d4317c8 Author: Deon Huang <yjhyjhy...@gmail.com> Authored: Sun Aug 13 21:52:03 2017 +0800 Committer: Chia-Ping Tsai <chia7...@gmail.com> Committed: Tue Aug 15 21:42:31 2017 +0800 ---------------------------------------------------------------------- .../org/apache/hadoop/hbase/ServerLoad.java | 27 ++++++++++++++++++++ .../tmpl/master/RegionServerListTmpl.jamon | 4 +-- .../org/apache/hadoop/hbase/TestServerLoad.java | 6 ++--- 3 files changed, 32 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/d37266f6/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java ---------------------------------------------------------------------- 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 8547dfb..8d4c7d3 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; } http://git-wip-us.apache.org/repos/asf/hbase/blob/d37266f6/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon ---------------------------------------------------------------------- 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 a62d5eb..5dd10e8 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) %></td> <td><% TraditionalBinaryPrefix.long2String(sl.getMaxHeapMB() * TraditionalBinaryPrefix.MEGA.value, "B", 1) %></td> - <td><% TraditionalBinaryPrefix.long2String(sl.getMemstoreSizeInMB() + <td><% TraditionalBinaryPrefix.long2String(sl.getMemstoreSizeMB() * TraditionalBinaryPrefix.MEGA.value, "B", 1) %></td> </tr> @@ -232,7 +232,7 @@ if (sl != null) { <td><% sl.getStorefiles() %></td> <td><% TraditionalBinaryPrefix.long2String( sl.getStoreUncompressedSizeMB() * TraditionalBinaryPrefix.MEGA.value, "B", 1) %></td> -<td><% TraditionalBinaryPrefix.long2String(sl.getStorefileSizeInMB() +<td><% TraditionalBinaryPrefix.long2String(sl.getStorefileSizeMB() * TraditionalBinaryPrefix.MEGA.value, "B", 1) %></td> <td><% TraditionalBinaryPrefix.long2String(sl.getTotalStaticIndexSizeKB() * TraditionalBinaryPrefix.KILO.value, "B", 1) %></td> http://git-wip-us.apache.org/repos/asf/hbase/blob/d37266f6/hbase-server/src/test/java/org/apache/hadoop/hbase/TestServerLoad.java ---------------------------------------------------------------------- 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 cbd76ce..2d248b0 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()