HBASE-1633 Can't delete in TRUNK shell; makes it hard doing admin repairs

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@792793 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2009-07-10 03:25:20 +00:00
parent 2ec772096e
commit 732abb77c8
4 changed files with 17 additions and 14 deletions

View File

@ -250,6 +250,7 @@ Release 0.20.0 - Unreleased
HBASE-1625 Adding check to Put.add(KeyValue kv), to see that it has the same
row as when instantiated (Erik Holstad via Stack)
HBASE-1629 HRS unable to contact master
HBASE-1633 Can't delete in TRUNK shell; makes it hard doing admin repairs
IMPROVEMENTS
HBASE-1089 Add count of regions on filesystem to master UI; add percentage

View File

@ -13,6 +13,7 @@ include_class('java.lang.Boolean') {|package,name| "J#{name}" }
import org.apache.hadoop.hbase.client.HBaseAdmin
import org.apache.hadoop.hbase.client.HTable
import org.apache.hadoop.hbase.client.Delete
import org.apache.hadoop.hbase.HConstants
import org.apache.hadoop.hbase.io.BatchUpdate
import org.apache.hadoop.hbase.io.RowResult
@ -344,16 +345,17 @@ module HBase
# Delete a cell
def delete(row, column, timestamp = HConstants::LATEST_TIMESTAMP)
now = Time.now
bu = BatchUpdate.new(row, timestamp)
bu.delete(column)
@table.commit(bu)
d = Delete.new(row.to_java_bytes, timestamp, nil)
d.deleteColumn(Bytes.toBytes(column))
@table.delete(d)
@formatter.header()
@formatter.footer(now)
end
def deleteall(row, column = nil, timestamp = HConstants::LATEST_TIMESTAMP)
now = Time.now
@table.deleteAll(row, column, timestamp)
d = Delete.new(row.to_java_bytes, timestamp, nil)
@table.delete(d)
@formatter.header()
@formatter.footer(now)
end

View File

@ -348,20 +348,21 @@ public class HConnectionManager implements HConstants {
getMaster();
final TreeSet<HTableDescriptor> uniqueTables =
new TreeSet<HTableDescriptor>();
MetaScannerVisitor visitor = new MetaScannerVisitor() {
public boolean processRow(Result result) throws IOException {
HRegionInfo info = Writables.getHRegionInfo(
try {
HRegionInfo info = Writables.getHRegionInfo(
result.getValue(CATALOG_FAMILY, REGIONINFO_QUALIFIER));
// Only examine the rows where the startKey is zero length
if (info != null && info.getStartKey().length == 0) {
uniqueTables.add(info.getTableDesc());
// Only examine the rows where the startKey is zero length
if (info != null && info.getStartKey().length == 0) {
uniqueTables.add(info.getTableDesc());
}
return true;
} catch (RuntimeException e) {
LOG.error("Result=" + result);
throw e;
}
return true;
}
};
MetaScanner.metaScan(conf, visitor);

View File

@ -427,7 +427,6 @@ public class HTable {
connection.getRegionServerWithRetries(
new ServerCallable<Boolean>(connection, tableName, delete.getRow()) {
public Boolean call() throws IOException {
System.out.println("IN HT.get.ServerCallable,");
server.delete(location.getRegionInfo().getRegionName(), delete);
return null;
}