org.apache.hadoop.hbase.rest
Class GenericHandler

java.lang.Object
  extended by org.apache.hadoop.hbase.rest.GenericHandler
Direct Known Subclasses:
MetaHandler, ScannerHandler, TableHandler

public abstract class GenericHandler
extends Object

GenericHandler contains some basic common stuff that all the individual REST handler types take advantage of.


Nested Class Summary
protected static class GenericHandler.ContentType
           
 
Field Summary
protected static String ACCEPT
           
protected  HBaseAdmin admin
           
protected static String COLUMN
           
protected  HBaseConfiguration conf
           
protected static String CONTENT_TYPE
           
protected static String END_ROW
           
protected  org.apache.commons.logging.Log LOG
           
protected static String REGIONS
           
protected static String ROW
           
protected static String START_ROW
           
protected static String TIMESTAMP
           
 
Constructor Summary
GenericHandler(HBaseConfiguration conf, HBaseAdmin admin)
           
 
Method Summary
protected  void doElement(org.znerd.xmlenc.XMLOutputter outputter, String name, String value)
           
static void doMethodNotAllowed(javax.servlet.http.HttpServletResponse response, String message)
           
static void doNotAcceptable(javax.servlet.http.HttpServletResponse response)
           
static void doNotAcceptable(javax.servlet.http.HttpServletResponse response, String message)
           
static void doNotFound(javax.servlet.http.HttpServletResponse response)
           
static void doNotFound(javax.servlet.http.HttpServletResponse response, String msg)
           
protected  HTable getTable(String tableName)
           
protected  String getTableName(String[] pathSegments)
           
protected  org.znerd.xmlenc.XMLOutputter getXMLOutputter(PrintWriter o)
           
protected  void outputColumnsXml(org.znerd.xmlenc.XMLOutputter outputter, Map<byte[],Cell> m)
           
static void setResponseHeader(javax.servlet.http.HttpServletResponse response, int status, String contentType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conf

protected HBaseConfiguration conf

admin

protected HBaseAdmin admin

ACCEPT

protected static final String ACCEPT
See Also:
Constant Field Values

COLUMN

protected static final String COLUMN
See Also:
Constant Field Values

TIMESTAMP

protected static final String TIMESTAMP
See Also:
Constant Field Values

START_ROW

protected static final String START_ROW
See Also:
Constant Field Values

END_ROW

protected static final String END_ROW
See Also:
Constant Field Values

CONTENT_TYPE

protected static final String CONTENT_TYPE
See Also:
Constant Field Values

ROW

protected static final String ROW
See Also:
Constant Field Values

REGIONS

protected static final String REGIONS
See Also:
Constant Field Values

LOG

protected final org.apache.commons.logging.Log LOG
Constructor Detail

GenericHandler

public GenericHandler(HBaseConfiguration conf,
                      HBaseAdmin admin)
Method Detail

getXMLOutputter

protected org.znerd.xmlenc.XMLOutputter getXMLOutputter(PrintWriter o)
                                                 throws IllegalStateException,
                                                        IOException
Throws:
IllegalStateException
IOException

doElement

protected void doElement(org.znerd.xmlenc.XMLOutputter outputter,
                         String name,
                         String value)
                  throws IllegalStateException,
                         IOException
Throws:
IllegalStateException
IOException

setResponseHeader

public static void setResponseHeader(javax.servlet.http.HttpServletResponse response,
                                     int status,
                                     String contentType)

doNotAcceptable

public static void doNotAcceptable(javax.servlet.http.HttpServletResponse response)
                            throws IOException
Throws:
IOException

doNotAcceptable

public static void doNotAcceptable(javax.servlet.http.HttpServletResponse response,
                                   String message)
                            throws IOException
Throws:
IOException

doNotFound

public static void doNotFound(javax.servlet.http.HttpServletResponse response)
                       throws IOException
Throws:
IOException

doNotFound

public static void doNotFound(javax.servlet.http.HttpServletResponse response,
                              String msg)
                       throws IOException
Throws:
IOException

doMethodNotAllowed

public static void doMethodNotAllowed(javax.servlet.http.HttpServletResponse response,
                                      String message)
                               throws IOException
Throws:
IOException

getTableName

protected String getTableName(String[] pathSegments)
                       throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

outputColumnsXml

protected void outputColumnsXml(org.znerd.xmlenc.XMLOutputter outputter,
                                Map<byte[],Cell> m)
                         throws IllegalStateException,
                                IllegalArgumentException,
                                IOException
Throws:
IllegalStateException
IllegalArgumentException
IOException

getTable

protected HTable getTable(String tableName)
                   throws IOException
Throws:
IOException


Copyright © 2008 The Apache Software Foundation