This is an automated email from the ASF dual-hosted git repository. vjasani pushed a commit to branch branch-2.3 in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.3 by this push: new 965a4a0 HBASE-24696 Include JVM information on Web UI under "Software Attributes" 965a4a0 is described below commit 965a4a0ae716df9fd2e0a402879b6972419b1f14 Author: Mingliang Liu <lium...@apache.org> AuthorDate: Tue Jul 21 16:49:04 2020 +0530 HBASE-24696 Include JVM information on Web UI under "Software Attributes" Closes #2087 Signed-off-by: Viraj Jasani <vjas...@apache.org> Signed-off-by: Nick Dimiduk <ndimi...@apache.org> --- hbase-rest/src/main/resources/hbase-webapps/rest/rest.jsp | 6 ++++++ .../hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon | 5 +++++ .../hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon | 6 ++++++ .../apache/hadoop/hbase/tmpl/tool/CanaryStatusTmpl.jamon | 6 ++++++ .../java/org/apache/hadoop/hbase/util/JvmVersion.java | 15 +++++++++++---- .../src/main/resources/hbase-webapps/thrift/thrift.jsp | 6 ++++++ 6 files changed, 40 insertions(+), 4 deletions(-) diff --git a/hbase-rest/src/main/resources/hbase-webapps/rest/rest.jsp b/hbase-rest/src/main/resources/hbase-webapps/rest/rest.jsp index ed4e9c2..3deb2bb 100644 --- a/hbase-rest/src/main/resources/hbase-webapps/rest/rest.jsp +++ b/hbase-rest/src/main/resources/hbase-webapps/rest/rest.jsp @@ -20,6 +20,7 @@ <%@ page contentType="text/html;charset=UTF-8" import="org.apache.hadoop.conf.Configuration" import="org.apache.hadoop.hbase.HBaseConfiguration" + import="org.apache.hadoop.hbase.rest.model.VersionModel" import="org.apache.hadoop.hbase.util.VersionInfo" import="java.util.Date"%> <% @@ -83,6 +84,11 @@ String listenPort = conf.get("hbase.rest.port", "8080"); <th>Value</th> <th>Description</th> </tr> + <tr> + <td>JVM Version</td> + <td><%= new VersionModel(getServletContext()).getJVMVersion() %></td> + <td>JVM vendor and version</td> + </tr> <tr> <td>HBase Version</td> <td><%= VersionInfo.getVersion() %>, revision=<%= VersionInfo.getRevision() %></td> diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon index e247e75..c6f7bcb 100644 --- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon +++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon @@ -298,6 +298,11 @@ AssignmentManager assignmentManager = master.getAssignmentManager(); <th>Description</th> </tr> <tr> + <td>JVM Version</td> + <td><% JvmVersion.getVersion() %></td> + <td>JVM vendor and version</td> + </tr> + <tr> <td>HBase Version</td> <td><% org.apache.hadoop.hbase.util.VersionInfo.getVersion() %>, revision=<% org.apache.hadoop.hbase.util.VersionInfo.getRevision() %></td><td>HBase version and revision</td> </tr> diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon index b21a9c3..388357d 100644 --- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon +++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon @@ -32,6 +32,7 @@ org.apache.hadoop.hbase.HBaseConfiguration; org.apache.hadoop.hbase.io.hfile.CacheConfig; org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil; org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.ServerInfo; +org.apache.hadoop.hbase.util.JvmVersion; org.apache.hadoop.hbase.zookeeper.MasterAddressTracker; </%import> <%doc>If json AND bcn is NOT an empty string presume it a block cache view request.</%doc> @@ -166,6 +167,11 @@ org.apache.hadoop.hbase.zookeeper.MasterAddressTracker; <th>Description</th> </tr> <tr> + <td>JVM Version</td> + <td><% JvmVersion.getVersion() %></td> + <td>JVM vendor and version</td> + </tr> + <tr> <td>HBase Version</td> <td><% org.apache.hadoop.hbase.util.VersionInfo.getVersion() %>, revision=<% org.apache.hadoop.hbase.util.VersionInfo.getRevision() %></td> <td>HBase version and revision</td> diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/tool/CanaryStatusTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/tool/CanaryStatusTmpl.jamon index e2d29ee..9536b8d 100644 --- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/tool/CanaryStatusTmpl.jamon +++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/tool/CanaryStatusTmpl.jamon @@ -25,6 +25,7 @@ java.util.Map; java.util.concurrent.atomic.LongAdder; org.apache.hadoop.hbase.ServerName; org.apache.hadoop.hbase.tool.CanaryTool.RegionStdOutSink; +org.apache.hadoop.hbase.util.JvmVersion; </%import> <!--[if IE]> @@ -110,6 +111,11 @@ org.apache.hadoop.hbase.tool.CanaryTool.RegionStdOutSink; <th>Description</th> </tr> <tr> + <td>JVM Version</td> + <td><% JvmVersion.getVersion() %></td> + <td>JVM vendor and version</td> + </tr> + <tr> <td>HBase Version</td> <td><% org.apache.hadoop.hbase.util.VersionInfo.getVersion() %>, r<% org.apache.hadoop.hbase.util.VersionInfo.getRevision() %></td><td>HBase version and revision</td> </tr> diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/JvmVersion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/JvmVersion.java index e2e0cf2..65c952e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/JvmVersion.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/JvmVersion.java @@ -25,9 +25,7 @@ import org.apache.yetus.audience.InterfaceAudience; import org.apache.yetus.audience.InterfaceStability; /** - * Certain JVM versions are known to be unstable with HBase. This - * class has a utility function to determine whether the current JVM - * is known to be unstable. + * Utility class to get and check the current JVM version. */ @InterfaceAudience.Private @InterfaceStability.Stable @@ -38,10 +36,19 @@ public abstract class JvmVersion { } /** - * Return true if the current JVM is known to be unstable. + * Return true if the current JVM version is known to be unstable with HBase. */ public static boolean isBadJvmVersion() { String version = System.getProperty("java.version"); return version != null && BAD_JVM_VERSIONS.contains(version); } + + /** + * Return the current JVM version information. + */ + public static String getVersion() { + return System.getProperty("java.vm.vendor", "UNKNOWN_VM_VENDOR") + ' ' + + System.getProperty("java.version", "UNKNOWN_JAVA_VERSION") + '-' + + System.getProperty("java.vm.version", "UNKNOWN_VM_VERSION"); + } } diff --git a/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp b/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp index dea80e0..cb22007 100644 --- a/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp +++ b/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp @@ -24,6 +24,7 @@ import="java.util.Date" %> <%@ page import="org.apache.hadoop.hbase.thrift.ImplType" %> +<%@ page import="org.apache.hadoop.hbase.util.JvmVersion" %> <% Configuration conf = (Configuration)getServletContext().getAttribute("hbase.conf"); @@ -91,6 +92,11 @@ String compact = conf.get("hbase.regionserver.thrift.compact", "false"); <th>Value</th> <th>Description</th> </tr> + <tr> + <td>JVM Version</td> + <td><%= JvmVersion.getVersion() %></td> + <td>JVM vendor and version information</td> + </tr> <tr> <td>HBase Version</td> <td><%= VersionInfo.getVersion() %>, r<%= VersionInfo.getRevision() %></td>