Skip to content

Apache Lucene open-source search software

Merged revision(s) 1670525-1670526 from lucene/dev/branches/branch_5x: SOLR-7331: revert unintentional change ........

Ryan McKinley33fc7b50469a
diff --git a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
index 902a40e1eab..fefd3471718 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
@@ -199,9 +199,7 @@ public class HttpShardHandler extends ShardHandler {
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 ShardHandler {
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.