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 2013/09/26 08:21:15 UTC

svn commit: r1526395 - in /lucene/dev/branches/branch_4x: ./ solr/ solr/solrj/ solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java

Author: noble
Date: Thu Sep 26 06:21:15 2013
New Revision: 1526395

URL: http://svn.apache.org/r1526395
Log:
SOLR-4221 make new solrj client/router able to read old clusterstate

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/solrj/   (props changed)
    lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java

Modified: lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java?rev=1526395&r1=1526394&r2=1526395&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java (original)
+++ lucene/dev/branches/branch_4x/solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java Thu Sep 26 06:21:15 2013
@@ -51,7 +51,12 @@ public abstract class DocRouter {
 
   protected String getRouteField(DocCollection coll){
     if(coll == null) return null;
-    Map m = (Map) coll.get(DOC_ROUTER);
+    Object o = coll.get(DOC_ROUTER);
+    if (o instanceof String) {
+      return null;
+      //old format. cannot have a routefield. Ignore it
+    }
+    Map m = (Map) o;
     if(m == null) return null;
     return (String) m.get("field");