SOLR-6521 use murmurhash because hashCode can give -ve val

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1653862 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2015-01-22 14:00:40 +00:00
parent b2249d1069
commit 02dfdd3202
1 changed files with 2 additions and 1 deletions

View File

@ -46,6 +46,7 @@ import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.params.ShardParams;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.params.UpdateParams;
import org.apache.solr.common.util.Hash;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SolrjNamedThreadFactory;
import org.apache.solr.common.util.StrUtils;
@ -1088,7 +1089,7 @@ public class CloudSolrClient extends SolrClient {
return ref.get();
}
List locks = this.locks;
final Object lock = locks.get(collection.hashCode() % locks.size());
final Object lock = locks.get(Hash.murmurhash3_x86_32(collection, 0, collection.length(), 0) % locks.size());
synchronized (lock){
//we have waited for sometime just check once again
col = getFromCache(collection);