SOLR-8189: Use WeakIdentityMap.newConcurrentHashMap instead of a synchronized WeakHashMap for better concurrency

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1710366 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2015-10-24 16:58:56 +00:00
parent fe22692ad2
commit b9ac587c32
1 changed files with 2 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.lucene.util.WeakIdentityMap;
import org.apache.solr.common.util.SuppressForbidden;
import org.apache.solr.core.IndexDeletionPolicyWrapper;
import org.apache.solr.core.SolrCore;
@ -56,7 +57,7 @@ public final class HttpCacheHeaderUtil {
*
* @see #calcEtag
*/
private static Map<SolrCore, EtagCacheVal> etagCoreCache = Collections.synchronizedMap(new WeakHashMap<>());
private static WeakIdentityMap<SolrCore, EtagCacheVal> etagCoreCache = WeakIdentityMap.newConcurrentHashMap();
/** @see #etagCoreCache */
private static class EtagCacheVal {