diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java index e0238eabfc3..93657d8cb2a 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java @@ -869,18 +869,18 @@ public class HConnectionManager { } /* - * @param True if table is online + * @param enabled True if table is enabled */ - private boolean testTableOnlineState(byte [] tableName, boolean online) + private boolean testTableOnlineState(byte [] tableName, boolean enabled) throws IOException { if (Bytes.equals(tableName, HConstants.ROOT_TABLE_NAME)) { // The root region is always enabled - return online; + return enabled; } String tableNameStr = Bytes.toString(tableName); ZooKeeperKeepAliveConnection zkw = getKeepAliveZooKeeperWatcher(); try { - if (online) { + if (enabled) { return ZKTableReadOnly.isEnabledTable(zkw, tableNameStr); } return ZKTableReadOnly.isDisabledTable(zkw, tableNameStr); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessControlFilter.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessControlFilter.java index 8a6cf1bb51f..c14ff719dbc 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessControlFilter.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessControlFilter.java @@ -27,6 +27,7 @@ import java.security.PrivilegedExceptionAction; import java.util.ArrayList; import java.util.List; import java.util.UUID; +import java.io.IOException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -90,7 +91,14 @@ public class TestAccessControlFilter { @Test public void testQualifierAccess() throws Exception { final HTable table = TEST_UTIL.createTable(TABLE, FAMILY); + try { + doQualifierAccess(table); + } finally { + table.close(); + } + } + private void doQualifierAccess(final HTable table) throws IOException, InterruptedException { // set permissions ADMIN.runAs(new PrivilegedExceptionAction() { @Override