HBASE-7600 TestAdmin.testCreateBadTables is failing occasionally (Liu Shaohui)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1535604 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
larsh 2013-10-25 01:43:49 +00:00
parent 5212bba403
commit 689014f2e5
1 changed files with 7 additions and 1 deletions

View File

@ -147,7 +147,7 @@ public class ZKTable {
public boolean checkAndSetEnablingTable(final TableName tableName)
throws KeeperException {
synchronized (this.cache) {
if (isEnablingTable(tableName)) {
if (isEnablingOrEnabledTable(tableName)) {
return false;
}
setTableState(tableName, ZooKeeperProtos.Table.State.ENABLING);
@ -228,6 +228,12 @@ public class ZKTable {
}
}
public boolean isEnablingOrEnabledTable(final TableName tableName) {
synchronized (this.cache) {
return isEnablingTable(tableName) || isEnabledTable(tableName);
}
}
public boolean isEnabledOrDisablingTable(final TableName tableName) {
synchronized (this.cache) {
return isEnabledTable(tableName) || isDisablingTable(tableName);