hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r670701 - in /hadoop/hbase/trunk: CHANGES.txt bin/hirb.rb src/java/org/apache/hadoop/hbase/client/HTable.java
Date Mon, 23 Jun 2008 18:19:54 GMT
Author: stack
Date: Mon Jun 23 11:19:54 2008
New Revision: 670701

URL: http://svn.apache.org/viewvc?rev=670701&view=rev
Log:
HBASE-702 deleteall doesn't

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/bin/hirb.rb
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HTable.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=670701&r1=670700&r2=670701&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Mon Jun 23 11:19:54 2008
@@ -65,6 +65,7 @@
    HBASE-613   Timestamp-anchored scanning fails to find all records
    HBASE-681   NPE in Memcache
    HBASE-701   Showing bytes in log when should be String
+   HBASE-702   deleteall doesn't
    
    
   IMPROVEMENTS

Modified: hadoop/hbase/trunk/bin/hirb.rb
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/bin/hirb.rb?rev=670701&r1=670700&r2=670701&view=diff
==============================================================================
--- hadoop/hbase/trunk/bin/hirb.rb (original)
+++ hadoop/hbase/trunk/bin/hirb.rb Mon Jun 23 11:19:54 2008
@@ -263,7 +263,7 @@
 
 def deleteall(table, row, column = nil,
     timestamp = org.apache.hadoop.hbase.HConstants::LATEST_TIMESTAMP)
-  table(table).get(row, column, timestamp)
+  table(table).deleteall(row, column, timestamp)
 end
 
 def deletefc(table, row, column_family,

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=670701&r1=670700&r2=670701&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 Mon Jun 23 11:19:54
2008
@@ -1088,6 +1088,30 @@
     deleteAll(row, null, ts);
   }
 
+  /**
+   * Completely delete the row's cells.
+   *
+   * @param row Key of the row you want to completely delete.
+   * @param ts Delete all cells of the same timestamp or older.
+   * @throws IOException
+   */
+  public void deleteAll(final String row, final long ts)
+  throws IOException {
+    deleteAll(row, null, ts);
+  }
+
+  /**
+   * Completely delete the row's cells.
+   *
+   * @param row Key of the row you want to completely delete.
+   * @param ts Delete all cells of the same timestamp or older.
+   * @throws IOException
+   */
+  public void deleteAll(final Text row, final long ts)
+  throws IOException {
+    deleteAll(row, null, ts);
+  }
+
   /** 
    * Delete all cells that match the passed row and column.
    * @param row Row to update
@@ -1132,7 +1156,8 @@
    */
   public void deleteAll(final String row, final String column, final long ts)
   throws IOException {
-    deleteAll(Bytes.toBytes(row), Bytes.toBytes(column), ts);
+    deleteAll(Bytes.toBytes(row),
+      column != null? Bytes.toBytes(column): null, ts);
   }
 
   /** 
@@ -1148,8 +1173,13 @@
     connection.getRegionServerWithRetries(
         new ServerCallable<Boolean>(connection, tableName, row) {
           public Boolean call() throws IOException {
-            server.deleteAll(location.getRegionInfo().getRegionName(), row, 
-                column, ts);
+            if (column != null) {
+              this.server.deleteAll(location.getRegionInfo().getRegionName(),
+                row, column, ts);
+            } else {
+              this.server.deleteAll(location.getRegionInfo().getRegionName(),
+                  row, ts);
+            }
             return null;
           }
         }



Mime
View raw message