diff --git a/CHANGES.txt b/CHANGES.txt index efd5f6b8f66..88b05e8f3aa 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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 diff --git a/bin/HBase.rb b/bin/HBase.rb index e7380cac3aa..0852713a1b1 100644 --- a/bin/HBase.rb +++ b/bin/HBase.rb @@ -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 diff --git a/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java b/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java index 58a146458b8..dd0ee53ec6b 100644 --- a/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java +++ b/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java @@ -348,20 +348,21 @@ public class HConnectionManager implements HConstants { getMaster(); final TreeSet uniqueTables = new TreeSet(); - 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); diff --git a/src/java/org/apache/hadoop/hbase/client/HTable.java b/src/java/org/apache/hadoop/hbase/client/HTable.java index f181730663e..fccaedabc08 100644 --- a/src/java/org/apache/hadoop/hbase/client/HTable.java +++ b/src/java/org/apache/hadoop/hbase/client/HTable.java @@ -427,7 +427,6 @@ public class HTable { connection.getRegionServerWithRetries( new ServerCallable(connection, tableName, delete.getRow()) { public Boolean call() throws IOException { - System.out.println("IN HT.get.ServerCallable,"); server.delete(location.getRegionInfo().getRegionName(), delete); return null; }