You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2014/10/18 13:07:42 UTC
svn commit: r1632753 - in /lucene/dev/branches/branch_5x: ./ solr/
solr/solrj/
solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java
Author: noble
Date: Sat Oct 18 11:07:42 2014
New Revision: 1632753
URL: http://svn.apache.org/r1632753
Log:
SOLR-6632
Modified:
lucene/dev/branches/branch_5x/ (props changed)
lucene/dev/branches/branch_5x/solr/ (props changed)
lucene/dev/branches/branch_5x/solr/solrj/ (props changed)
lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java
Modified: lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java?rev=1632753&r1=1632752&r2=1632753&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java (original)
+++ lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java Sat Oct 18 11:07:42 2014
@@ -205,8 +205,10 @@ public class ClusterState implements JSO
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 JSO
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.
*/