Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 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 @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,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 @@ -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>
Expand Down Expand Up @@ -165,6 +166,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,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]>
Expand Down Expand Up @@ -109,6 +110,11 @@ org.apache.hadoop.hbase.tool.CanaryTool.RegionStdOutSink;
<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() %>, r<% 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 @@ -44,4 +44,13 @@ 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() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the javadoc in the class header, this is a repurposing of the existing class. I think it's fine to put this method into this class, as the name and location of the class seem like a reasonable place to find this information. Can you update the javadoc on the class header according to the expanded scope of the class?

Otherwise, +1.

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 @@ -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");
Expand Down Expand Up @@ -99,6 +100,11 @@ String qop = conf.get("hbase.thrift.security.qop", "None");
<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