org.apache.hadoop.mapred
Class StatusHttpServer
java.lang.Object
  
org.apache.hadoop.mapred.StatusHttpServer
public class StatusHttpServer
- extends Object
 
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:
   "/logs/" -> points to the log directory
   "/static/" -> points to common static files (src/webapps/static)
   "/" -> the jsp server code from (src/webapps/)
 
 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
StatusHttpServer
public StatusHttpServer(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/webapps/.
- Parameters:
 name - The name of the serverport - The port to use on the serverfindPort - whether the server should start at the given port and 
        increment by 1 until it finds a free port.
- Throws:
 IOException
 
setAttribute
public void setAttribute(String name,
                         Object value)
- Set a value in the webapp context. These values are available to the jsp
 pages as "application.getAttribute(name)".
- Parameters:
 name - The name of the attributevalue - The value of the attribute
 
 
addServlet
public <T extends javax.servlet.http.HttpServlet> void addServlet(String name,
                                                                  String pathSpec,
                                                                  Class<T> servletClass)
- Add a servlet in the server.
- Parameters:
 name - The name of the servlet (can be passed as null)pathSpec - The path spec for the servletservletClass - The servlet class
 
 
getAttribute
public Object getAttribute(String name)
- Get the value in the webapp context.
- Parameters:
 name - The name of the attribute
- Returns:
 - The value of the attribute
 
 
 
getPort
public int getPort()
- Get the port that the server is on
- Returns:
 - the port
 
 
 
setThreads
public void setThreads(int min,
                       int max)
 
addSslListener
public void addSslListener(InetSocketAddress addr,
                           String keystore,
                           String storPass,
                           String keyPass)
                    throws IOException
- Configure an ssl listener on the server.
- Parameters:
 addr - address to listen onkeystore - location of the keystorestorPass - password for the keystorekeyPass - password for the key
- Throws:
 IOException
 
 
start
public void start()
           throws IOException
- Start the server. Does not wait for the server to start.
- Throws:
 IOException
 
 
stop
public void stop()
          throws InterruptedException
- stop the server
- Throws:
 InterruptedException
 
 
Copyright © 2008 The Apache Software Foundation