Apache Solr open-source search software
SOLR-15223 Deprecate HttpSolrClient and friends in 9.0 (#732)
Jan Høydahl77921bab52f5
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 490be4efcf7..09f56031abb 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -637,6 +637,8 @@ and each individual module's jar will be included in its directory's lib/ folder* SOLR-16039: Upgrade to Hadoop 3.3.2 (Kevin Risden)+* SOLR-15223: Deprecate HttpSolrClient and friends, please use the Http2SolrClient equivalents (janhoy, David Smiley)+Bug Fixes---------------------* SOLR-15849: Fix the connection reset problem caused by the incorrect use of 4LW with \n when monitoring zooKeeper status (Fa Ming).diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.javaindex 98ebb9024ec..54b2c6d0e31 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java@@ -36,7 +36,10 @@ import org.apache.solr.common.util.NamedList;* SolrJ client class to communicate with SolrCloud. Instances of this class communicate with* Zookeeper to discover Solr endpoints for SolrCloud collections, and then use the {@link* LBHttpSolrClient} to issue requests.+ *+ * @deprecated Please use {@link CloudHttp2SolrClient}*/+@Deprecated(since = "9.0")public class CloudSolrClient extends BaseCloudSolrClient {private final ClusterStateProvider stateProvider;diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ClusterStateProvider.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ClusterStateProvider.javaindex f858ef8cbae..6f6fb04779c 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ClusterStateProvider.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ClusterStateProvider.java@@ -25,6 +25,7 @@ import org.apache.solr.common.cloud.ClusterState;import org.apache.solr.common.cloud.DocCollection;import org.apache.solr.common.params.CollectionAdminParams;+/** Provides cluster state from some source */public interface ClusterStateProvider extends SolrCloseable {/**diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.javaindex 112f80a232e..953c5194c36 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java@@ -69,7 +69,10 @@ import org.slf4j.MDC;* <p>Although any SolrClient request can be made with this implementation, it is only recommended* to use ConcurrentUpdateSolrClient with /update requests. The class {@link HttpSolrClient} is* better suited for the query interface.+ *+ * @deprecated Please use {@link ConcurrentUpdateHttp2SolrClient}*/+@Deprecated(since = "9.0")public class ConcurrentUpdateSolrClient extends SolrClient {private static final long serialVersionUID = 1L;private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.javaindex 8fd1e8f16a8..90fc938901a 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java@@ -70,7 +70,9 @@ import org.slf4j.LoggerFactory;* <p>This class can touch internal HttpClient details and is subject to change.** @lucene.experimental+ * @deprecated Used to configure the Apache HTTP client. Please use The Http2 client*/+@Deprecated(since = "9.0")public class HttpClientUtil {private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClusterStateProvider.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClusterStateProvider.javaindex f2eafc4d725..56c6b08c7d9 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClusterStateProvider.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClusterStateProvider.java@@ -21,7 +21,12 @@ import java.util.List;import org.apache.http.client.HttpClient;import org.apache.solr.client.solrj.SolrClient;-/** Retrieves cluster state via Solr HTTP APIs */+/**+ * Retrieves cluster state via Solr HTTP APIs+ *+ * @deprecated Please use {@link Http2ClusterStateProvider}+ */+@Deprecated(since = "9.0")public class HttpClusterStateProvider extends BaseHttpClusterStateProvider {private final HttpClient httpClient;diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.javaindex 86b56fb6b22..3085e2a077c 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java@@ -90,7 +90,12 @@ import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.slf4j.MDC;-/** A SolrClient implementation that talks directly to a Solr server via HTTP */+/**+ * A SolrClient implementation that talks directly to a Solr server via Apache HTTP client+ *+ * @deprecated Please use {@link Http2SolrClient}+ */+@Deprecated(since = "9.0")public class HttpSolrClient extends BaseHttpSolrClient {private static final Charset FALLBACK_CHARSET = StandardCharsets.UTF_8;@@ -858,7 +863,12 @@ public class HttpSolrClient extends BaseHttpSolrClient {this.useMultiPartPost = useMultiPartPost;}- /** Constructs {@link HttpSolrClient} instances from provided configuration. */+ /**+ * Constructs {@link HttpSolrClient} instances from provided configuration.+ *+ * @deprecated Please use {@link Http2SolrClient}+ */+ @Deprecated(since = "9.0")public static class Builder extends SolrClientBuilder<Builder> {protected String baseSolrUrl;protected boolean compression;diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Krb5HttpClientBuilder.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Krb5HttpClientBuilder.javaindex e228477ec5d..d39f26c2058 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Krb5HttpClientBuilder.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Krb5HttpClientBuilder.java@@ -47,7 +47,12 @@ import org.eclipse.jetty.client.util.SPNEGOAuthentication;import org.slf4j.Logger;import org.slf4j.LoggerFactory;-/** Kerberos-enabled SolrHttpClientBuilder */+/**+ * Kerberos-enabled SolrHttpClientBuilder+ *+ * @deprecated Please consider alternatives involving the new Solr Http2Client+ */+@Deprecated(since = "9.0")public class Krb5HttpClientBuilder implements HttpClientBuilderFactory {public static final String LOGIN_CONFIG_PROP = "java.security.auth.login.config";diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.javaindex 6710f440dcf..f299c5acc29 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java@@ -67,7 +67,9 @@ import org.apache.solr.common.params.ModifiableSolrParams;* href="http://en.wikipedia.org/wiki/Load_balancing_(computing)">Load balancing on Wikipedia</a>** @since solr 1.4+ * @deprecated Please use {@link LBHttp2SolrClient}*/+@Deprecated(since = "9.0")public class LBHttpSolrClient extends LBSolrClient {private final HttpClient httpClient;diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/PreemptiveAuth.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/PreemptiveAuth.javaindex f47cd6fcda7..2b8c0477d58 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/PreemptiveAuth.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/PreemptiveAuth.java@@ -34,7 +34,10 @@ import org.apache.http.protocol.HttpContext;* This implementation is required since Solr client is not capable of performing non preemptive* authentication. By adding the Http authentication credentials to every request, this interceptor* enables "preemptive" authentication.+ *+ * @deprecated Please look into using Solr's new Http2 clients*/+@Deprecated(since = "9.0")public class PreemptiveAuth implements HttpRequestInterceptor {private AuthScheme authScheme = null;diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/PreemptiveBasicAuthClientBuilderFactory.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/PreemptiveBasicAuthClientBuilderFactory.javaindex 329d1ce1ece..fb323514b0e 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/PreemptiveBasicAuthClientBuilderFactory.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/PreemptiveBasicAuthClientBuilderFactory.java@@ -43,7 +43,10 @@ import org.eclipse.jetty.client.WWWAuthenticationProtocolHandler;/*** HttpClientConfigurer implementation providing support for preemptive Http Basic authentication* scheme.+ *+ * @deprecated Please look into using Solr's new Http2 clients*/+@Deprecated(since = "9.0")public class PreemptiveBasicAuthClientBuilderFactory implements HttpClientBuilderFactory {/*** A system property used to specify a properties file containing default parameters used fordiff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientBuilder.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientBuilder.javaindex 3a0ce26bbd4..8a9ec986d8b 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientBuilder.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientBuilder.java@@ -20,6 +20,10 @@ import org.apache.http.client.HttpClient;import org.apache.solr.client.solrj.ResponseParser;import org.apache.solr.client.solrj.impl.HttpSolrClient.Builder;+/**+ * @deprecated Please look into using Solr's new Http2 clients+ */+@Deprecated(since = "9.0")public abstract class SolrClientBuilder<B extends SolrClientBuilder<B>> {protected HttpClient httpClient;diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpClientBuilder.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpClientBuilder.javaindex 66ae783df82..82bfc21c2d0 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpClientBuilder.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpClientBuilder.java@@ -26,7 +26,9 @@ import org.apache.http.cookie.CookieSpecProvider;* implementation and is subject to change.** @lucene.experimental+ * @deprecated Please look into using Solr's new Http2 clients*/+@Deprecated(since = "9.0")public class SolrHttpClientBuilder {public static SolrHttpClientBuilder create() {return new SolrHttpClientBuilder();diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpClientContextBuilder.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpClientContextBuilder.javaindex 9c55b912681..19088135180 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpClientContextBuilder.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpClientContextBuilder.java@@ -22,6 +22,10 @@ import org.apache.http.client.protocol.HttpClientContext;import org.apache.http.config.Lookup;import org.apache.http.cookie.CookieSpecProvider;+/**+ * @deprecated Please look into using Solr's new Http2 clients+ */+@Deprecated(since = "9.0")public class SolrHttpClientContextBuilder {public static SolrHttpClientContextBuilder create() {return new SolrHttpClientContextBuilder();diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpRequestRetryHandler.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpRequestRetryHandler.javaindex 0d50b4b5d4d..4ec079a10d5 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpRequestRetryHandler.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrHttpRequestRetryHandler.java@@ -36,6 +36,10 @@ import org.apache.http.protocol.HttpContext;import org.slf4j.Logger;import org.slf4j.LoggerFactory;+/**+ * @deprecated Please look into using Solr's new Http2 clients+ */+@Deprecated(since = "9.0")public class SolrHttpRequestRetryHandler implements HttpRequestRetryHandler {private static final String GET = "GET";diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.javaindex 24d39dc0db2..28d0d36288a 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java@@ -33,7 +33,11 @@ import org.apache.solr.client.solrj.impl.HttpSolrClient;import org.slf4j.Logger;import org.slf4j.LoggerFactory;-/** The SolrClientCache caches SolrClients so they can be reused by different TupleStreams. */+/**+ * The SolrClientCache caches SolrClients so they can be reused by different TupleStreams.+ *+ * <p>TODO: Cut this over to using Solr's new Http2 clients+ */public class SolrClientCache implements Serializable {private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());@@ -54,10 +58,12 @@ public class SolrClientCache implements Serializable {httpClient = null;}+ @Deprecated(since = "9.0")public SolrClientCache(HttpClient httpClient) {this.httpClient = httpClient;}+ @Deprecated(since = "9.0")public synchronized CloudSolrClient getCloudSolrClient(String zkHost) {// Timeouts should never be lower then 60000 but they can be set higher@@ -92,6 +98,7 @@ public class SolrClientCache implements Serializable {return client;}+ @Deprecated(since = "9.0")public synchronized HttpSolrClient getHttpSolrClient(String host) {HttpSolrClient client;if (solrClients.containsKey(host)) {diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.javaindex a41b5b1b4fa..91183396fdb 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SolrStream.java@@ -46,6 +46,8 @@ import org.apache.solr.common.util.NamedList;/*** Queries a single Solr instance and maps SolrDocs to a Stream of Tuples.*+ * <p>TODO: Move this to Http2SolrClient+ ** @since 5.1.0*/public class SolrStream extends TupleStream {