HBASE-8396 balancerSwitch making two zookeeper calls everytime(Rajeshbabu)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1471460 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
846acf6258
commit
100cf35f5d
|
@ -64,9 +64,9 @@ public class LoadBalancerTracker extends ZooKeeperNodeTracker {
|
|||
public void setBalancerOn(boolean balancerOn) throws KeeperException {
|
||||
byte [] upData = toByteArray(balancerOn);
|
||||
try {
|
||||
ZKUtil.createAndWatch(watcher, watcher.balancerZNode, upData);
|
||||
} catch(KeeperException.NodeExistsException nee) {
|
||||
ZKUtil.setData(watcher, watcher.balancerZNode, upData);
|
||||
} catch(KeeperException.NoNodeException nne) {
|
||||
ZKUtil.createAndWatch(watcher, watcher.balancerZNode, upData);
|
||||
}
|
||||
super.nodeDataChanged(watcher.balancerZNode);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue