You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2008/06/11 00:53:41 UTC

svn commit: r666356 - /hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HTable.java

Author: stack
Date: Tue Jun 10 15:53:41 2008
New Revision: 666356

URL: http://svn.apache.org/viewvc?rev=666356&view=rev
Log:
HBASE-669 MultiRegion transactions with Optimistic Concurrency Control; Fix silly copy in get

Modified:
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HTable.java

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HTable.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HTable.java?rev=666356&r1=666355&r2=666356&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HTable.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HTable.java Tue Jun 10 15:53:41 2008
@@ -481,18 +481,16 @@
 
   /** 
    * Get the specified number of versions of the specified row and column
-   * 
-   * @param row         - row key
-   * @param column      - column name
-   * @param numVersions - number of versions to retrieve
-   * @return            - array byte values
+   * @param row row key
+   * @param column column name
+   * @param numVersions number of versions to retrieve
+   * @return Array of Cells.
    * @throws IOException
    */
   public Cell[] get(final byte [] row, final byte [] column,
     final int numVersions) 
   throws IOException {
-    Cell[] values = null;
-    values = connection.getRegionServerWithRetries(
+    return connection.getRegionServerWithRetries(
         new ServerCallable<Cell[]>(connection, tableName, row) {
           public Cell[] call() throws IOException {
             return server.get(location.getRegionInfo().getRegionName(), row, 
@@ -500,15 +498,6 @@
           }
         }
     );
-
-    if (values != null) {
-      ArrayList<Cell> cellValues = new ArrayList<Cell>();
-      for (int i = 0 ; i < values.length; i++) {
-        cellValues.add(values[i]);
-      }
-      return cellValues.toArray(new Cell[values.length]);
-    }
-    return null;
   }
 
   /**