mirror of https://github.com/apache/lucene.git
SOLR-14206: Annotate HttpSolrCall as thread-safe (#1203)
* SOLR-14206: Annotate HttpSolrCall and V2HttpCall as thread-safe
This commit is contained in:
parent
60a2926546
commit
3c0146196a
|
@ -38,6 +38,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
|
||||
import org.apache.solr.client.solrj.SolrRequest;
|
||||
import org.apache.solr.common.SolrException;
|
||||
import org.apache.solr.common.annotation.SolrThreadSafe;
|
||||
import org.apache.solr.common.cloud.DocCollection;
|
||||
import org.apache.solr.common.cloud.ZkStateReader;
|
||||
import org.apache.solr.common.params.CommonParams;
|
||||
|
@ -62,6 +63,7 @@ import org.slf4j.LoggerFactory;
|
|||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
// class that handle the '/v2' path
|
||||
@SolrThreadSafe
|
||||
public class V2HttpCall extends HttpSolrCall {
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
private Api api;
|
||||
|
|
|
@ -60,6 +60,7 @@ import org.apache.solr.client.solrj.impl.CloudSolrClient;
|
|||
import org.apache.solr.client.solrj.impl.HttpClientUtil;
|
||||
import org.apache.solr.common.SolrException;
|
||||
import org.apache.solr.common.SolrException.ErrorCode;
|
||||
import org.apache.solr.common.annotation.SolrThreadSafe;
|
||||
import org.apache.solr.common.cloud.Aliases;
|
||||
import org.apache.solr.common.cloud.ClusterState;
|
||||
import org.apache.solr.common.cloud.DocCollection;
|
||||
|
@ -134,6 +135,7 @@ import static org.apache.solr.servlet.SolrDispatchFilter.Action.RETURN;
|
|||
/**
|
||||
* This class represents a call made to Solr
|
||||
**/
|
||||
@SolrThreadSafe
|
||||
public class HttpSolrCall {
|
||||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
|
||||
|
@ -414,14 +416,12 @@ public class HttpSolrCall {
|
|||
if (path.equals(req.getServletPath())) {
|
||||
// avoid endless loop - pass through to Restlet via webapp
|
||||
action = PASSTHROUGH;
|
||||
SolrRequestInfo.getRequestInfo().setAction(action);
|
||||
return;
|
||||
} else {
|
||||
// forward rewritten URI (without path prefix and core/collection name) to Restlet
|
||||
action = FORWARD;
|
||||
SolrRequestInfo.getRequestInfo().setAction(action);
|
||||
return;
|
||||
}
|
||||
SolrRequestInfo.getRequestInfo().setAction(action);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1123,7 +1123,7 @@ public class HttpSolrCall {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Enumeration getHeaderNames() {
|
||||
public Enumeration<String> getHeaderNames() {
|
||||
return getReq().getHeaderNames();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue