HBASE-11018 ZKUtil.getChildDataAndWatchForNewChildren() will not return null as indicated (Jerry He)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1589015 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2014-04-22 02:30:01 +00:00
parent 3108c9a014
commit 57f8591001
1 changed files with 4 additions and 3 deletions

View File

@ -810,15 +810,16 @@ public class ZKUtil {
ZooKeeperWatcher zkw, String baseNode) throws KeeperException {
List<String> nodes =
ZKUtil.listChildrenAndWatchForNewChildren(zkw, baseNode);
List<NodeAndData> newNodes = new ArrayList<NodeAndData>();
if (nodes != null) {
List<NodeAndData> newNodes = new ArrayList<NodeAndData>();
for (String node : nodes) {
String nodePath = ZKUtil.joinZNode(baseNode, node);
byte[] data = ZKUtil.getDataAndWatch(zkw, nodePath);
newNodes.add(new NodeAndData(nodePath, data));
}
return newNodes;
}
return newNodes;
return null;
}
/**
@ -1174,7 +1175,7 @@ public class ZKUtil {
createAndFailSilent(zkw,
(CreateAndFailSilent)ZKUtilOp.createAndFailSilent(znode, data));
}
private static void createAndFailSilent(ZooKeeperWatcher zkw, CreateAndFailSilent cafs)
throws KeeperException {
CreateRequest create = (CreateRequest)toZooKeeperOp(zkw, cafs).toRequestRecord();