lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject svn commit: r1526395 - in /lucene/dev/branches/branch_4x: ./ solr/ solr/solrj/ solr/solrj/src/java/org/apache/solr/common/cloud/DocRouter.java
Date Thu, 26 Sep 2013 06:21:15 GMT
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");
 



Mime
View raw message