mirror of https://github.com/apache/lucene.git
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:
parent
f1759bc6ad
commit
606901c6d5
|
@ -205,8 +205,10 @@ public class ClusterState implements JSONWriter.Writable {
|
||||||
if (c != null) states = Collections.singletonList( c );
|
if (c != null) states = Collections.singletonList( c );
|
||||||
}
|
}
|
||||||
|
|
||||||
for (CollectionRef coll : states) {
|
for (CollectionRef ref : states) {
|
||||||
for (Slice slice : coll.get().getSlices()) {
|
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()) {
|
for (Replica replica : slice.getReplicas()) {
|
||||||
// TODO: for really large clusters, we could 'index' on this
|
// TODO: for really large clusters, we could 'index' on this
|
||||||
String rnodeName = replica.getStr(ZkStateReader.NODE_NAME_PROP);
|
String rnodeName = replica.getStr(ZkStateReader.NODE_NAME_PROP);
|
||||||
|
@ -220,25 +222,6 @@ public class ClusterState implements JSONWriter.Writable {
|
||||||
return null;
|
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.
|
* Check if node is alive.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue