SOLR-8860: Remove back-compat handling of router format made in SOLR-4221 in 4.5.0

This commit is contained in:
Shalin Shekhar Mangar 2016-03-17 09:21:30 +05:30
parent 3cdde08ff2
commit ae846bfb49
2 changed files with 11 additions and 18 deletions

View File

@ -61,6 +61,8 @@ Other Changes
* SOLR-7516: Improve javadocs for JavaBinCodec, ObjectResolver and enforce the single-usage policy.
(Jason Gerlowski, Benoit Vanalderweireldt, shalin)
* SOLR-8860: Remove back-compat handling of router format made in SOLR-4221 in 4.5.0. (shalin)
================== 6.0.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

View File

@ -48,30 +48,21 @@ public abstract class DocRouter {
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unknown document router '"+ routerName + "'");
}
protected String getRouteField(DocCollection coll){
if(coll == null) return null;
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;
protected String getRouteField(DocCollection coll) {
if (coll == null) return null;
Map m = (Map) coll.get(DOC_ROUTER);
if (m == null) return null;
return (String) m.get("field");
}
public static Map<String,Object> getRouterSpec(ZkNodeProps props){
Map<String,Object> map = new LinkedHashMap<>();
public static Map<String, Object> getRouterSpec(ZkNodeProps props) {
Map<String, Object> map = new LinkedHashMap<>();
for (String s : props.keySet()) {
if(s.startsWith("router.")){
if (s.startsWith("router.")) {
map.put(s.substring(7), props.get(s));
}
}
Object o = props.get("router");
if (o instanceof String) {
map.put("name", o);
} else if (map.get("name") == null) {
if (map.get("name") == null) {
map.put("name", DEFAULT_NAME);
}
return map;