You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by yo...@apache.org on 2015/04/09 16:44:19 UTC
svn commit: r1672370 - in /lucene/dev/branches/branch_5x: ./ solr/
solr/core/ solr/core/src/java/org/apache/solr/handler/
solr/core/src/java/org/apache/solr/request/
Author: yonik
Date: Thu Apr 9 14:44:18 2015
New Revision: 1672370
URL: http://svn.apache.org/r1672370
Log:
SOLR-7238: remove buggy SolrQueryRequest.forward
Modified:
lucene/dev/branches/branch_5x/ (props changed)
lucene/dev/branches/branch_5x/solr/ (props changed)
lucene/dev/branches/branch_5x/solr/core/ (props changed)
lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/BlobHandler.java
lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java
lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java
Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/BlobHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/BlobHandler.java?rev=1672370&r1=1672369&r2=1672370&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/BlobHandler.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/BlobHandler.java Thu Apr 9 14:44:18 2015
@@ -38,11 +38,13 @@ import org.apache.solr.common.SolrExcept
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.MapSolrParams;
+import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.ContentStream;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.StrUtils;
import org.apache.solr.core.PluginInfo;
import org.apache.solr.core.SolrCore;
+import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrRequestHandler;
import org.apache.solr.response.SolrQueryResponse;
@@ -106,7 +108,7 @@ public class BlobHandler extends Request
TopDocs duplicate = req.getSearcher().search(new TermQuery(new Term("md5", md5)), 1);
if (duplicate.totalHits > 0) {
rsp.add("error", "duplicate entry");
- req.forward(null,
+ forward(req, null,
new MapSolrParams((Map) makeMap(
"q", "md5:" + md5,
"fl", "id,size,version,timestamp,blobName")),
@@ -194,7 +196,7 @@ public class BlobHandler extends Request
}
}
- req.forward(null,
+ forward(req, null,
new MapSolrParams((Map) makeMap(
"q", StrUtils.formatString(q, blobName, version),
"fl", "id,size,version,timestamp,blobName,md5",
@@ -208,7 +210,7 @@ public class BlobHandler extends Request
for (; ; ) {
SolrQueryResponse response = new SolrQueryResponse();
String id = blobName + "/" + version;
- req.forward("/get", new MapSolrParams(singletonMap("id", id)), response);
+ forward(req, "/get", new MapSolrParams(singletonMap("id", id)), response);
if (response.getValues().get("doc") == null) {
//ensure that the version does not exist
return;
@@ -305,4 +307,13 @@ public class BlobHandler extends Request
}
}
+
+ // This does not work for the general case of forwarding requests. It probably currently
+ // works OK for real-time get (which is all that BlobHandler uses it for).
+ private static void forward(SolrQueryRequest req, String handler ,SolrParams params, SolrQueryResponse rsp){
+ try(LocalSolrQueryRequest r = new LocalSolrQueryRequest(req.getCore(), params)) {
+ req.getCore().getRequestHandler(handler).handleRequest(r, rsp);
+ }
+ }
+
}
Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java?rev=1672370&r1=1672369&r2=1672370&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java Thu Apr 9 14:44:18 2015
@@ -91,13 +91,6 @@ public interface SolrQueryRequest {
*/
public String getParamString();
- /** Forward the request to another handler. DO a return after this call if
- * no other operations need to be performed
- * @param handler the name of the handler
- * @param params The new set of parameter
- */
- public void forward(String handler, SolrParams params, SolrQueryResponse rsp);
-
/** Returns any associated JSON (or null if none) in deserialized generic form.
* Java classes used to represent the JSON are as follows: Map, List, String, Long, Double, Boolean
*/
Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java?rev=1672370&r1=1672369&r2=1672370&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java Thu Apr 9 14:44:18 2015
@@ -166,14 +166,6 @@ public abstract class SolrQueryRequestBa
}
@Override
- public void forward(String handler ,SolrParams params, SolrQueryResponse rsp){
- try(LocalSolrQueryRequest r = new LocalSolrQueryRequest(getCore(), params)) {
- getCore().getRequestHandler(handler).handleRequest(r, rsp);
- }
-
- }
-
- @Override
public Map<String, Object> getJSON() {
return json;
}