From 100cf35f5d29e4dc8a184fb0985dbafed744dc05 Mon Sep 17 00:00:00 2001 From: anoopsamjohn Date: Wed, 24 Apr 2013 15:08:56 +0000 Subject: [PATCH] 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 --- .../apache/hadoop/hbase/zookeeper/LoadBalancerTracker.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/LoadBalancerTracker.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/LoadBalancerTracker.java index 43168a27d82..840fe2be283 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/LoadBalancerTracker.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/LoadBalancerTracker.java @@ -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); }