You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "rajeshbabu (JIRA)" <ji...@apache.org> on 2013/04/24 18:01:16 UTC

[jira] [Resolved] (HBASE-8396) balancerSwitch making two zookeeper calls everytime.

     [ https://issues.apache.org/jira/browse/HBASE-8396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

rajeshbabu resolved HBASE-8396.
-------------------------------

    Resolution: Fixed
    
> 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
>
>         Attachments: HBASE-8396.patch
>
>
> 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