You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by cp...@apache.org on 2019/06/14 12:13:10 UTC

[lucene-solr] branch branch_8x updated (a53a80c -> 908754a)

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

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


    from a53a80c  LUCENE-8861: Script to find open PRs that needs attention (#719)
     new 5c65d12  SOLR-13511: Add SearchHandler.newResponseBuilder method to facilitate custom plugins' maintenance of per-request state in a custom ResponseBuilder. (Ramsey Haddad, Christine Poerschke)
     new 908754a  SOLR-13515: remove SolrPluginUtils.IdentityRegenerator in favour of NoOpRegenerator

The 2 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.


Summary of changes:
 solr/CHANGES.txt                                   |  6 ++++++
 .../solr/handler/component/SearchHandler.java      |  9 +++++++-
 .../java/org/apache/solr/util/SolrPluginUtils.java | 24 ----------------------
 3 files changed, 14 insertions(+), 25 deletions(-)


[lucene-solr] 02/02: SOLR-13515: remove SolrPluginUtils.IdentityRegenerator in favour of NoOpRegenerator

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

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

commit 908754a76461fb412cee60e22d989f735d737d2a
Author: Christine Poerschke <cp...@apache.org>
AuthorDate: Fri Jun 14 12:39:29 2019 +0100

    SOLR-13515: remove SolrPluginUtils.IdentityRegenerator in favour of NoOpRegenerator
---
 solr/CHANGES.txt                                   |  3 +++
 .../java/org/apache/solr/util/SolrPluginUtils.java | 24 ----------------------
 2 files changed, 3 insertions(+), 24 deletions(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 084ab39..773fa14 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -38,6 +38,9 @@ Upgrade Notes
   4lw.commands.whitelist=* to enable all ZooKeeper "4 letter commands".
   (Erick Erickson)
 
+* SOLR-13515: org.apache.solr.util.SolrPluginUtils.IdentityRegenerator has been removed, please use
+  the identical org.apache.solr.search.NoOpRegenerator instead. (David Smiley, Christine Poerschke)
+
 New Features
 ----------------------
 
diff --git a/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java b/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java
index 02b253e..2807ad6 100644
--- a/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java
+++ b/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java
@@ -63,7 +63,6 @@ import org.apache.solr.request.json.RequestUtil;
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.solr.schema.IndexSchema;
 import org.apache.solr.schema.SchemaField;
-import org.apache.solr.search.CacheRegenerator;
 import org.apache.solr.search.DocIterator;
 import org.apache.solr.search.DocList;
 import org.apache.solr.search.DocSet;
@@ -71,7 +70,6 @@ import org.apache.solr.search.FieldParams;
 import org.apache.solr.search.QParser;
 import org.apache.solr.search.QueryParsing;
 import org.apache.solr.search.ReturnFields;
-import org.apache.solr.search.SolrCache;
 import org.apache.solr.search.SolrIndexSearcher;
 import org.apache.solr.search.SolrQueryParser;
 import org.apache.solr.search.SortSpecParsing;
@@ -974,28 +972,6 @@ public class SolrPluginUtils {
     return out;
   }
 
-  /**
-   * A CacheRegenerator that can be used whenever the items in the cache
-   * are not dependant on the current searcher.
-   *
-   * <p>
-   * Flat out copies the oldKey=&gt;oldVal pair into the newCache
-   * </p>
-   */
-  public static class IdentityRegenerator implements CacheRegenerator {
-    @Override
-    public boolean regenerateItem(SolrIndexSearcher newSearcher,
-                                  SolrCache newCache,
-                                  SolrCache oldCache,
-                                  Object oldKey,
-                                  Object oldVal)
-      throws IOException {
-
-      newCache.put(oldKey,oldVal);
-      return true;
-    }
-  }
-
   public static void invokeSetters(Object bean, Iterable<Map.Entry<String,Object>> initArgs) {
     invokeSetters(bean, initArgs, false);
   }


[lucene-solr] 01/02: SOLR-13511: Add SearchHandler.newResponseBuilder method to facilitate custom plugins' maintenance of per-request state in a custom ResponseBuilder. (Ramsey Haddad, Christine Poerschke)

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

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

commit 5c65d124603b591322bdb0de92db67ed57604226
Author: Christine Poerschke <cp...@apache.org>
AuthorDate: Fri Jun 14 12:26:59 2019 +0100

    SOLR-13511: Add SearchHandler.newResponseBuilder method to facilitate custom plugins' maintenance of per-request state in a custom ResponseBuilder. (Ramsey Haddad, Christine Poerschke)
---
 solr/CHANGES.txt                                                 | 3 +++
 .../java/org/apache/solr/handler/component/SearchHandler.java    | 9 ++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 97aa2c3..084ab39 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -118,6 +118,9 @@ Other Changes
 
 * SOLR-8754: Adding test cases for org.apache.solr.util.hll.NumberUtilTest (Benoit Vanalderweireldt via janhoy)
 
+* SOLR-13511: Add SearchHandler.newResponseBuilder method to facilitate custom plugins' maintenance
+  of per-request state in a custom ResponseBuilder. (Ramsey Haddad, Christine Poerschke)
+
 ==================  8.1.2 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
diff --git a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
index 96c2200..ecdc0ec 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
@@ -247,11 +247,18 @@ public class SearchHandler extends RequestHandlerBase implements SolrCoreAware ,
     return shardHandler;
   }
   
+  /**
+   * Override this method if you require a custom {@link ResponseBuilder} e.g. for use by a custom {@link SearchComponent}.
+   */
+  protected ResponseBuilder newResponseBuilder(SolrQueryRequest req, SolrQueryResponse rsp, List<SearchComponent> components) {
+    return new ResponseBuilder(req, rsp, components);
+  }
+
   @Override
   public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception
   {
     List<SearchComponent> components  = getComponents();
-    ResponseBuilder rb = new ResponseBuilder(req, rsp, components);
+    ResponseBuilder rb = newResponseBuilder(req, rsp, components);
     if (rb.requestInfo != null) {
       rb.requestInfo.setResponseBuilder(rb);
     }