You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ry...@apache.org on 2015/04/01 02:37:44 UTC
svn commit: r1670527 - in /lucene/dev/trunk: ./ lucene/ lucene/suggest/
solr/ solr/core/
solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
Author: ryan
Date: Wed Apr 1 00:37:43 2015
New Revision: 1670527
URL: http://svn.apache.org/r1670527
Log:
Merged revision(s) 1670525-1670526 from lucene/dev/branches/branch_5x:
SOLR-7331: revert unintentional change
........
Modified:
lucene/dev/trunk/ (props changed)
lucene/dev/trunk/lucene/ (props changed)
lucene/dev/trunk/lucene/suggest/ (props changed)
lucene/dev/trunk/solr/ (props changed)
lucene/dev/trunk/solr/core/ (props changed)
lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java?rev=1670527&r1=1670526&r2=1670527&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java Wed Apr 1 00:37:43 2015
@@ -199,9 +199,7 @@ public class HttpShardHandler extends Sh
params.remove(CommonParams.WT); // use default (currently javabin)
params.remove(CommonParams.VERSION);
- // SolrRequest req = new QueryRequest(SolrRequest.METHOD.POST, "/select");
- // use generic request to avoid extra processing of queries
- QueryRequest req = new QueryRequest(params);
+ QueryRequest req = makeQueryRequest(sreq, params, shard);
req.setMethod(SolrRequest.METHOD.POST);
// no need to set the response parser as binary is the default
@@ -239,12 +237,29 @@ public class HttpShardHandler extends Sh
ssr.elapsedTime = TimeUnit.MILLISECONDS.convert(System.nanoTime() - startTime, TimeUnit.NANOSECONDS);
- return srsp;
+ return transfomResponse(sreq, srsp, shard);
}
};
pending.add( completionService.submit(task) );
}
+
+ /**
+ * Subclasses could modify the request based on the shard
+ */
+ protected QueryRequest makeQueryRequest(final ShardRequest sreq, ModifiableSolrParams params, String shard)
+ {
+ // use generic request to avoid extra processing of queries
+ return new QueryRequest(params);
+ }
+
+ /**
+ * Subclasses could modify the Response based on the the shard
+ */
+ protected ShardResponse transfomResponse(final ShardRequest sreq, ShardResponse rsp, String shard)
+ {
+ return rsp;
+ }
/** returns a ShardResponse of the last response correlated with a ShardRequest. This won't
* return early if it runs into an error.