rajeshbabu created HBASE-8396:
---------------------------------
Summary: balancerSwitch making two zookeeper calls everytime.
Key: HBASE-8396
URL: https://issues.apache.org/jira/browse/HBASE-8396
Project: HBase
Issue Type: Bug
Components: Balancer
Reporter: rajeshbabu
Assignee: rajeshbabu
Fix For: 0.98.0, 0.95.2
first time on balancerSwitch we will create balancerZnode.
from second time onwards we will try to create node(1st time) which will fail
with NodeExistsException then we will call setData(2nd time).
{code}
try {
ZKUtil.createAndWatch(watcher, watcher.balancerZNode, upData);
} catch(KeeperException.NodeExistsException nee) {
ZKUtil.setData(watcher, watcher.balancerZNode, upData);
}
{code}
We can change as below to avoid extra zk call from second time onwards.
{code}
try {
ZKUtil.setData(watcher, watcher.balancerZNode, upData);
} catch(KeeperException.NoNodeException nne) {
ZKUtil.createAndWatch(watcher, watcher.balancerZNode, upData);
}
{code}
--
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