You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by mb...@apache.org on 2015/12/24 13:59:55 UTC
[2/2] hbase git commit: HBASE-15034 IntegrationTestDDLMasterFailover
does not clean created namespaces.
HBASE-15034 IntegrationTestDDLMasterFailover does not clean created namespaces.
Signed-off-by: Matteo Bertozzi <ma...@cloudera.com>
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/b59f0240
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/b59f0240
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/b59f0240
Branch: refs/heads/branch-1
Commit: b59f0240e5a3aeb434d72ffe5d0575810d23dcf3
Parents: 4a7565a
Author: Samir Ahmic <sa...@personal.com>
Authored: Wed Dec 23 23:30:26 2015 +0100
Committer: Matteo Bertozzi <ma...@cloudera.com>
Committed: Thu Dec 24 04:59:13 2015 -0800
----------------------------------------------------------------------
.../hbase/IntegrationTestDDLMasterFailover.java | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/b59f0240/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java
index dffde55..47a3e4f 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java
@@ -103,7 +103,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
protected static final int DEFAULT_NUM_REGIONS = 50; // number of regions in pre-split tables
- private boolean keepTableAtTheEnd = false;
+ private boolean keepObjectsAtTheEnd = false;
protected HBaseCluster cluster;
protected Connection connection;
@@ -144,11 +144,19 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
@Override
public void cleanUpCluster() throws Exception {
- if (!keepTableAtTheEnd) {
+ if (!keepObjectsAtTheEnd) {
Admin admin = util.getHBaseAdmin();
admin.disableTables("ittable-\\d+");
admin.deleteTables("ittable-\\d+");
+ NamespaceDescriptor [] nsds = admin.listNamespaceDescriptors();
+ for(NamespaceDescriptor nsd:nsds ) {
+ if(nsd.getName().matches("itnamespace\\d+")) {
+ LOG.info("Removing namespace="+nsd.getName());
+ admin.deleteNamespace(nsd.getName());
+ }
+ }
}
+
enabledTables.clear();
disabledTables.clear();
deletedTables.clear();
@@ -938,9 +946,9 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
LOG.info("Running hbck");
hbck = HbckTestingUtil.doFsck(util.getConfiguration(), false);
if (HbckTestingUtil.inconsistencyFound(hbck)) {
- // Find the inconsistency during HBCK. Leave table undropped so that
+ // Find the inconsistency during HBCK. Leave table and namespace undropped so that
// we can check outside the test.
- keepTableAtTheEnd = true;
+ keepObjectsAtTheEnd = true;
}
HbckTestingUtil.assertNoErrors(hbck);
LOG.info("Finished hbck");