org.apache.hadoop.hbase.util
Class InfoServer

java.lang.Object
  extended by org.apache.hadoop.http.HttpServer
      extended by org.apache.hadoop.hbase.util.InfoServer
All Implemented Interfaces:
org.apache.hadoop.http.FilterContainer

public class InfoServer
extends org.apache.hadoop.http.HttpServer

Create a Jetty embedded server to answer http requests. The primary goal is to serve up status information for the server. There are three contexts: "/stacks/" -> points to stack trace "/static/" -> points to common static files (src/hbase-webapps/static) "/" -> the jsp server code from (src/hbase-webapps/)


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.http.HttpServer
org.apache.hadoop.http.HttpServer.QuotingInputFilter, org.apache.hadoop.http.HttpServer.StackServlet
 
Field Summary
 
Fields inherited from class org.apache.hadoop.http.HttpServer
defaultContexts, filterNames, findPort, listener, LOG, webAppContext, webServer
 
Constructor Summary
InfoServer(String name, String bindAddress, int port, boolean findPort, org.apache.hadoop.conf.Configuration c)
          Create a status server on the given port.
 
Method Summary
protected  String getWebAppsPath()
          Get the pathname to the path files.
protected  String getWebAppsPath(String appName)
          Get the pathname to the webapps files.
 
Methods inherited from class org.apache.hadoop.http.HttpServer
addContext, addContext, addDefaultApps, addDefaultServlets, addFilter, addFilterPathMapping, addGlobalFilter, addInternalServlet, addInternalServlet, addJerseyResourcePackage, addServlet, addSslListener, addSslListener, addSslListener, createBaseListener, createDefaultChannelConnector, defineFilter, getAttribute, getPort, hasAdministratorAccess, join, setAttribute, setAttribute, setThreads, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InfoServer

public InfoServer(String name,
                  String bindAddress,
                  int port,
                  boolean findPort,
                  org.apache.hadoop.conf.Configuration c)
           throws IOException
Create a status server on the given port. The jsp scripts are taken from src/hbase-webapps/name.

Parameters:
name - The name of the server
bindAddress - address to bind to
port - The port to use on the server
findPort - whether the server should start at the given port and increment by 1 until it finds a free port.
Throws:
IOException - e
Method Detail

getWebAppsPath

protected String getWebAppsPath(String appName)
                         throws FileNotFoundException
Get the pathname to the webapps files.

Parameters:
appName - eg "secondary" or "datanode"
Returns:
the pathname as a URL
Throws:
FileNotFoundException - if 'webapps' directory cannot be found on CLASSPATH.

getWebAppsPath

protected String getWebAppsPath()
                         throws IOException
Get the pathname to the path files.

Overrides:
getWebAppsPath in class org.apache.hadoop.http.HttpServer
Returns:
the pathname as a URL
Throws:
IOException


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.