org.apache.hadoop.hbase.stargate
Class RESTServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.sun.jersey.spi.container.servlet.ServletContainer
              extended by com.sun.jersey.server.impl.container.servlet.ServletAdaptor
                  extended by org.apache.hadoop.hbase.stargate.RESTServlet
All Implemented Interfaces:
Serializable, javax.servlet.Filter, javax.servlet.Servlet, javax.servlet.ServletConfig

public class RESTServlet
extends com.sun.jersey.server.impl.container.servlet.ServletAdaptor

Singleton class encapsulating global REST servlet state and functions.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.jersey.spi.container.servlet.ServletContainer
com.sun.jersey.spi.container.servlet.ServletContainer.ContextInjectableProvider<T>
 
Field Summary
static int DEFAULT_MAX_AGE
           
protected  Map<String,Integer> maxAgeMap
           
static String VERSION_STRING
           
 
Fields inherited from class com.sun.jersey.spi.container.servlet.ServletContainer
APPLICATION_CONFIG_CLASS, JSP_TEMPLATES_BASE_PATH, PROPERTY_WEB_PAGE_CONTENT_REGEX, RESOURCE_CONFIG_CLASS
 
Constructor Summary
RESTServlet()
          Constructor
 
Method Summary
protected  HBaseConfiguration getConfiguration()
           
static RESTServlet getInstance()
           
 int getMaxAge(String tableName)
           
protected  HTablePool getTablePool()
          Get a table pool for the given table.
 void invalidateMaxAge(String tableName)
          Signal that a previously calculated maximum cache age has been invalidated by a schema change.
 
Methods inherited from class com.sun.jersey.server.impl.container.servlet.ServletAdaptor
configure
 
Methods inherited from class com.sun.jersey.spi.container.servlet.ServletContainer
configure, configure, create, destroy, doFilter, doFilter, getDefaultResourceConfig, getDefaultResourceConfig, getServletContext, getStaticContentPattern, getWebConfig, init, init, init, initiate, load, reload, service, service
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_AGE

public static final int DEFAULT_MAX_AGE
See Also:
Constant Field Values

VERSION_STRING

public static final String VERSION_STRING
See Also:
Constant Field Values

maxAgeMap

protected Map<String,Integer> maxAgeMap
Constructor Detail

RESTServlet

public RESTServlet()
            throws IOException
Constructor

Throws:
IOException
Method Detail

getInstance

public static RESTServlet getInstance()
                               throws IOException
Returns:
the RESTServlet singleton instance
Throws:
IOException

getTablePool

protected HTablePool getTablePool()
Get a table pool for the given table.

Returns:
the table pool

getConfiguration

protected HBaseConfiguration getConfiguration()
Returns:
the servlet's global HBase configuration

getMaxAge

public int getMaxAge(String tableName)
              throws IOException
Parameters:
tableName - the table name
Returns:
the maximum cache age suitable for use with this table, in seconds
Throws:
IOException

invalidateMaxAge

public void invalidateMaxAge(String tableName)
Signal that a previously calculated maximum cache age has been invalidated by a schema change.

Parameters:
tableName - the table name


Copyright © 2009 The Apache Software Foundation