HBASE-7757 Add web UI to REST server and Thrift server
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1443069 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
23db419bf3
commit
7df6eff970
|
@ -114,6 +114,10 @@
|
||||||
<jspcompiler uriroot="${src.webapps}/master" outputdir="${generated.sources}/java" package="org.apache.hadoop.hbase.generated.master" webxml="${build.webapps}/master/WEB-INF/web.xml"/>
|
<jspcompiler uriroot="${src.webapps}/master" outputdir="${generated.sources}/java" package="org.apache.hadoop.hbase.generated.master" webxml="${build.webapps}/master/WEB-INF/web.xml"/>
|
||||||
<mkdir dir="${build.webapps}/regionserver/WEB-INF"/>
|
<mkdir dir="${build.webapps}/regionserver/WEB-INF"/>
|
||||||
<jspcompiler uriroot="${src.webapps}/regionserver" outputdir="${generated.sources}/java" package="org.apache.hadoop.hbase.generated.regionserver" webxml="${build.webapps}/regionserver/WEB-INF/web.xml"/>
|
<jspcompiler uriroot="${src.webapps}/regionserver" outputdir="${generated.sources}/java" package="org.apache.hadoop.hbase.generated.regionserver" webxml="${build.webapps}/regionserver/WEB-INF/web.xml"/>
|
||||||
|
<mkdir dir="${build.webapps}/rest/WEB-INF"/>
|
||||||
|
<jspcompiler uriroot="${src.webapps}/rest" outputdir="${generated.sources}/java" package="org.apache.hadoop.hbase.generated.rest" webxml="${build.webapps}/rest/WEB-INF/web.xml"/>
|
||||||
|
<mkdir dir="${build.webapps}/thrift/WEB-INF"/>
|
||||||
|
<jspcompiler uriroot="${src.webapps}/thrift" outputdir="${generated.sources}/java" package="org.apache.hadoop.hbase.generated.thrift" webxml="${build.webapps}/thrift/WEB-INF/web.xml"/>
|
||||||
<exec executable="sh">
|
<exec executable="sh">
|
||||||
<arg line="${basedir}/src/saveVersion.sh ${project.version} ${generated.sources}/java"/>
|
<arg line="${basedir}/src/saveVersion.sh ${project.version} ${generated.sources}/java"/>
|
||||||
</exec>
|
</exec>
|
||||||
|
|
|
@ -32,6 +32,7 @@ import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.hbase.HBaseConfiguration;
|
import org.apache.hadoop.hbase.HBaseConfiguration;
|
||||||
import org.apache.hadoop.hbase.rest.filter.GzipFilter;
|
import org.apache.hadoop.hbase.rest.filter.GzipFilter;
|
||||||
import org.apache.hadoop.hbase.security.User;
|
import org.apache.hadoop.hbase.security.User;
|
||||||
|
import org.apache.hadoop.hbase.util.InfoServer;
|
||||||
import org.apache.hadoop.hbase.util.Strings;
|
import org.apache.hadoop.hbase.util.Strings;
|
||||||
import org.apache.hadoop.hbase.util.VersionInfo;
|
import org.apache.hadoop.hbase.util.VersionInfo;
|
||||||
import org.apache.hadoop.net.DNS;
|
import org.apache.hadoop.net.DNS;
|
||||||
|
@ -64,7 +65,7 @@ public class RESTServer implements Constants {
|
||||||
HelpFormatter formatter = new HelpFormatter();
|
HelpFormatter formatter = new HelpFormatter();
|
||||||
formatter.printHelp("bin/hbase rest start", "", options,
|
formatter.printHelp("bin/hbase rest start", "", options,
|
||||||
"\nTo run the REST server as a daemon, execute " +
|
"\nTo run the REST server as a daemon, execute " +
|
||||||
"bin/hbase-daemon.sh start|stop rest [-p <port>] [-ro]\n", true);
|
"bin/hbase-daemon.sh start|stop rest [--infoport <port>] [-p <port>] [-ro]\n", true);
|
||||||
System.exit(exitCode);
|
System.exit(exitCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,6 +85,7 @@ public class RESTServer implements Constants {
|
||||||
options.addOption("p", "port", true, "Port to bind to [default: 8080]");
|
options.addOption("p", "port", true, "Port to bind to [default: 8080]");
|
||||||
options.addOption("ro", "readonly", false, "Respond only to GET HTTP " +
|
options.addOption("ro", "readonly", false, "Respond only to GET HTTP " +
|
||||||
"method requests [default: false]");
|
"method requests [default: false]");
|
||||||
|
options.addOption(null, "infoport", true, "Port for web UI");
|
||||||
|
|
||||||
CommandLine commandLine = null;
|
CommandLine commandLine = null;
|
||||||
try {
|
try {
|
||||||
|
@ -107,6 +109,14 @@ public class RESTServer implements Constants {
|
||||||
LOG.debug("readonly set to true");
|
LOG.debug("readonly set to true");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check for user-defined info server port setting, if so override the conf
|
||||||
|
if (commandLine != null && commandLine.hasOption("infoport")) {
|
||||||
|
String val = commandLine.getOptionValue("infoport");
|
||||||
|
servlet.getConfiguration()
|
||||||
|
.setInt("hbase.rest.info.port", Integer.valueOf(val));
|
||||||
|
LOG.debug("Web UI port set to " + val);
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<String> remainingArgs = commandLine != null ?
|
List<String> remainingArgs = commandLine != null ?
|
||||||
commandLine.getArgList() : new ArrayList<String>();
|
commandLine.getArgList() : new ArrayList<String>();
|
||||||
|
@ -169,6 +179,16 @@ public class RESTServer implements Constants {
|
||||||
machineName);
|
machineName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Put up info server.
|
||||||
|
int port = conf.getInt("hbase.rest.info.port", 8085);
|
||||||
|
if (port >= 0) {
|
||||||
|
conf.setLong("startcode", System.currentTimeMillis());
|
||||||
|
String a = conf.get("hbase.rest.info.bindAddress", "0.0.0.0");
|
||||||
|
InfoServer infoServer = new InfoServer("rest", a, port, false, conf);
|
||||||
|
infoServer.setAttribute("hbase.conf", conf);
|
||||||
|
infoServer.start();
|
||||||
|
}
|
||||||
|
|
||||||
// start server
|
// start server
|
||||||
server.start();
|
server.start();
|
||||||
server.join();
|
server.join();
|
||||||
|
|
|
@ -32,6 +32,7 @@ import org.apache.hadoop.classification.InterfaceAudience;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.hbase.HBaseConfiguration;
|
import org.apache.hadoop.hbase.HBaseConfiguration;
|
||||||
import org.apache.hadoop.hbase.thrift.ThriftServerRunner.ImplType;
|
import org.apache.hadoop.hbase.thrift.ThriftServerRunner.ImplType;
|
||||||
|
import org.apache.hadoop.hbase.util.InfoServer;
|
||||||
import org.apache.hadoop.hbase.util.VersionInfo;
|
import org.apache.hadoop.hbase.util.VersionInfo;
|
||||||
import org.apache.hadoop.util.Shell.ExitCodeException;
|
import org.apache.hadoop.util.Shell.ExitCodeException;
|
||||||
|
|
||||||
|
@ -60,6 +61,8 @@ public class ThriftServer {
|
||||||
private Configuration conf;
|
private Configuration conf;
|
||||||
ThriftServerRunner serverRunner;
|
ThriftServerRunner serverRunner;
|
||||||
|
|
||||||
|
private InfoServer infoServer;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Main program and support routines
|
// Main program and support routines
|
||||||
//
|
//
|
||||||
|
@ -86,6 +89,16 @@ public class ThriftServer {
|
||||||
void doMain(final String[] args) throws Exception {
|
void doMain(final String[] args) throws Exception {
|
||||||
processOptions(args);
|
processOptions(args);
|
||||||
serverRunner = new ThriftServerRunner(conf);
|
serverRunner = new ThriftServerRunner(conf);
|
||||||
|
|
||||||
|
// Put up info server.
|
||||||
|
int port = conf.getInt("hbase.thrift.info.port", 9095);
|
||||||
|
if (port >= 0) {
|
||||||
|
conf.setLong("startcode", System.currentTimeMillis());
|
||||||
|
String a = conf.get("hbase.thrift.info.bindAddress", "0.0.0.0");
|
||||||
|
infoServer = new InfoServer("thrift", a, port, false, conf);
|
||||||
|
infoServer.setAttribute("hbase.conf", conf);
|
||||||
|
infoServer.start();
|
||||||
|
}
|
||||||
serverRunner.run();
|
serverRunner.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,6 +114,7 @@ public class ThriftServer {
|
||||||
options.addOption("f", FRAMED_OPTION, false, "Use framed transport");
|
options.addOption("f", FRAMED_OPTION, false, "Use framed transport");
|
||||||
options.addOption("c", COMPACT_OPTION, false, "Use the compact protocol");
|
options.addOption("c", COMPACT_OPTION, false, "Use the compact protocol");
|
||||||
options.addOption("h", "help", false, "Print help information");
|
options.addOption("h", "help", false, "Print help information");
|
||||||
|
options.addOption(null, "infoport", true, "Port for web UI");
|
||||||
|
|
||||||
options.addOption("m", MIN_WORKERS_OPTION, true,
|
options.addOption("m", MIN_WORKERS_OPTION, true,
|
||||||
"The minimum number of worker threads for " +
|
"The minimum number of worker threads for " +
|
||||||
|
@ -147,6 +161,18 @@ public class ThriftServer {
|
||||||
printUsageAndExit(options, -1);
|
printUsageAndExit(options, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check for user-defined info server port setting, if so override the conf
|
||||||
|
try {
|
||||||
|
if (cmd.hasOption("infoport")) {
|
||||||
|
String val = cmd.getOptionValue("infoport");
|
||||||
|
conf.setInt("hbase.thrift.info.port", Integer.valueOf(val));
|
||||||
|
LOG.debug("Web UI port set to " + val);
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
LOG.error("Could not parse the value provided for the infoport option", e);
|
||||||
|
printUsageAndExit(options, -1);
|
||||||
|
}
|
||||||
|
|
||||||
// Make optional changes to the configuration based on command-line options
|
// Make optional changes to the configuration based on command-line options
|
||||||
optionToConf(cmd, MIN_WORKERS_OPTION,
|
optionToConf(cmd, MIN_WORKERS_OPTION,
|
||||||
conf, TBoundedThreadPoolServer.MIN_WORKER_THREADS_CONF_KEY);
|
conf, TBoundedThreadPoolServer.MIN_WORKER_THREADS_CONF_KEY);
|
||||||
|
@ -171,6 +197,14 @@ public class ThriftServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stop() {
|
public void stop() {
|
||||||
|
if (this.infoServer != null) {
|
||||||
|
LOG.info("Stopping infoServer");
|
||||||
|
try {
|
||||||
|
this.infoServer.stop();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
serverRunner.shutdown();
|
serverRunner.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ import org.apache.hadoop.hbase.thrift.CallQueue;
|
||||||
import org.apache.hadoop.hbase.thrift.CallQueue.Call;
|
import org.apache.hadoop.hbase.thrift.CallQueue.Call;
|
||||||
import org.apache.hadoop.hbase.thrift.ThriftMetrics;
|
import org.apache.hadoop.hbase.thrift.ThriftMetrics;
|
||||||
import org.apache.hadoop.hbase.thrift2.generated.THBaseService;
|
import org.apache.hadoop.hbase.thrift2.generated.THBaseService;
|
||||||
|
import org.apache.hadoop.hbase.util.InfoServer;
|
||||||
import org.apache.thrift.protocol.TBinaryProtocol;
|
import org.apache.thrift.protocol.TBinaryProtocol;
|
||||||
import org.apache.thrift.protocol.TCompactProtocol;
|
import org.apache.thrift.protocol.TCompactProtocol;
|
||||||
import org.apache.thrift.protocol.TProtocolFactory;
|
import org.apache.thrift.protocol.TProtocolFactory;
|
||||||
|
@ -66,6 +67,7 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||||
* HbaseClient.thrift IDL file.
|
* HbaseClient.thrift IDL file.
|
||||||
*/
|
*/
|
||||||
@InterfaceAudience.Private
|
@InterfaceAudience.Private
|
||||||
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
public class ThriftServer {
|
public class ThriftServer {
|
||||||
private static final Log log = LogFactory.getLog(ThriftServer.class);
|
private static final Log log = LogFactory.getLog(ThriftServer.class);
|
||||||
|
|
||||||
|
@ -91,6 +93,7 @@ public class ThriftServer {
|
||||||
options.addOption("f", "framed", false, "Use framed transport");
|
options.addOption("f", "framed", false, "Use framed transport");
|
||||||
options.addOption("c", "compact", false, "Use the compact protocol");
|
options.addOption("c", "compact", false, "Use the compact protocol");
|
||||||
options.addOption("h", "help", false, "Print help information");
|
options.addOption("h", "help", false, "Print help information");
|
||||||
|
options.addOption(null, "infoport", true, "Port for web UI");
|
||||||
|
|
||||||
OptionGroup servers = new OptionGroup();
|
OptionGroup servers = new OptionGroup();
|
||||||
servers.addOption(
|
servers.addOption(
|
||||||
|
@ -225,15 +228,51 @@ public class ThriftServer {
|
||||||
Configuration conf = HBaseConfiguration.create();
|
Configuration conf = HBaseConfiguration.create();
|
||||||
ThriftMetrics metrics = new ThriftMetrics(conf, ThriftMetrics.ThriftServerType.TWO);
|
ThriftMetrics metrics = new ThriftMetrics(conf, ThriftMetrics.ThriftServerType.TWO);
|
||||||
|
|
||||||
|
String implType = "threadpool";
|
||||||
|
if (nonblocking) {
|
||||||
|
implType = "nonblocking";
|
||||||
|
} else if (hsha) {
|
||||||
|
implType = "hsha";
|
||||||
|
}
|
||||||
|
|
||||||
|
conf.set("hbase.regionserver.thrift.server.type", implType);
|
||||||
|
conf.setInt("hbase.regionserver.thrift.port", listenPort);
|
||||||
|
|
||||||
// Construct correct ProtocolFactory
|
// Construct correct ProtocolFactory
|
||||||
TProtocolFactory protocolFactory = getTProtocolFactory(cmd.hasOption("compact"));
|
boolean compact = cmd.hasOption("compact");
|
||||||
|
TProtocolFactory protocolFactory = getTProtocolFactory(compact);
|
||||||
THBaseService.Iface handler =
|
THBaseService.Iface handler =
|
||||||
ThriftHBaseServiceHandler.newInstance(conf, metrics);
|
ThriftHBaseServiceHandler.newInstance(conf, metrics);
|
||||||
THBaseService.Processor processor = new THBaseService.Processor(handler);
|
THBaseService.Processor processor = new THBaseService.Processor(handler);
|
||||||
|
conf.setBoolean("hbase.regionserver.thrift.compact", compact);
|
||||||
|
|
||||||
boolean framed = cmd.hasOption("framed") || nonblocking || hsha;
|
boolean framed = cmd.hasOption("framed") || nonblocking || hsha;
|
||||||
TTransportFactory transportFactory = getTTransportFactory(framed);
|
TTransportFactory transportFactory = getTTransportFactory(framed);
|
||||||
InetSocketAddress inetSocketAddress = bindToPort(cmd.getOptionValue("bind"), listenPort);
|
InetSocketAddress inetSocketAddress = bindToPort(cmd.getOptionValue("bind"), listenPort);
|
||||||
|
conf.setBoolean("hbase.regionserver.thrift.framed", framed);
|
||||||
|
|
||||||
|
// check for user-defined info server port setting, if so override the conf
|
||||||
|
try {
|
||||||
|
if (cmd.hasOption("infoport")) {
|
||||||
|
String val = cmd.getOptionValue("infoport");
|
||||||
|
conf.setInt("hbase.thrift.info.port", Integer.valueOf(val));
|
||||||
|
log.debug("Web UI port set to " + val);
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
log.error("Could not parse the value provided for the infoport option", e);
|
||||||
|
printUsage();
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Put up info server.
|
||||||
|
int port = conf.getInt("hbase.thrift.info.port", 9095);
|
||||||
|
if (port >= 0) {
|
||||||
|
conf.setLong("startcode", System.currentTimeMillis());
|
||||||
|
String a = conf.get("hbase.thrift.info.bindAddress", "0.0.0.0");
|
||||||
|
InfoServer infoServer = new InfoServer("thrift", a, port, false, conf);
|
||||||
|
infoServer.setAttribute("hbase.conf", conf);
|
||||||
|
infoServer.start();
|
||||||
|
}
|
||||||
|
|
||||||
if (nonblocking) {
|
if (nonblocking) {
|
||||||
server = getTNonBlockingServer(protocolFactory, processor, transportFactory, inetSocketAddress);
|
server = getTNonBlockingServer(protocolFactory, processor, transportFactory, inetSocketAddress);
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
<!--
|
||||||
|
/**
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
<meta HTTP-EQUIV="REFRESH" content="0;url=/rest.jsp"/>
|
|
@ -0,0 +1,121 @@
|
||||||
|
<%--
|
||||||
|
/**
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
--%>
|
||||||
|
<%@ 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.VersionInfo"
|
||||||
|
import="java.util.Date"
|
||||||
|
%>
|
||||||
|
|
||||||
|
<%
|
||||||
|
Configuration conf = (Configuration)getServletContext().getAttribute("hbase.conf");
|
||||||
|
long startcode = conf.getLong("startcode", System.currentTimeMillis());
|
||||||
|
String listenPort = conf.get("hbase.rest.port", "8080");
|
||||||
|
%>
|
||||||
|
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>HBase REST Server: <%= listenPort %></title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="description" content="">
|
||||||
|
|
||||||
|
<link href="/static/css/bootstrap.css" rel="stylesheet">
|
||||||
|
<link href="/static/css/hbase.css" rel="stylesheet">
|
||||||
|
<link href="/static/css/bootstrap-responsive.css" rel="stylesheet">
|
||||||
|
<!--[if lt IE 9]>
|
||||||
|
<script src="/static/js/html5shiv.js"></script>
|
||||||
|
<![endif]-->
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container">
|
||||||
|
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
</a>
|
||||||
|
<a class="brand" href="/rest.jsp"><img src="/static/hbase_logo_small.png" alt="HBase Logo"/></a>
|
||||||
|
<div class="nav-collapse">
|
||||||
|
<ul class="nav">
|
||||||
|
<li class="active"><a href="/">Home</a></li>
|
||||||
|
<li><a href="/logs/">Local logs</a></li>
|
||||||
|
<li><a href="/logLevel">Log Level</a></li>
|
||||||
|
<li><a href="/jmx">Metrics Dump</a></li>
|
||||||
|
<% if (HBaseConfiguration.isShowConfInServlet()) { %>
|
||||||
|
<li><a href="/conf">HBase Configuration</a></li>
|
||||||
|
<% } %>
|
||||||
|
</ul>
|
||||||
|
</div><!--/.nav-collapse -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="row inner_header">
|
||||||
|
<div class="page-header">
|
||||||
|
<h1>RESTServer <small><%= listenPort %></small></h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2>Software Attributes</h2>
|
||||||
|
<table id="attributes_table" class="table table-striped">
|
||||||
|
<tr>
|
||||||
|
<th>Attribute Name</th>
|
||||||
|
<th>Value</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>HBase Version</td>
|
||||||
|
<td><%= VersionInfo.getVersion() %>, r<%= VersionInfo.getRevision() %></td>
|
||||||
|
<td>HBase version and revision</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>HBase Compiled</td>
|
||||||
|
<td><%= VersionInfo.getDate() %>, <%= VersionInfo.getUser() %></td>
|
||||||
|
<td>When HBase version was compiled and by whom</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>REST Server Start Time</td>
|
||||||
|
<td><%= new Date(startcode) %></td>
|
||||||
|
<td>Date stamp of when this REST server was started</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<a href="http://wiki.apache.org/hadoop/Hbase/Stargate">Apache HBase Wiki on REST</a>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="/static/js/jquery.min.js" type="text/javascript"></script>
|
||||||
|
<script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
|
||||||
|
<script src="/static/js/tab.js" type="text/javascript"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
<!--
|
||||||
|
/**
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
<meta HTTP-EQUIV="REFRESH" content="0;url=/thrift.jsp"/>
|
|
@ -0,0 +1,139 @@
|
||||||
|
<%--
|
||||||
|
/**
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
--%>
|
||||||
|
<%@ 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.VersionInfo"
|
||||||
|
import="java.util.Date"
|
||||||
|
%>
|
||||||
|
|
||||||
|
<%
|
||||||
|
Configuration conf = (Configuration)getServletContext().getAttribute("hbase.conf");
|
||||||
|
long startcode = conf.getLong("startcode", System.currentTimeMillis());
|
||||||
|
String listenPort = conf.get("hbase.regionserver.thrift.port", "9090");
|
||||||
|
String serverInfo = listenPort + "," + String.valueOf(startcode);
|
||||||
|
String implType = conf.get("hbase.regionserver.thrift.server.type", "threadpool");
|
||||||
|
String compact = conf.get("hbase.regionserver.thrift.compact", "false");
|
||||||
|
String framed = conf.get("hbase.regionserver.thrift.framed", "false");
|
||||||
|
%>
|
||||||
|
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>HBase Thrift Server: <%= listenPort %></title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="description" content="">
|
||||||
|
|
||||||
|
<link href="/static/css/bootstrap.css" rel="stylesheet">
|
||||||
|
<link href="/static/css/hbase.css" rel="stylesheet">
|
||||||
|
<link href="/static/css/bootstrap-responsive.css" rel="stylesheet">
|
||||||
|
<!--[if lt IE 9]>
|
||||||
|
<script src="/static/js/html5shiv.js"></script>
|
||||||
|
<![endif]-->
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container">
|
||||||
|
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
</a>
|
||||||
|
<a class="brand" href="/thrift.jsp"><img src="/static/hbase_logo_small.png" alt="HBase Logo"/></a>
|
||||||
|
<div class="nav-collapse">
|
||||||
|
<ul class="nav">
|
||||||
|
<li class="active"><a href="/">Home</a></li>
|
||||||
|
<li><a href="/logs/">Local logs</a></li>
|
||||||
|
<li><a href="/logLevel">Log Level</a></li>
|
||||||
|
<li><a href="/jmx">Metrics Dump</a></li>
|
||||||
|
<% if (HBaseConfiguration.isShowConfInServlet()) { %>
|
||||||
|
<li><a href="/conf">HBase Configuration</a></li>
|
||||||
|
<% } %>
|
||||||
|
</ul>
|
||||||
|
</div><!--/.nav-collapse -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="row inner_header">
|
||||||
|
<div class="page-header">
|
||||||
|
<h1>ThriftServer <small><%= listenPort %></small></h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2>Software Attributes</h2>
|
||||||
|
<table id="attributes_table" class="table table-striped">
|
||||||
|
<tr>
|
||||||
|
<th>Attribute Name</th>
|
||||||
|
<th>Value</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>HBase Version</td>
|
||||||
|
<td><%= VersionInfo.getVersion() %>, r<%= VersionInfo.getRevision() %></td>
|
||||||
|
<td>HBase version and revision</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>HBase Compiled</td>
|
||||||
|
<td><%= VersionInfo.getDate() %>, <%= VersionInfo.getUser() %></td>
|
||||||
|
<td>When HBase version was compiled and by whom</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Thrift Server Start Time</td>
|
||||||
|
<td><%= new Date(startcode) %></td>
|
||||||
|
<td>Date stamp of when this Thrift server was started</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Thrift Impl Type</td>
|
||||||
|
<td><%= implType %></td>
|
||||||
|
<td>Thrift RPC engine implementation type chosen by this Thrift server</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Compact Protocol</td>
|
||||||
|
<td><%= compact %></td>
|
||||||
|
<td>Thrift RPC engine uses compact protocol</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Framed Transport</td>
|
||||||
|
<td><%= framed %></td>
|
||||||
|
<td>Thrift RPC engine uses framed transport</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<a href="http://wiki.apache.org/hadoop/Hbase/ThriftApi">Apache HBase Wiki on Thrift</a>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="/static/js/jquery.min.js" type="text/javascript"></script>
|
||||||
|
<script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
|
||||||
|
<script src="/static/js/tab.js" type="text/javascript"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue