[
https://issues.apache.org/jira/browse/HBASE-9055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13721938#comment-13721938
]
chunhui shen commented on HBASE-9055:
-------------------------------------
In 0.94 version, isTableEnabled() returns false for a table which doesn't
exist, but 0.95 return true, the related code is following:
0.95
{code}
ZKTableReadOnly
static ZooKeeperProtos.Table.State getTableState(final ZooKeeperWatcher zkw,
final String child)
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;
{code}
0.94
{code}
static TableState getTableState(final ZooKeeperWatcher zkw,
final String child)
throws KeeperException {
String znode = ZKUtil.joinZNode(zkw.tableZNode, child);
byte [] data = ZKUtil.getData(zkw, znode);
if (data == null || data.length <= 0) {
// Null if table is enabled.
return null;
}
{code}
I don't know why the return value for null case is changed in above code.
If the change is ok, +1 on the patch.
> HBaseAdmin#isTableEnabled() should check table existence
> --------------------------------------------------------
>
> Key: HBASE-9055
> URL: https://issues.apache.org/jira/browse/HBASE-9055
> Project: HBase
> Issue Type: Bug
> Affects Versions: 0.95.1
> Reporter: Ted Yu
> Assignee: Ted Yu
> Attachments: 9055-v1.txt, 9055-v2.txt
>
>
> Currently HBaseAdmin#isTableEnabled() returns true for a table which doesn't
> exist.
> We should check table existence.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira