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.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)
          Create a status server on the given port.
 
Method Summary
protected  void addDefaultApps(org.mortbay.jetty.handler.ContextHandlerCollection parent, String appDir)
           
static String getWebAppDir(String webappName)
          Get the path for this web app
protected  String getWebAppsPath()
          Get the pathname to the path files.
 
Methods inherited from class org.apache.hadoop.http.HttpServer
addContext, addContext, addDefaultServlets, addFilter, addFilterPathMapping, addGlobalFilter, addInternalServlet, addServlet, addSslListener, addSslListener, createBaseListener, defineFilter, getAttribute, getPort, join, 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)
           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

addDefaultApps

protected void addDefaultApps(org.mortbay.jetty.handler.ContextHandlerCollection parent,
                              String appDir)
                       throws IOException
Overrides:
addDefaultApps in class org.apache.hadoop.http.HttpServer
Throws:
IOException

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

getWebAppDir

public static String getWebAppDir(String webappName)
                           throws IOException
Get the path for this web app

Parameters:
webappName - web app
Returns:
path
Throws:
IOException - e


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