hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r724238 [3/3] - in /hadoop/hbase/branches/0.19_on_hadoop_0.18: ./ conf/ src/java/org/apache/hadoop/hbase/ src/java/org/apache/hadoop/hbase/client/ src/java/org/apache/hadoop/hbase/io/ src/java/org/apache/hadoop/hbase/ipc/ src/java/org/apach...
Date Mon, 08 Dec 2008 03:20:44 GMT
Added: hadoop/hbase/branches/0.19_on_hadoop_0.18/src/java/org/apache/hadoop/hbase/rest/package.html
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.19_on_hadoop_0.18/src/java/org/apache/hadoop/hbase/rest/package.html?rev=724238&view=auto
==============================================================================
--- hadoop/hbase/branches/0.19_on_hadoop_0.18/src/java/org/apache/hadoop/hbase/rest/package.html
(added)
+++ hadoop/hbase/branches/0.19_on_hadoop_0.18/src/java/org/apache/hadoop/hbase/rest/package.html
Sun Dec  7 19:20:43 2008
@@ -0,0 +1,112 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<head/>
+
+<body bgcolor="white">
+Provides an HBase
+<a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">
+REST</a> service.
+
+This directory contains a REST service implementation for an Hbase RPC
+service.
+
+<h2><a name="description">Description</a></h2>
+<p>
+By default, an instance of the REST servlet runs in the master UI; just browse
+to [WWW] http://MASTER_HOST:MASTER_PORT/api/ (Results are returned as xml by
+default so you may have to look at source to see results).
+
+If you intend to use the hbase REST API heavily, to run an instance of the RES
+T server outside of the master, do the following:
+  <pre>
+cd $HBASE_HOME
+bin/hbase rest start
+  </pre>
+The default port is 60050.
+</p>
+
+<h2><a name="uri">URI</a></h2>
+<h3><a name="uri#meta">System Operation</a></h3>
+<ul>
+  <li>GET / : Retrieve a list of all the tables in HBase.</li>
+</ul>
+
+<h3><a name="uri#table">Table Operation</a></h3>
+<ul>
+  <li>POST / : Create a table</li>
+
+  <li>GET /[table_name] : Retrieve metadata about the table</li>
+
+  <li>PUT /[table_name] : Update the table schema</li>
+
+  <li>DELETE /[table_name] : Delete the table</li>
+
+  <li>POST /[table_name]/disable : Disable the table</li>
+
+  <li>POST /[table_name]/enable : Enable the table</li>
+
+  <li>GET /[table_name]/regions : Retrieve a list of the regions for this table
+  so that you can efficiently split up the work</li>
+</ul>
+
+<h3><a name="uri#row">Row Operation</a></h3>
+<ul>
+  <li>GET /[table_name]/row/[row_key]/timestamps : Retrieve a list of all the
+  timestamps available for this row key (Not supported by native hbase yet)</li>
+
+  <li>GET /[table_name]/row/[row_key] : Retrieve data from a
+  row. If column not specified, return all columns</li>
+
+  <li>GET /[table_name]/row/[row_key]/[timestamp] : Retrieve
+  data from a row, constrained by the timestamp value. If column not specified,
+  return all columns</li>
+
+  <li>POST/PUT /[table_name]/row/[row_key] : Set the value of one or more
+  columns for a given row key</li>
+
+  <li>POST/PUT /[table_name]/row/[row_key]/[timestamp] : Set the value of one
+  or more columns for a given row key with an optional timestamp</li>
+
+  <li>DELETE /[table_name]/row/[row_key]/ : Delete the specified columns from
+  the row. If there are no columns specified, then it will delete ALL columns</li>
+
+  <li>DELETE /[table_name]/row/[row_key]/[timestamp] : Delete the specified
+  columns from the row constrained by the timestamp. If there are no columns
+  specified, then it will delete ALL columns.  Not supported yet.</li>
+</ul>
+
+<h3><a name="uri#scanner">Scanner Operation</a></h3>
+<ul>
+  <li>POST/PUT /[table_name]/scanner : Request that a scanner be created with
+  the specified options. Returns a scanner ID that can be used to iterate over
+  the results of the scanner</li>
+
+  <li>POST /[table_name]/scanner/[scanner_id] : Return the current item in the
+  scanner and advance to the next one. Think of it as a queue dequeue operation</li>
+
+  <li>DELETE /[table_name]/scanner/[scanner_id] : Close a scanner</li>
+</ul>
+<p>
+For examples and more details,  please visit
+<a href="http://wiki.apache.org/hadoop/Hbase/HbaseRest">HBaseRest Wiki</a> page.
+</p>
+</body>
+</html>

Modified: hadoop/hbase/branches/0.19_on_hadoop_0.18/src/java/org/apache/hadoop/hbase/util/Sleeper.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.19_on_hadoop_0.18/src/java/org/apache/hadoop/hbase/util/Sleeper.java?rev=724238&r1=724237&r2=724238&view=diff
==============================================================================
--- hadoop/hbase/branches/0.19_on_hadoop_0.18/src/java/org/apache/hadoop/hbase/util/Sleeper.java
(original)
+++ hadoop/hbase/branches/0.19_on_hadoop_0.18/src/java/org/apache/hadoop/hbase/util/Sleeper.java
Sun Dec  7 19:20:43 2008
@@ -66,11 +66,14 @@
       LOG.warn("Calculated wait time > " + this.period +
         "; setting to this.period: " + System.currentTimeMillis() + ", " +
         startTime);
+      waitTime = this.period;
     }
-    if (waitTime > 0) {
+    while (waitTime > 0) {
+      long woke = -1;
       try {
         Thread.sleep(waitTime);
-        long slept = System.currentTimeMillis() - now;
+        woke = System.currentTimeMillis();
+        long slept = woke - now;
         if (slept > (10 * this.period)) {
           LOG.warn("We slept " + slept + "ms, ten times longer than scheduled: " +
             this.period);
@@ -82,6 +85,9 @@
           return;
         }
       }
+      // Recalculate waitTime.
+      woke = (woke == -1)? System.currentTimeMillis(): woke;
+      waitTime = this.period - (woke - startTime);
     }
   }
 }

Modified: hadoop/hbase/branches/0.19_on_hadoop_0.18/src/java/org/onelab/filter/Filter.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.19_on_hadoop_0.18/src/java/org/onelab/filter/Filter.java?rev=724238&r1=724237&r2=724238&view=diff
==============================================================================
--- hadoop/hbase/branches/0.19_on_hadoop_0.18/src/java/org/onelab/filter/Filter.java (original)
+++ hadoop/hbase/branches/0.19_on_hadoop_0.18/src/java/org/onelab/filter/Filter.java Sun Dec
 7 19:20:43 2008
@@ -98,7 +98,7 @@
    * @param nbHash The number of hash functions to consider.
    * @param hashType type of the hashing function (see {@link Hash}).
    */
-  protected Filter(int vectorSize, int nbHash, int hashType){
+  protected Filter(int vectorSize, int nbHash, int hashType) {
     this.vectorSize = vectorSize;
     this.nbHash = nbHash;
     this.hashType = hashType;



Mime
View raw message