SOLR-6632

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1632751 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2014-10-18 10:58:29 +00:00
parent f1759bc6ad
commit 606901c6d5
1 changed files with 4 additions and 21 deletions

View File

@ -205,8 +205,10 @@ public class ClusterState implements JSONWriter.Writable {
if (c != null) states = Collections.singletonList( c );
}
for (CollectionRef coll : states) {
for (Slice slice : coll.get().getSlices()) {
for (CollectionRef ref : states) {
DocCollection coll = ref.get();
if(coll == null) continue;// this collection go tremoved in between, skip
for (Slice slice : coll.getSlices()) {
for (Replica replica : slice.getReplicas()) {
// TODO: for really large clusters, we could 'index' on this
String rnodeName = replica.getStr(ZkStateReader.NODE_NAME_PROP);
@ -220,25 +222,6 @@ public class ClusterState implements JSONWriter.Writable {
return null;
}
/*public String getShardIdByCoreNodeName(String collectionName, String coreNodeName) {
Collection<DocCollection> states = collectionStates.values();
if (collectionName != null) {
CollectionRef c = collectionStates.get(collectionName);
if (c != null) states = Collections.singletonList(c);
}
for (DocCollection coll : states) {
for (Slice slice : coll.getSlices()) {
for (Replica replica : slice.getReplicas()) {
if (coreNodeName.equals(replica.getName())) {
return slice.getName();
}
}
}
}
return null;
}*/
/**
* Check if node is alive.
*/