HBASE-702 deleteall doesn't

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@670701 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2008-06-23 18:19:54 +00:00
parent 3af4f2f2f5
commit d09a697620
3 changed files with 35 additions and 4 deletions

View File

@ -65,6 +65,7 @@ Hbase Change Log
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

View File

@ -263,7 +263,7 @@ end
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,

View File

@ -1088,6 +1088,30 @@ public class HTable {
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 class HTable {
*/
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 @@ public class HTable {
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;
}
}