Package org.apache.solr.common.cloud

Examples of org.apache.solr.common.cloud.ClusterState


      while (cont) {
        if (verbose) LOG.debug("-");
        boolean sawLiveRecovering = false;
        zkStateReader.updateClusterState(true);
        ClusterState clusterState = zkStateReader.getClusterState();
        Map<String, Slice> slices = clusterState.getSlicesMap(collection);
        assertNotNull("Could not find collection:" + collection, slices);
        for (Map.Entry<String, Slice> entry : slices.entrySet()) {
          Map<String, Replica> shards = entry.getValue().getReplicasMap();
          for (Map.Entry<String, Replica> shard : shards.entrySet()) {
            if (verbose) LOG.debug("rstate:"
                + shard.getValue().getStr(ZkStateReader.STATE_PROP) + " live:"
                + clusterState.liveNodesContain(shard.getValue().getNodeName()));
            String state = shard.getValue().getStr(ZkStateReader.STATE_PROP);
            if ((state.equals(ZkStateReader.RECOVERING)
                || state.equals(ZkStateReader.SYNC) || state
                .equals(ZkStateReader.DOWN))
                && clusterState.liveNodesContain(shard.getValue().getStr(
                ZkStateReader.NODE_NAME_PROP))) {
              sawLiveRecovering = true;
            }
          }
        }
View Full Code Here

TOP

Related Classes of org.apache.solr.common.cloud.ClusterState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.