hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-13114 [UNITTEST] TestEnableTableHandler.testDeleteForSureClearsAllTableRowsFromMeta
Date Tue, 10 Mar 2015 21:51:41 GMT
Repository: hbase
Updated Branches:
  refs/heads/master ed93ddd94 -> 09e9c92d7


HBASE-13114 [UNITTEST] TestEnableTableHandler.testDeleteForSureClearsAllTableRowsFromMeta

Conflicts:
	hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/09e9c92d
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/09e9c92d
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/09e9c92d

Branch: refs/heads/master
Commit: 09e9c92d7699b985f45a48242a24af7c848926f0
Parents: ed93ddd
Author: stack <stack@apache.org>
Authored: Tue Mar 10 14:15:33 2015 -0700
Committer: stack <stack@apache.org>
Committed: Tue Mar 10 14:51:42 2015 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/master/handler/DeleteTableHandler.java |  3 +++
 .../hbase/master/handler/TestEnableTableHandler.java    | 12 ++++++------
 2 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/09e9c92d/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java
index b5b7555..d729cfa 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java
@@ -158,6 +158,9 @@ public class DeleteTableHandler extends TableEventHandler {
       if (!deletes.isEmpty()) {
         LOG.warn("Deleting some vestigal " + deletes.size() + " rows of " + this.tableName
+
           " from " + TableName.META_TABLE_NAME);
+        if (LOG.isDebugEnabled()) {
+          for (Delete d: deletes) LOG.debug("Purging " + d);
+        }
         metaTable.delete(deletes);
       }
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/09e9c92d/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
index 2db658b..6788d7d 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestEnableTableHandler.java
@@ -137,22 +137,20 @@ public class TestEnableTableHandler {
   public void testDeleteForSureClearsAllTableRowsFromMeta()
   throws IOException, InterruptedException {
     final TableName tableName = TableName.valueOf("testDeleteForSureClearsAllTableRowsFromMeta");
-    final MiniHBaseCluster cluster = TEST_UTIL.getHBaseCluster();
-    final HMaster m = cluster.getMaster();
     final HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
     final HTableDescriptor desc = new HTableDescriptor(tableName);
     desc.addFamily(new HColumnDescriptor(FAMILYNAME));
     admin.createTable(desc, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE);
     // Now I have a nice table, mangle it by removing the HConstants.REGIONINFO_QUALIFIER_STR
     // content from a few of the rows.
-    Scan metaScannerForMyTable =
-        MetaTableAccessor.getScanForTableName(TEST_UTIL.getConnection(), tableName);
     try (Table metaTable = TEST_UTIL.getConnection().getTable(TableName.META_TABLE_NAME))
{
-      try (ResultScanner scanner = metaTable.getScanner(metaScannerForMyTable)) {
+      try (ResultScanner scanner =
+          metaTable.getScanner(MetaTableAccessor.getScanForTableName(TEST_UTIL.getConnection(),
tableName))) {
         for (Result result : scanner) {
           // Just delete one row.
           Delete d = new Delete(result.getRow());
           d.addColumn(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER);
+          LOG.info("Mangled: " + d);
           metaTable.delete(d);
           break;
         }
@@ -162,8 +160,10 @@ public class TestEnableTableHandler {
       // Presume this synchronous all is.
       admin.deleteTable(tableName);
       int rowCount = 0;
-      try (ResultScanner scanner = metaTable.getScanner(metaScannerForMyTable)) {
+      try (ResultScanner scanner =
+          metaTable.getScanner(MetaTableAccessor.getScanForTableName(TEST_UTIL.getConnection(),
tableName))) {
         for (Result result : scanner) {
+          LOG.info("Found when none expected: " + result);
           rowCount++;
         }
       }


Mime
View raw message