HBASE-9055 HBaseAdmin#isTableEnabled() should return false for non-existent table (Ted Yu)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1507881 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bea9384779
commit
bc1e374081
|
@ -141,7 +141,7 @@ public class ZKTableReadOnly {
|
|||
throws KeeperException {
|
||||
String znode = ZKUtil.joinZNode(zkw.tableZNode, child);
|
||||
byte [] data = ZKUtil.getData(zkw, znode);
|
||||
if (data == null || data.length <= 0) return ZooKeeperProtos.Table.State.ENABLED;
|
||||
if (data == null || data.length <= 0) return null;
|
||||
try {
|
||||
ProtobufUtil.expectPBMagicPrefix(data);
|
||||
ZooKeeperProtos.Table.Builder builder = ZooKeeperProtos.Table.newBuilder();
|
||||
|
|
|
@ -366,7 +366,16 @@ public class TestAdmin {
|
|||
assertTrue(exceptionThrown);
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
||||
@Test
|
||||
public void testIsEnabledOnNonexistentTable() throws IOException {
|
||||
try {
|
||||
assertFalse(admin.isTableEnabled(Bytes.toBytes("non-existing")));
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify schema modification takes.
|
||||
* @throws IOException
|
||||
* @throws InterruptedException
|
||||
|
|
Loading…
Reference in New Issue