HBASE-6260 ADDENDUM (fix test failure plus comment fixups)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1384954 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
gchanan 2012-09-14 22:36:03 +00:00
parent cc2cb6061c
commit 0dab826f19
1 changed files with 3 additions and 2 deletions

View File

@ -30,7 +30,7 @@ import org.apache.zookeeper.KeeperException;
import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.InvalidProtocolBufferException;
/** /**
* Tracks the load balancer switch up in ZK * Tracks the load balancer state up in ZK
*/ */
@InterfaceAudience.Private @InterfaceAudience.Private
public class LoadBalancerTracker extends ZooKeeperNodeTracker { public class LoadBalancerTracker extends ZooKeeperNodeTracker {
@ -47,7 +47,7 @@ public class LoadBalancerTracker extends ZooKeeperNodeTracker {
public boolean isBalancerOn() { public boolean isBalancerOn() {
byte [] upData = super.getData(false); byte [] upData = super.getData(false);
try { try {
// is data in ZK is null, use default of on. // if data in ZK is null, use default of on.
return upData == null || parseFrom(upData).getBalancerOn(); return upData == null || parseFrom(upData).getBalancerOn();
} catch (DeserializationException dex) { } catch (DeserializationException dex) {
LOG.error("ZK state for LoadBalancer could not be parsed " + Bytes.toStringBinary(upData)); LOG.error("ZK state for LoadBalancer could not be parsed " + Bytes.toStringBinary(upData));
@ -68,6 +68,7 @@ public class LoadBalancerTracker extends ZooKeeperNodeTracker {
} catch(KeeperException.NodeExistsException nee) { } catch(KeeperException.NodeExistsException nee) {
ZKUtil.setData(watcher, watcher.balancerZNode, upData); ZKUtil.setData(watcher, watcher.balancerZNode, upData);
} }
super.nodeDataChanged(watcher.balancerZNode);
} }
private byte [] toByteArray(boolean isBalancerOn) { private byte [] toByteArray(boolean isBalancerOn) {