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 2011/05/25 22:44:11 UTC

svn commit: r1127678 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/client/HTable.java src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java

Author: stack
Date: Wed May 25 20:44:11 2011
New Revision: 1127678

URL: http://svn.apache.org/viewvc?rev=1127678&view=rev
Log:
HBASE-3841 HTable and HTableInterface docs are inconsistent with one another

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTable.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1127678&r1=1127677&r2=1127678&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Wed May 25 20:44:11 2011
@@ -229,6 +229,8 @@ Release 0.91.0 - Unreleased
    HBASE-2938  HBASE-2938 Add Thread-Local Behavior To HTable Pool
                (Karthick Sankarachary)
    HBASE-3811  Allow adding attributes to Scan (Alex Baranau)
+   HBASE-3841  HTable and HTableInterface docs are inconsistent with
+               one another (Harsh J Chouraria)
 
   TASKS
    HBASE-3559  Move report of split to master OFF the heartbeat channel

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTable.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTable.java?rev=1127678&r1=1127677&r2=1127678&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTable.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTable.java Wed May 25 20:44:11 2011
@@ -209,6 +209,10 @@ public class HTable implements HTableInt
     this.closed = false;
   }
 
+  /**
+   * {@inheritDoc}
+   */
+  @Override
   public Configuration getConfiguration() {
     return configuration;
   }
@@ -290,6 +294,9 @@ public class HTable implements HTableInt
     return connection.getRegionLocation(tableName, row, false);
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public byte [] getTableName() {
     return this.tableName;
@@ -329,6 +336,9 @@ public class HTable implements HTableInt
     this.scannerCaching = scannerCaching;
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public HTableDescriptor getTableDescriptor() throws IOException {
     return new UnmodifyableHTableDescriptor(
@@ -532,6 +542,9 @@ public class HTable implements HTableInt
     return allRegions;
   }
 
+  /**
+   * {@inheritDoc}
+   */
    @Override
    public Result getRowOrBefore(final byte[] row, final byte[] family)
    throws IOException {
@@ -544,6 +557,9 @@ public class HTable implements HTableInt
      });
    }
 
+   /**
+    * {@inheritDoc}
+    */
   @Override
   public ResultScanner getScanner(final Scan scan) throws IOException {
     ClientScanner s = new ClientScanner(scan);
@@ -551,6 +567,9 @@ public class HTable implements HTableInt
     return s;
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public ResultScanner getScanner(byte [] family) throws IOException {
     Scan scan = new Scan();
@@ -558,6 +577,9 @@ public class HTable implements HTableInt
     return getScanner(scan);
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public ResultScanner getScanner(byte [] family, byte [] qualifier)
   throws IOException {
@@ -566,6 +588,10 @@ public class HTable implements HTableInt
     return getScanner(scan);
   }
 
+  /**
+   * {@inheritDoc}
+   */
+  @Override
   public Result get(final Get get) throws IOException {
     return connection.getRegionServerWithRetries(
         new ServerCallable<Result>(connection, tableName, get.getRow()) {
@@ -576,36 +602,30 @@ public class HTable implements HTableInt
     );
   }
 
-   public Result[] get(List<Get> gets) throws IOException {
-     try {
-       Object [] r1 = batch((List)gets);
-
-       // translate.
-       Result [] results = new Result[r1.length];
-       int i=0;
-       for (Object o : r1) {
-         // batch ensures if there is a failure we get an exception instead
-         results[i++] = (Result) o;
-       }
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public Result[] get(List<Get> gets) throws IOException {
+    try {
+      Object [] r1 = batch((List)gets);
 
-       return results;
-     } catch (InterruptedException e) {
-       throw new IOException(e);
-     }
-   }
+      // translate.
+      Result [] results = new Result[r1.length];
+      int i=0;
+      for (Object o : r1) {
+        // batch ensures if there is a failure we get an exception instead
+        results[i++] = (Result) o;
+      }
+
+      return results;
+    } catch (InterruptedException e) {
+      throw new IOException(e);
+    }
+  }
 
   /**
-   * Method that does a batch call on Deletes, Gets and Puts.  The ordering of
-   * execution of the actions is not defined. Meaning if you do a Put and a
-   * Get in the same {@link #batch} call, you will not necessarily be
-   * guaranteed that the Get returns what the Put had put.
-   *
-   * @param actions list of Get, Put, Delete objects
-   * @param results Empty Result[], same size as actions. Provides access to
-   * partial results, in case an exception is thrown. If there are any failures,
-   * there will be a null or Throwable will be in the results array, AND an
-   * exception will be thrown.
-   * @throws IOException
+   * {@inheritDoc}
    */
   @Override
   public synchronized void batch(final List<Row> actions, final Object[] results)
@@ -614,12 +634,7 @@ public class HTable implements HTableInt
   }
 
   /**
-   * Method that does a batch call on Deletes, Gets and Puts.
-   *
-   * @param actions list of Get, Put, Delete objects
-   * @return the results from the actions. A null in the return array means that
-   * the call for that action failed, even after retries
-   * @throws IOException
+   * {@inheritDoc}
    */
   @Override
   public synchronized Object[] batch(final List<Row> actions) throws InterruptedException, IOException {
@@ -629,11 +644,7 @@ public class HTable implements HTableInt
   }
 
   /**
-   * Deletes the specified cells/row.
-   *
-   * @param delete The object that specifies what to delete.
-   * @throws IOException if a remote or network exception occurs.
-   * @since 0.20.0
+   * {@inheritDoc}
    */
   @Override
   public void delete(final Delete delete)
@@ -649,14 +660,7 @@ public class HTable implements HTableInt
   }
 
   /**
-   * Deletes the specified cells/rows in bulk.
-   * @param deletes List of things to delete. As a side effect, it will be modified:
-   * successful {@link Delete}s are removed. The ordering of the list will not change.
-   * @throws IOException if a remote or network exception occurs. In that case
-   * the {@code deletes} argument will contain the {@link Delete} instances
-   * that have not be successfully applied.
-   * @since 0.20.1
-   * @see #batch(java.util.List, Object[])
+   * {@inheritDoc}
    */
   @Override
   public void delete(final List<Delete> deletes)
@@ -679,11 +683,17 @@ public class HTable implements HTableInt
     }
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public void put(final Put put) throws IOException {
     doPut(Arrays.asList(put));
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public void put(final List<Put> puts) throws IOException {
     doPut(puts);
@@ -700,6 +710,9 @@ public class HTable implements HTableInt
     }
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public Result increment(final Increment increment) throws IOException {
     if (!increment.hasFamilies()) {
@@ -716,6 +729,9 @@ public class HTable implements HTableInt
     );
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public long incrementColumnValue(final byte [] row, final byte [] family,
       final byte [] qualifier, final long amount)
@@ -723,6 +739,9 @@ public class HTable implements HTableInt
     return incrementColumnValue(row, family, qualifier, amount, true);
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public long incrementColumnValue(final byte [] row, final byte [] family,
       final byte [] qualifier, final long amount, final boolean writeToWAL)
@@ -749,17 +768,7 @@ public class HTable implements HTableInt
   }
 
   /**
-   * Atomically checks if a row/family/qualifier value match the expectedValue.
-   * If it does, it adds the put.  If value == null, checks for non-existence
-   * of the value.
-   *
-   * @param row to check
-   * @param family column family
-   * @param qualifier column qualifier
-   * @param value the expected value
-   * @param put put to execute if value matches.
-   * @throws IOException
-   * @return true if the new put was execute, false otherwise
+   * {@inheritDoc}
    */
   @Override
   public boolean checkAndPut(final byte [] row,
@@ -776,18 +785,9 @@ public class HTable implements HTableInt
     );
   }
 
+
   /**
-   * Atomically checks if a row/family/qualifier value match the expectedValue.
-   * If it does, it adds the delete.  If value == null, checks for non-existence
-   * of the value.
-   *
-   * @param row to check
-   * @param family column family
-   * @param qualifier column qualifier
-   * @param value the expected value
-   * @param delete delete to execute if value matches.
-   * @throws IOException
-   * @return true if the new delete was executed, false otherwise
+   * {@inheritDoc}
    */
   @Override
   public boolean checkAndDelete(final byte [] row,
@@ -807,15 +807,7 @@ public class HTable implements HTableInt
   }
 
   /**
-   * Test for the existence of columns in the table, as specified in the Get.<p>
-   *
-   * This will return true if the Get matches one or more keys, false if not.<p>
-   *
-   * This is a server-side call so it prevents any data from being transfered
-   * to the client.
-   * @param get param to check for
-   * @return true if the specified Get matches one or more keys, false if not
-   * @throws IOException
+   * {@inheritDoc}
    */
   @Override
   public boolean exists(final Get get) throws IOException {
@@ -830,12 +822,7 @@ public class HTable implements HTableInt
   }
 
   /**
-   * Executes all the buffered {@link Put} operations.
-   * <p>
-   * This method gets called once automatically for every {@link Put} or batch
-   * of {@link Put}s (when {@link #batch(List)} is used) when
-   * {@link #isAutoFlush()} is {@code true}.
-   * @throws IOException if a remote or network exception occurs.
+   * {@inheritDoc}
    */
   @Override
   public void flushCommits() throws IOException {
@@ -850,6 +837,9 @@ public class HTable implements HTableInt
     }
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public void close() throws IOException {
     if (this.closed) {
@@ -879,6 +869,9 @@ public class HTable implements HTableInt
     }
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public RowLock lockRow(final byte [] row)
   throws IOException {
@@ -893,6 +886,9 @@ public class HTable implements HTableInt
     );
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public void unlockRow(final RowLock rl)
   throws IOException {
@@ -907,6 +903,9 @@ public class HTable implements HTableInt
     );
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public boolean isAutoFlush() {
     return autoFlush;
@@ -1397,6 +1396,9 @@ public class HTable implements HTableInt
     this.connection.clearRegionCache();
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public <T extends CoprocessorProtocol> T coprocessorProxy(
       Class<T> protocol, byte[] row) {
@@ -1409,6 +1411,9 @@ public class HTable implements HTableInt
             row));
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public <T extends CoprocessorProtocol, R> Map<byte[],R> coprocessorExec(
       Class<T> protocol, byte[] startKey, byte[] endKey,
@@ -1426,6 +1431,9 @@ public class HTable implements HTableInt
     return results;
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public <T extends CoprocessorProtocol, R> void coprocessorExec(
       Class<T> protocol, byte[] startKey, byte[] endKey,

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java?rev=1127678&r1=1127677&r2=1127678&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java Wed May 25 20:44:11 2011
@@ -75,7 +75,10 @@ public interface HTableInterface {
   boolean exists(Get get) throws IOException;
 
   /**
-   * Method that does a batch call on Deletes, Gets and Puts.
+   * Method that does a batch call on Deletes, Gets and Puts. The ordering of
+   * execution of the actions is not defined. Meaning if you do a Put and a
+   * Get in the same {@link #batch} call, you will not necessarily be
+   * guaranteed that the Get returns what the Put had put.
    *
    * @param actions list of Get, Put, Delete objects
    * @param results Empty Object[], same size as actions. Provides access to partial
@@ -87,8 +90,8 @@ public interface HTableInterface {
   void batch(final List<Row> actions, final Object[] results) throws IOException, InterruptedException;
 
   /**
-   * Method that does a batch call on Deletes, Gets and Puts.
-   *
+   * Same as {@link #batch(List, Object[])}, but returns an array of
+   * results instead of using a results parameter reference.
    *
    * @param actions list of Get, Put, Delete objects
    * @return the results from the actions. A null in the return array means that