mirror of https://github.com/apache/lucene.git
SOLR-8860: Remove back-compat handling of router format made in SOLR-4221 in 4.5.0
This commit is contained in:
parent
3cdde08ff2
commit
ae846bfb49
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue