Adding some logging and a ZooKeeper path setup.
Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/bca9cafc Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/bca9cafc Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/bca9cafc Branch: refs/heads/master Commit: bca9cafc2504f0be4befeec6f04b67218776de55 Parents: 21ddfde Author: Aaron McCurry <[email protected]> Authored: Fri Jun 7 13:30:49 2013 -0400 Committer: Aaron McCurry <[email protected]> Committed: Fri Jun 7 13:30:49 2013 -0400 ---------------------------------------------------------------------- .../blur/manager/clusterstatus/ZookeeperClusterStatus.java | 8 +++++++- .../org/apache/blur/thrift/ThriftBlurControllerServer.java | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/bca9cafc/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/ZookeeperClusterStatus.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/ZookeeperClusterStatus.java b/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/ZookeeperClusterStatus.java index eb4b89d..4e84d08 100644 --- a/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/ZookeeperClusterStatus.java +++ b/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/ZookeeperClusterStatus.java @@ -451,9 +451,15 @@ public class ZookeeperClusterStatus extends ClusterStatus { private byte[] getData(String path) throws KeeperException, InterruptedException { Stat stat = _zk.exists(path, false); if (stat == null) { + LOG.debug("Tried to fetch path [{0}] and path is missing",path); return null; } - return _zk.getData(path, false, stat); + byte[] data = _zk.getData(path, false, stat); + if (data == null) { + LOG.debug("Fetched path [{0}] and data is null",path); + return null; + } + return data; } @Override http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/bca9cafc/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurControllerServer.java ---------------------------------------------------------------------- diff --git a/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurControllerServer.java b/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurControllerServer.java index ee22f3e..c915bb9 100644 --- a/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurControllerServer.java +++ b/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurControllerServer.java @@ -52,6 +52,7 @@ import org.apache.blur.manager.clusterstatus.ZookeeperClusterStatus; import org.apache.blur.manager.indexserver.BlurServerShutDown; import org.apache.blur.manager.indexserver.BlurServerShutDown.BlurShutdown; import org.apache.blur.thrift.generated.Blur.Iface; +import org.apache.blur.utils.BlurConstants; import org.apache.blur.utils.BlurUtil; import org.apache.blur.zookeeper.ZkUtils; import org.apache.zookeeper.ZooKeeper; @@ -86,7 +87,8 @@ public class ThriftBlurControllerServer extends ThriftServer { final ZooKeeper zooKeeper = ZkUtils.newZooKeeper(zkConnectionStr); - BlurUtil.setupZookeeper(zooKeeper); + //@TODO this is confusing because controllers are in a cluster by default, but they see all the shards clusters. + BlurUtil.setupZookeeper(zooKeeper, BlurConstants.BLUR_CLUSTER); final ZookeeperClusterStatus clusterStatus = new ZookeeperClusterStatus(zooKeeper);
