You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2020/06/17 00:25:30 UTC

[lucene-solr] branch jira/solr14576 created (now eb17ae3)

This is an automated email from the ASF dual-hosted git repository.

noble pushed a change to branch jira/solr14576
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git.


      at eb17ae3  Use core names as keys

This branch includes the following new commits:

     new eb17ae3  Use core names as keys

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[lucene-solr] 01/01: Use core names as keys

Posted by no...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

noble pushed a commit to branch jira/solr14576
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit eb17ae39f5a8c6ead3840db791aaecc9a0191679
Author: noble <no...@apache.org>
AuthorDate: Wed Jun 17 10:24:46 2020 +1000

    Use core names as keys
---
 .../solr/servlet/cache/HttpCacheHeaderUtil.java    | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java b/solr/core/src/java/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
index 9c1c70f..5424cd5 100644
--- a/solr/core/src/java/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
+++ b/solr/core/src/java/org/apache/solr/servlet/cache/HttpCacheHeaderUtil.java
@@ -16,27 +16,25 @@
  */
 package org.apache.solr.servlet.cache;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import java.util.Collections;
 import java.util.List;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
+import org.apache.commons.codec.binary.Base64;
 import org.apache.lucene.util.WeakIdentityMap;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrException.ErrorCode;
 import org.apache.solr.common.util.SuppressForbidden;
 import org.apache.solr.core.IndexDeletionPolicyWrapper;
-import org.apache.solr.core.SolrCore;
 import org.apache.solr.core.SolrConfig;
 import org.apache.solr.core.SolrConfig.HttpCachingConfig.LastModFrom;
-import org.apache.solr.common.SolrException;
-import org.apache.solr.common.SolrException.ErrorCode;
-import org.apache.solr.search.SolrIndexSearcher;
+import org.apache.solr.core.SolrCore;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.response.SolrQueryResponse;
-
-import org.apache.commons.codec.binary.Base64;
+import org.apache.solr.search.SolrIndexSearcher;
 
 public final class HttpCacheHeaderUtil {
   
@@ -54,7 +52,7 @@ public final class HttpCacheHeaderUtil {
    *
    * @see #calcEtag
    */
-  private static WeakIdentityMap<SolrCore, EtagCacheVal> etagCoreCache = WeakIdentityMap.newConcurrentHashMap();
+  private static WeakIdentityMap<String, EtagCacheVal> etagCoreCache = WeakIdentityMap.newConcurrentHashMap();
 
   /** @see #etagCoreCache */
   private static class EtagCacheVal {
@@ -89,12 +87,12 @@ public final class HttpCacheHeaderUtil {
     final long currentIndexVersion
       = solrReq.getSearcher().getIndexReader().getVersion();
 
-    EtagCacheVal etagCache = etagCoreCache.get(core);
+    EtagCacheVal etagCache = etagCoreCache.get(core.getName());
     if (null == etagCache) {
       final String etagSeed
         = core.getSolrConfig().getHttpCachingConfig().getEtagSeed();
       etagCache = new EtagCacheVal(etagSeed);
-      etagCoreCache.put(core, etagCache);
+      etagCoreCache.put(core.getName(), etagCache);
     }
     
     return etagCache.calcEtag(currentIndexVersion);