You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by la...@apache.org on 2016/11/01 19:49:57 UTC
[33/50] [abbrv] hbase git commit: HBASE-16889 Proc-V2: verifyTables
in the IntegrationTestDDLMasterFailover test after each table DDL is
incorrect (Stephen Yuan Jiang)
HBASE-16889 Proc-V2: verifyTables in the IntegrationTestDDLMasterFailover test after each table DDL is incorrect (Stephen Yuan Jiang)
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/42e7a4ac
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/42e7a4ac
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/42e7a4ac
Branch: refs/heads/branch-1
Commit: 42e7a4acd7112fde71ca939eaf8225db64a422d2
Parents: 0117ed9
Author: Stephen Yuan Jiang <sy...@gmail.com>
Authored: Thu Oct 20 18:25:29 2016 -0700
Committer: Stephen Yuan Jiang <sy...@gmail.com>
Committed: Thu Oct 20 18:25:29 2016 -0700
----------------------------------------------------------------------
.../hbase/IntegrationTestDDLMasterFailover.java | 54 ++++++++++++--------
1 file changed, 33 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/42e7a4ac/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 52a118a..adf0f46 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
@@ -153,7 +153,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
admin.disableTables("ittable-\\d+");
admin.deleteTables("ittable-\\d+");
NamespaceDescriptor [] nsds = admin.listNamespaceDescriptors();
- for(NamespaceDescriptor nsd:nsds ) {
+ for(NamespaceDescriptor nsd: nsds) {
if(nsd.getName().matches("itnamespace\\d+")) {
LOG.info("Removing namespace="+nsd.getName());
admin.deleteNamespace(nsd.getName());
@@ -294,15 +294,14 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
admin.createNamespace(nsd);
NamespaceDescriptor freshNamespaceDesc = admin.getNamespaceDescriptor(nsd.getName());
Assert.assertTrue("Namespace: " + nsd + " was not created", freshNamespaceDesc != null);
- LOG.info("Created namespace:" + freshNamespaceDesc);
namespaceMap.put(nsd.getName(), freshNamespaceDesc);
+ LOG.info("Created namespace:" + freshNamespaceDesc);
} catch (Exception e){
LOG.warn("Caught exception in action: " + this.getClass());
throw e;
} finally {
admin.close();
}
- verifyNamespaces();
}
private NamespaceDescriptor createNamespaceDesc() {
@@ -340,15 +339,17 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
Assert.assertTrue(
"Namespace: " + selected + " was not modified",
freshNamespaceDesc.getConfigurationValue(nsTestConfigKey).equals(nsValueNew));
- LOG.info("Modified namespace :" + freshNamespaceDesc);
+ Assert.assertTrue(
+ "Namespace: " + namespaceName + " does not exist",
+ admin.getNamespaceDescriptor(namespaceName) != null);
namespaceMap.put(namespaceName, freshNamespaceDesc);
+ LOG.info("Modified namespace :" + freshNamespaceDesc);
} catch (Exception e){
LOG.warn("Caught exception in action: " + this.getClass());
throw e;
} finally {
admin.close();
}
- verifyNamespaces();
}
}
@@ -382,7 +383,6 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
} finally {
admin.close();
}
- verifyNamespaces();
}
}
@@ -425,6 +425,8 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
admin.createTable(htd, startKey, endKey, numRegions);
Assert.assertTrue("Table: " + htd + " was not created", admin.tableExists(tableName));
HTableDescriptor freshTableDesc = admin.getTableDescriptor(tableName);
+ Assert.assertTrue(
+ "After create, Table: " + tableName + " in not enabled", admin.isTableEnabled(tableName));
enabledTables.put(tableName, freshTableDesc);
LOG.info("Created table:" + freshTableDesc);
} catch (Exception e) {
@@ -433,7 +435,6 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
} finally {
admin.close();
}
- verifyTables();
}
private HTableDescriptor createTableDesc() {
@@ -465,6 +466,9 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
Assert.assertTrue("Table: " + selected + " was not disabled",
admin.isTableDisabled(tableName));
HTableDescriptor freshTableDesc = admin.getTableDescriptor(tableName);
+ Assert.assertTrue(
+ "After disable, Table: " + tableName + " is not disabled",
+ admin.isTableDisabled(tableName));
disabledTables.put(tableName, freshTableDesc);
LOG.info("Disabled table :" + freshTableDesc);
} catch (Exception e){
@@ -490,7 +494,6 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
} finally {
admin.close();
}
- verifyTables();
}
}
@@ -512,6 +515,8 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
Assert.assertTrue("Table: " + selected + " was not enabled",
admin.isTableEnabled(tableName));
HTableDescriptor freshTableDesc = admin.getTableDescriptor(tableName);
+ Assert.assertTrue(
+ "After enable, Table: " + tableName + " in not enabled", admin.isTableEnabled(tableName));
enabledTables.put(tableName, freshTableDesc);
LOG.info("Enabled table :" + freshTableDesc);
} catch (Exception e){
@@ -537,7 +542,6 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
} finally {
admin.close();
}
- verifyTables();
}
}
@@ -566,7 +570,6 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
} finally {
admin.close();
}
- verifyTables();
}
}
@@ -611,15 +614,17 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
HTableDescriptor freshTableDesc = admin.getTableDescriptor(tableName);
Assert.assertTrue("Column family: " + cfd + " was not added",
freshTableDesc.hasFamily(cfd.getName()));
- LOG.info("Added column family: " + cfd + " to table: " + tableName);
+ Assert.assertTrue(
+ "After add column family, Table: " + tableName + " is not disabled",
+ admin.isTableDisabled(tableName));
disabledTables.put(tableName, freshTableDesc);
+ LOG.info("Added column family: " + cfd + " to table: " + tableName);
} catch (Exception e) {
LOG.warn("Caught exception in action: " + this.getClass());
throw e;
} finally {
admin.close();
}
- verifyTables();
}
private HColumnDescriptor createFamilyDesc() {
@@ -658,16 +663,18 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
freshColumnDesc.getMaxVersions(), versions);
Assert.assertEquals("Column family: " + freshColumnDesc + " was not altered",
freshColumnDesc.getMinVersions(), versions);
- LOG.info("Altered versions of column family: " + columnDesc + " to: " + versions +
- " in table: " + tableName);
+ Assert.assertTrue(
+ "After alter versions of column family, Table: " + tableName + " is not disabled",
+ admin.isTableDisabled(tableName));
disabledTables.put(tableName, freshTableDesc);
+ LOG.info("Altered versions of column family: " + columnDesc + " to: " + versions +
+ " in table: " + tableName);
} catch (Exception e) {
LOG.warn("Caught exception in action: " + this.getClass());
throw e;
} finally {
admin.close();
}
- verifyTables();
}
}
@@ -699,16 +706,18 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
HColumnDescriptor freshColumnDesc = freshTableDesc.getFamily(columnDesc.getName());
Assert.assertEquals("Encoding of column family: " + columnDesc + " was not altered",
freshColumnDesc.getDataBlockEncoding().getId(), id);
- LOG.info("Altered encoding of column family: " + freshColumnDesc + " to: " + id +
- " in table: " + tableName);
+ Assert.assertTrue(
+ "After alter encoding of column family, Table: " + tableName + " is not disabled",
+ admin.isTableDisabled(tableName));
disabledTables.put(tableName, freshTableDesc);
+ LOG.info("Altered encoding of column family: " + freshColumnDesc + " to: " + id +
+ " in table: " + tableName);
} catch (Exception e) {
LOG.warn("Caught exception in action: " + this.getClass());
throw e;
} finally {
admin.close();
}
- verifyTables();
}
}
@@ -735,15 +744,17 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
HTableDescriptor freshTableDesc = admin.getTableDescriptor(tableName);
Assert.assertFalse("Column family: " + cfd + " was not added",
freshTableDesc.hasFamily(cfd.getName()));
- LOG.info("Deleted column family: " + cfd + " from table: " + tableName);
+ Assert.assertTrue(
+ "After delete column family, Table: " + tableName + " is not disabled",
+ admin.isTableDisabled(tableName));
disabledTables.put(tableName, freshTableDesc);
+ LOG.info("Deleted column family: " + cfd + " from table: " + tableName);
} catch (Exception e) {
LOG.warn("Caught exception in action: " + this.getClass());
throw e;
} finally {
admin.close();
}
- verifyTables();
}
}
@@ -782,6 +793,8 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
table.put(put);
}
HTableDescriptor freshTableDesc = admin.getTableDescriptor(tableName);
+ Assert.assertTrue(
+ "After insert, Table: " + tableName + " in not enabled", admin.isTableEnabled(tableName));
enabledTables.put(tableName, freshTableDesc);
LOG.info("Added " + numRows + " rows to table: " + selected);
} catch (Exception e) {
@@ -790,7 +803,6 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
} finally {
admin.close();
}
- verifyTables();
}
}