Class ParallelHttpShardHandler
- java.lang.Object
-
- org.apache.solr.handler.component.ShardHandler
-
- org.apache.solr.handler.component.HttpShardHandler
-
- org.apache.solr.handler.component.ParallelHttpShardHandler
-
@NotThreadSafe public class ParallelHttpShardHandler extends HttpShardHandler
A version ofHttpShardHandleroptimized for massively-sharded collections.Uses a
HttpShardHandlerFactory.commExecutorthread for all work related to outgoing requests, allowingHttpShardHandler.submit(ShardRequest, String, ModifiableSolrParams)to return more quickly. (SeeHttpShardHandlerfor comparison.)The additional focus on parallelization makes this an ideal implementation for collections with many shards.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.handler.component.HttpShardHandler
HttpShardHandler.SimpleSolrResponse
-
-
Field Summary
-
Fields inherited from class org.apache.solr.handler.component.HttpShardHandler
lbClient, ONLY_NRT_REPLICAS, responseFutureMap, responses
-
-
Constructor Summary
Constructors Constructor Description ParallelHttpShardHandler(ParallelHttpShardHandlerFactory httpShardHandlerFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancelAll()Cancels all uncompleted requests managed by this instanceprotected voidmakeShardRequest(ShardRequest sreq, String shard, org.apache.solr.common.params.ModifiableSolrParams params, org.apache.solr.client.solrj.impl.LBSolrClient.Req lbReq, HttpShardHandler.SimpleSolrResponse ssr, ShardResponse srsp, long startTimeNS)Do the actual work of sending a request to a shard and receiving the responseprotected booleanresponsesPending()-
Methods inherited from class org.apache.solr.handler.component.HttpShardHandler
createQueryRequest, getShardHandlerFactory, getShardsTolerantAsBool, prepDistributed, recordShardSubmitError, submit, takeCompletedIncludingErrors, takeCompletedOrError, transformResponse
-
Methods inherited from class org.apache.solr.handler.component.ShardHandler
setShardAttributesToParams
-
-
-
-
Constructor Detail
-
ParallelHttpShardHandler
public ParallelHttpShardHandler(ParallelHttpShardHandlerFactory httpShardHandlerFactory)
-
-
Method Detail
-
responsesPending
protected boolean responsesPending()
- Overrides:
responsesPendingin classHttpShardHandler
-
makeShardRequest
protected void makeShardRequest(ShardRequest sreq, String shard, org.apache.solr.common.params.ModifiableSolrParams params, org.apache.solr.client.solrj.impl.LBSolrClient.Req lbReq, HttpShardHandler.SimpleSolrResponse ssr, ShardResponse srsp, long startTimeNS)
Description copied from class:HttpShardHandlerDo the actual work of sending a request to a shard and receiving the response- Overrides:
makeShardRequestin classHttpShardHandler- Parameters:
sreq- the request to makeshard- the shard to addressparams- request parameterslbReq- the load balanced request suitable for LBHttp2SolrClientssr- the response collector part 1srsp- the shard response collectorstartTimeNS- the time at which the request was initiated, likely just prior to calling this method.
-
cancelAll
public void cancelAll()
Description copied from class:ShardHandlerCancels all uncompleted requests managed by this instance- Overrides:
cancelAllin classHttpShardHandler
-
-