Skip to content

Commit 77921ba

Browse files
authored
SOLR-15223 Deprecate HttpSolrClient and friends in 9.0 (#732)
1 parent a8ae853 commit 77921ba

17 files changed

+67
-5
lines changed

solr/CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,8 @@ and each individual module's jar will be included in its directory's lib/ folder
637637

638638
* SOLR-16039: Upgrade to Hadoop 3.3.2 (Kevin Risden)
639639

640+
* SOLR-15223: Deprecate HttpSolrClient and friends, please use the Http2SolrClient equivalents (janhoy, David Smiley)
641+
640642
Bug Fixes
641643
---------------------
642644
* SOLR-15849: Fix the connection reset problem caused by the incorrect use of 4LW with \n when monitoring zooKeeper status (Fa Ming).

solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636
* SolrJ client class to communicate with SolrCloud. Instances of this class communicate with
3737
* Zookeeper to discover Solr endpoints for SolrCloud collections, and then use the {@link
3838
* LBHttpSolrClient} to issue requests.
39+
*
40+
* @deprecated Please use {@link CloudHttp2SolrClient}
3941
*/
42+
@Deprecated(since = "9.0")
4043
public class CloudSolrClient extends BaseCloudSolrClient {
4144

4245
private final ClusterStateProvider stateProvider;

solr/solrj/src/java/org/apache/solr/client/solrj/impl/ClusterStateProvider.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.apache.solr.common.cloud.DocCollection;
2626
import org.apache.solr.common.params.CollectionAdminParams;
2727

28+
/** Provides cluster state from some source */
2829
public interface ClusterStateProvider extends SolrCloseable {
2930

3031
/**

solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@
6969
* <p>Although any SolrClient request can be made with this implementation, it is only recommended
7070
* to use ConcurrentUpdateSolrClient with /update requests. The class {@link HttpSolrClient} is
7171
* better suited for the query interface.
72+
*
73+
* @deprecated Please use {@link ConcurrentUpdateHttp2SolrClient}
7274
*/
75+
@Deprecated(since = "9.0")
7376
public class ConcurrentUpdateSolrClient extends SolrClient {
7477
private static final long serialVersionUID = 1L;
7578
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@
7070
* <p>This class can touch internal HttpClient details and is subject to change.
7171
*
7272
* @lucene.experimental
73+
* @deprecated Used to configure the Apache HTTP client. Please use The Http2 client
7374
*/
75+
@Deprecated(since = "9.0")
7476
public class HttpClientUtil {
7577

7678
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClusterStateProvider.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@
2121
import org.apache.http.client.HttpClient;
2222
import org.apache.solr.client.solrj.SolrClient;
2323

24-
/** Retrieves cluster state via Solr HTTP APIs */
24+
/**
25+
* Retrieves cluster state via Solr HTTP APIs
26+
*
27+
* @deprecated Please use {@link Http2ClusterStateProvider}
28+
*/
29+
@Deprecated(since = "9.0")
2530
public class HttpClusterStateProvider extends BaseHttpClusterStateProvider {
2631

2732
private final HttpClient httpClient;

solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@
9090
import org.slf4j.LoggerFactory;
9191
import org.slf4j.MDC;
9292

93-
/** A SolrClient implementation that talks directly to a Solr server via HTTP */
93+
/**
94+
* A SolrClient implementation that talks directly to a Solr server via Apache HTTP client
95+
*
96+
* @deprecated Please use {@link Http2SolrClient}
97+
*/
98+
@Deprecated(since = "9.0")
9499
public class HttpSolrClient extends BaseHttpSolrClient {
95100

96101
private static final Charset FALLBACK_CHARSET = StandardCharsets.UTF_8;
@@ -858,7 +863,12 @@ public void setUseMultiPartPost(boolean useMultiPartPost) {
858863
this.useMultiPartPost = useMultiPartPost;
859864
}
860865

861-
/** Constructs {@link HttpSolrClient} instances from provided configuration. */
866+
/**
867+
* Constructs {@link HttpSolrClient} instances from provided configuration.
868+
*
869+
* @deprecated Please use {@link Http2SolrClient}
870+
*/
871+
@Deprecated(since = "9.0")
862872
public static class Builder extends SolrClientBuilder<Builder> {
863873
protected String baseSolrUrl;
864874
protected boolean compression;

solr/solrj/src/java/org/apache/solr/client/solrj/impl/Krb5HttpClientBuilder.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@
4747
import org.slf4j.Logger;
4848
import org.slf4j.LoggerFactory;
4949

50-
/** Kerberos-enabled SolrHttpClientBuilder */
50+
/**
51+
* Kerberos-enabled SolrHttpClientBuilder
52+
*
53+
* @deprecated Please consider alternatives involving the new Solr Http2Client
54+
*/
55+
@Deprecated(since = "9.0")
5156
public class Krb5HttpClientBuilder implements HttpClientBuilderFactory {
5257

5358
public static final String LOGIN_CONFIG_PROP = "java.security.auth.login.config";

solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@
6767
* href="http://en.wikipedia.org/wiki/Load_balancing_(computing)">Load balancing on Wikipedia</a>
6868
*
6969
* @since solr 1.4
70+
* @deprecated Please use {@link LBHttp2SolrClient}
7071
*/
72+
@Deprecated(since = "9.0")
7173
public class LBHttpSolrClient extends LBSolrClient {
7274

7375
private final HttpClient httpClient;

solr/solrj/src/java/org/apache/solr/client/solrj/impl/PreemptiveAuth.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@
3434
* This implementation is required since Solr client is not capable of performing non preemptive
3535
* authentication. By adding the Http authentication credentials to every request, this interceptor
3636
* enables "preemptive" authentication.
37+
*
38+
* @deprecated Please look into using Solr's new Http2 clients
3739
*/
40+
@Deprecated(since = "9.0")
3841
public class PreemptiveAuth implements HttpRequestInterceptor {
3942
private AuthScheme authScheme = null;
4043

solr/solrj/src/java/org/apache/solr/client/solrj/impl/PreemptiveBasicAuthClientBuilderFactory.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343
/**
4444
* HttpClientConfigurer implementation providing support for preemptive Http Basic authentication
4545
* scheme.
46+
*
47+
* @deprecated Please look into using Solr's new Http2 clients
4648
*/
49+
@Deprecated(since = "9.0")
4750
public class PreemptiveBasicAuthClientBuilderFactory implements HttpClientBuilderFactory {
4851
/**
4952
* A system property used to specify a properties file containing default parameters used for

solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientBuilder.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
import org.apache.solr.client.solrj.ResponseParser;
2121
import org.apache.solr.client.solrj.impl.HttpSolrClient.Builder;
2222

23+
/**
24+
* @deprecated Please look into using Solr's new Http2 clients
25+
*/
26+
@Deprecated(since = "9.0")
2327
public abstract class SolrClientBuilder<B extends SolrClientBuilder<B>> {
2428

2529
protected HttpClient httpClient;

solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpClientBuilder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
* implementation and is subject to change.
2727
*
2828
* @lucene.experimental
29+
* @deprecated Please look into using Solr's new Http2 clients
2930
*/
31+
@Deprecated(since = "9.0")
3032
public class SolrHttpClientBuilder {
3133
public static SolrHttpClientBuilder create() {
3234
return new SolrHttpClientBuilder();

solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpClientContextBuilder.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
import org.apache.http.config.Lookup;
2323
import org.apache.http.cookie.CookieSpecProvider;
2424

25+
/**
26+
* @deprecated Please look into using Solr's new Http2 clients
27+
*/
28+
@Deprecated(since = "9.0")
2529
public class SolrHttpClientContextBuilder {
2630
public static SolrHttpClientContextBuilder create() {
2731
return new SolrHttpClientContextBuilder();

solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpRequestRetryHandler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
import org.slf4j.Logger;
3737
import org.slf4j.LoggerFactory;
3838

39+
/**
40+
* @deprecated Please look into using Solr's new Http2 clients
41+
*/
42+
@Deprecated(since = "9.0")
3943
public class SolrHttpRequestRetryHandler implements HttpRequestRetryHandler {
4044

4145
private static final String GET = "GET";

solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@
3333
import org.slf4j.Logger;
3434
import org.slf4j.LoggerFactory;
3535

36-
/** The SolrClientCache caches SolrClients so they can be reused by different TupleStreams. */
36+
/**
37+
* The SolrClientCache caches SolrClients so they can be reused by different TupleStreams.
38+
*
39+
* <p>TODO: Cut this over to using Solr's new Http2 clients
40+
*/
3741
public class SolrClientCache implements Serializable {
3842

3943
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@@ -54,10 +58,12 @@ public SolrClientCache() {
5458
httpClient = null;
5559
}
5660

61+
@Deprecated(since = "9.0")
5762
public SolrClientCache(HttpClient httpClient) {
5863
this.httpClient = httpClient;
5964
}
6065

66+
@Deprecated(since = "9.0")
6167
public synchronized CloudSolrClient getCloudSolrClient(String zkHost) {
6268

6369
// Timeouts should never be lower then 60000 but they can be set higher
@@ -92,6 +98,7 @@ public synchronized CloudSolrClient getCloudSolrClient(String zkHost) {
9298
return client;
9399
}
94100

101+
@Deprecated(since = "9.0")
95102
public synchronized HttpSolrClient getHttpSolrClient(String host) {
96103
HttpSolrClient client;
97104
if (solrClients.containsKey(host)) {

solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
/**
4747
* Queries a single Solr instance and maps SolrDocs to a Stream of Tuples.
4848
*
49+
* <p>TODO: Move this to Http2SolrClient
50+
*
4951
* @since 5.1.0
5052
*/
5153
public class SolrStream extends TupleStream {

0 commit comments

Comments
 (0)