Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-24696 Include JVM information on Web UI under "Software Attributes" #2117

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions hbase-rest/src/main/resources/hbase-webapps/rest/rest.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -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"%>
<%
Expand Down Expand Up @@ -85,6 +86,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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
<th>Value</th>
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ org.apache.hadoop.hbase.ServerName;
org.apache.hadoop.hbase.HBaseConfiguration;
org.apache.hadoop.hbase.protobuf.ProtobufUtil;
org.apache.hadoop.hbase.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>
Expand Down Expand Up @@ -136,6 +137,11 @@ org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
<th>Value</th>
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
import org.apache.hadoop.hbase.classification.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
Expand All @@ -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");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.util.JvmVersion"
import="org.apache.hadoop.hbase.util.VersionInfo"
import="java.util.Date"
%>
Expand Down Expand Up @@ -92,6 +93,11 @@ String framed = conf.get("hbase.regionserver.thrift.framed", "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>
Expand Down