Dear Wiki user, You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification.
The "Hbase/Stargate" page has been changed by AndrewPurtell. http://wiki.apache.org/hadoop/Hbase/Stargate?action=diff&rev1=4&rev2=5 -------------------------------------------------- <<Anchor(2)>> == Deployment == - === Daemon === - Stargate can run as a daemon which starts an embedded Jetty servlet container and deploys the servlet into it. - 1. Place the Stargate jar in either the HBase installation root directory or lib/ directories. - - 1. Copy the jars from contrib/stargate/lib/ into the lib/ directory of the HBase installation. - - 1. Start the embedded Jetty servlet container: + Start the embedded Jetty servlet container: - In the foreground:<<BR>><<BR>> + In the foreground: - {{{ % ./bin/hbase org.apache.hadoop.hbase.stargate.Main -p <port> }}}<<BR>><<BR>> + {{{ % ./bin/hbase org.apache.hadoop.hbase.rest.Main -p <port> }}}<<BR>><<BR>> - where <port> is optional, and is the port the connector should listen on. (Default is 8080.)<<BR>><<BR>> + where <port> is optional, and is the port the connector should listen on. (Default is 8080.)<<BR>> - In the background: <<BR>><<BR>> + + In the background: - {{{ % ./bin/hbase-daemon.sh start org.apache.hadoop.hbase.stargate.Main -p <port>}}} <<BR>><<BR>> + {{{ % ./bin/hbase-daemon.sh start org.apache.hadoop.hbase.rest.Main -p <port>}}} <<BR>><<BR>> where <port> is optional, and is the port the connector should listen on. (Default is 8080.) - - === Servlet === - - Stargate is also packaged as a Java web application (WAR) which can be deployed into any servlet API compliant container, such as Tomcat, Jetty, Glassfish, etc. - - 1. Copy the HBase jar from the HBase installation root directory and all jars from the HBase lib/ and contrib/stargate/lib/ directories to somewhere on the servlet container's classpath, into a shared deployment lib directory for example. - - 1. Drop the Stargate WAR where container expects it. - - 1. Configure the servlet. An example for Jetty follows: - - '''web.xml''' - {{{ - <!DOCTYPE web-app PUBLIC - "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" - "http://java.sun.com/dtd/web-app_2_3.dtd"> - - <web-app> - <display-name> - HBase Stargate - </display-name> - - <servlet> - <servlet-name>api</servlet-name> - <servlet-class>org.apache.hadoop.hbase.stargate.RESTServlet</servlet-class> - <load-on-startup>1</load-on-startup> - - <init-param> - <param-name>com.sun.jersey.config.property.packages</param-name> - <param-value>org.apache.hadoop.hbase.stargate</param-value> - </init-param> - <init-param> - <param-name>com.sun.jersey.config.property.resourceConfigClass</param-name> - <param-value>com.sun.jersey.api.core.PackagesResourceConfig</param-value> - </init-param> - </servlet> - - <servlet-mapping> - <servlet-name>api</servlet-name> - <url-pattern>/*</url-pattern> - </servlet-mapping> - </web-app> - }}} - - - '''jetty.xml''' - {{{ - <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" - "http://jetty.mortbay.org/configure.dtd"> - - <Configure id="Server" class="org.mortbay.jetty.Server"> - <Call name="addConnector"> - <Arg> - <New class="org.mortbay.jetty.nio.SelectChannelConnector"> - <Set name="port"> - 8080 - </Set> - </New> - </Arg> - </Call> - - <Set name="handler"> - <New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection"> - <Array type="org.mortbay.jetty.Handler"> - <Set name="handlers"> - <Item> - <New id="Contexts" class="org.mortbay.jetty.handler.ContextHandlerCollection"/> - </Item> - </Set> - </Array> - </New> - </Set> - - <Call name="addLifeCycle"> - <Arg> - <New class="org.mortbay.jetty.deployer.WebAppDeployer"> - <Set name="contexts"> - <Ref id="Contexts"/> - </Set> - <Set name="webAppDir"> - <SystemProperty name="jetty.home" default="."/>/webapps - </Set> - </New> - </Arg> - </Call> - </Configure> - }}} <<Anchor(3)>> == Representational State Transfer == @@ -147, +55 @@ RFC 3968 defines URL syntax: - {{{ - scheme://user:[email protected]:8080/path/to/file;type=foo?name=val#frag + {{{scheme://user:[email protected]:8080/path/to/file;type=foo?name=val#frag }}}<<BR>> - \_____/ \_______/\___________/\__/\______/\____/\______/\________/\___/ + {{{\_____/ \_______/\___________/\__/\______/\____/\______/\________/\___/ }}}<<BR>> - | | | | | | | | | + {{{ | | | | | | | | | }}}<<BR>> - scheme userinfo hostname port path filename param query fragment + {{{ scheme userinfo hostname port path filename param query fragment }}}<<BR>> - \________________________/ + {{{ \________________________/ }}}<<BR>> - authority + {{{ authority }}}<<BR>> - }}} Stargate exposes HBase tables, rows, cells, and metadata as URL specified resources. === Addressing for cell or row query (GET) === + {{{path := '/' <table> }}}<<BR>> + {{{ '/' <row> }}}<<BR>> - {{{ - path := '/' <table> - '/' <row> - ( '/' ( <column> ( ':' <qualifier> )? + {{{ ( '/' ( <column> ( ':' <qualifier> )? }}}<<BR>> - ( ',' <column> ( ':' <qualifier> )? )+ )? + {{{ ( ',' <column> ( ':' <qualifier> )? )+ )? }}}<<BR>> - ( '/' ( <start-timestamp> ',' )? <end-timestamp> )? )? + {{{ ( '/' ( <start-timestamp> ',' )? <end-timestamp> )? )? }}}<<BR>> - query := ( '?' 'v' '=' <num-versions> )? }}} + {{{query := ( '?' 'v' '=' <num-versions> )? }}}<<BR>> === Addressing for single value store (PUT) === Address with table, row, column (and optional qualifier), and optional timestamp. - {{{ - path := '/' <table> '/' <row> '/' <column> ( ':' <qualifier> )? + {{{path := '/' <table> '/' <row> '/' <column> ( ':' <qualifier> )? }}}<<BR>> - ( '/' <timestamp> )? }}} + {{{ ( '/' <timestamp> )? }}}<<BR>> === Addressing for multiple (batched) value store (PUT) === - {{{ - path := '/' <table> '/' <false-row-key> }}} + {{{path := '/' <table> '/' <false-row-key> }}} === Addressing for row, column, or cell DELETE === - {{{ - path := '/' <table> + {{{path := '/' <table> }}}<<BR>> - '/' <row> + {{{ '/' <row> }}}<<BR>> - ( '/' <column> ( ':' <qualifier> )? + {{{ ( '/' <column> ( ':' <qualifier> )? }}}<<BR>> - ( '/' <timestamp> )? )? }}} + {{{ ( '/' <timestamp> )? )? }}}<<BR>> === Addressing for table creation or schema update (PUT or POST), schema query (GET), or delete (DELETE) === - {{{ - path := '/' <table> / 'schema' }}} + {{{path := '/' <table> / 'schema' }}} === Addressing for scanner creation (POST) === - {{{ - path := '/' <table> '/' 'scanner' }}} + {{{path := '/' <table> '/' 'scanner' }}} === Addressing for scanner next item (GET) === - {{{ - path := '/' <table> '/' 'scanner' '/' <scanner-id> }}} + {{{path := '/' <table> '/' 'scanner' '/' <scanner-id> }}} === Addressing for scanner deletion (DELETE) === - {{{ - path := '/' <table> '/' '%scanner' '/' <scanner-id> }}} + {{{path := '/' <table> '/' '%scanner' '/' <scanner-id> }}} <<Anchor(5)>>
