You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ns...@apache.org on 2011/10/11 19:45:09 UTC

svn commit: r1181974 - in /hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase: client/HTableInterface.java rest/client/RemoteHTable.java

Author: nspiegelberg
Date: Tue Oct 11 17:45:09 2011
New Revision: 1181974

URL: http://svn.apache.org/viewvc?rev=1181974&view=rev
Log:
add the multi get into HTableInterface

Summary:
Add the multi get interface to HTableInterface, so client program does not need
to cast the HTabeInterface to HTable for multi-get.

Test Plan: run all the unit tests

Reviewers: kannan, pkhemani, srash, vinodv, cgthayer, mbautin

Reviewed By: cgthayer

CC: dist-storage@lists, pkhemani, cgthayer, liyintang

Differential Revision: 323946

Modified:
    hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java
    hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java

Modified: hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java?rev=1181974&r1=1181973&r2=1181974&view=diff
==============================================================================
--- hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java (original)
+++ hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java Tue Oct 11 17:45:09 2011
@@ -80,7 +80,23 @@ public interface HTableInterface {
    */
   Result get(Get get) throws IOException;
 
-  /**
+	/**
+   * Extracts certain cells from the given rows, in batch.
+   *
+   * @param gets The objects that specify what data to fetch and from which rows.
+   *
+   * @return The data coming from the specified rows, if it exists.  If the row
+   *         specified doesn't exist, the {@link Result} instance returned won't
+   *         contain any {@link KeyValue}, as indicated by {@link Result#isEmpty()}.
+   *         If there are any failures even after retries, there will be a null in
+   *         the results array for those Gets, AND an exception will be thrown.
+   * @throws IOException if a remote or network exception occurs.
+   *
+   * @since 0.20.0
+   */
+	public Result[] get(List<Get> gets) throws IOException;
+
+	/**
    * Return the row that matches <i>row</i> exactly,
    * or the one that immediately precedes it.
    *

Modified: hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java?rev=1181974&r1=1181973&r2=1181974&view=diff
==============================================================================
--- hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java (original)
+++ hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/rest/client/RemoteHTable.java Tue Oct 11 17:45:09 2011
@@ -254,6 +254,10 @@ public class RemoteHTable implements HTa
     client.shutdown();
   }
 
+	public Result[] get(List<Get> gets) throws IOException {
+    throw new IOException("multi get is not supported here");
+	}
+
   public Result get(Get get) throws IOException {
     TimeRange range = get.getTimeRange();
     String spec = buildRowSpec(get.getRow(), get.getFamilyMap(),