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:11:45 UTC

[lucene-solr] branch master updated (d279368 -> 335aaf8)

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

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


    from d279368  LUCENE-8861: Script to find open PRs that needs attention (#719)
     new 43fc05c  SOLR-13511: Add SearchHandler.newResponseBuilder method to facilitate custom plugins' maintenance of per-request state in a custom ResponseBuilder. (Ramsey Haddad, Christine Poerschke)
     new 335aaf8  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 master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 335aaf801edda188af1a9fa01a268878882ffe22
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 41b29f9..370482d 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -73,6 +73,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 master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 43fc05c1ed5fc408705ce7b04e83dccf6aadb396
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 0a6ae4a..41b29f9 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -155,6 +155,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);
     }