fail hashing when using null type or _all
This commit is contained in:
parent
0b59c00e0d
commit
317d4f687f
|
@ -19,6 +19,7 @@
|
|||
|
||||
package org.elasticsearch.cluster.routing.operation.plain;
|
||||
|
||||
import org.elasticsearch.ElasticSearchIllegalArgumentException;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
import org.elasticsearch.cluster.routing.GroupShardsIterator;
|
||||
|
@ -198,6 +199,9 @@ public class PlainOperationRouting extends AbstractComponent implements Operatio
|
|||
}
|
||||
|
||||
protected int hash(String type, String id) {
|
||||
if (type == null || "_all".equals(type)) {
|
||||
throw new ElasticSearchIllegalArgumentException("Can't route an operation with no type and having type part of the routing (for backward comp)");
|
||||
}
|
||||
return hashFunction.hash(type, id);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue