"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java" between
solr-8.4.0-src.tgz and solr-8.4.1-src.tgz

About: Solr is the search platform from the Apache Lucene project. Its major features include full-text search, hit highlighting, faceted search, caching, replication, and a web admin interface.

Http2SolrClient.java  (solr-8.4.0-src.tgz):Http2SolrClient.java  (solr-8.4.1-src.tgz)
skipping to change at line 102 skipping to change at line 102
import org.eclipse.jetty.http2.client.http.HttpClientTransportOverHTTP2; import org.eclipse.jetty.http2.client.http.HttpClientTransportOverHTTP2;
import org.eclipse.jetty.util.BlockingArrayQueue; import org.eclipse.jetty.util.BlockingArrayQueue;
import org.eclipse.jetty.util.Fields; import org.eclipse.jetty.util.Fields;
import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import static org.apache.solr.client.solrj.impl.BaseHttpSolrClient.*; import static org.apache.solr.client.solrj.impl.BaseHttpSolrClient.*;
import static org.apache.solr.common.util.Utils.getObjectByPath; import static org.apache.solr.common.util.Utils.getObjectByPath;
// TODO: error handling, small Http2SolrClient features, security, ssl
/** /**
* Difference between this {@link Http2SolrClient} and {@link HttpSolrClient}: * Difference between this {@link Http2SolrClient} and {@link HttpSolrClient}:
* <ul> * <ul>
* <li>{@link Http2SolrClient} sends requests in HTTP/2</li> * <li>{@link Http2SolrClient} sends requests in HTTP/2</li>
* <li>{@link Http2SolrClient} can point to multiple urls</li> * <li>{@link Http2SolrClient} can point to multiple urls</li>
* <li>{@link Http2SolrClient} does not expose its internal httpClient like {@l ink HttpSolrClient#getHttpClient()}, * <li>{@link Http2SolrClient} does not expose its internal httpClient like {@l ink HttpSolrClient#getHttpClient()},
* sharing connection pools should be done by {@link Http2SolrClient.Builder#wit hHttpClient(Http2SolrClient)} </li> * sharing connection pools should be done by {@link Http2SolrClient.Builder#wit hHttpClient(Http2SolrClient)} </li>
* </ul> * </ul>
* @lucene.experimental * @lucene.experimental
*/ */
skipping to change at line 183 skipping to change at line 182
return httpClient.getProtocolHandlers(); return httpClient.getProtocolHandlers();
} }
private HttpClient createHttpClient(Builder builder) { private HttpClient createHttpClient(Builder builder) {
HttpClient httpClient; HttpClient httpClient;
BlockingArrayQueue<Runnable> queue = new BlockingArrayQueue<>(256, 256); BlockingArrayQueue<Runnable> queue = new BlockingArrayQueue<>(256, 256);
ThreadPoolExecutor httpClientExecutor = new ExecutorUtil.MDCAwareThreadPoolE xecutor(32, ThreadPoolExecutor httpClientExecutor = new ExecutorUtil.MDCAwareThreadPoolE xecutor(32,
256, 60, TimeUnit.SECONDS, queue, new SolrjNamedThreadFactory("h2sc")); 256, 60, TimeUnit.SECONDS, queue, new SolrjNamedThreadFactory("h2sc"));
SslContextFactory sslContextFactory; SslContextFactory.Client sslContextFactory;
boolean ssl; boolean ssl;
if (builder.sslConfig == null) { if (builder.sslConfig == null) {
sslContextFactory = getDefaultSslContextFactory(); sslContextFactory = getDefaultSslContextFactory();
ssl = sslContextFactory.getTrustStore() != null || sslContextFactory.getTr ustStorePath() != null; ssl = sslContextFactory.getTrustStore() != null || sslContextFactory.getTr ustStorePath() != null;
} else { } else {
sslContextFactory = builder.sslConfig.createContextFactory(); sslContextFactory = builder.sslConfig.createClientContextFactory();
ssl = true; ssl = true;
} }
boolean sslOnJava8OrLower = ssl && !Constants.JRE_IS_MINIMUM_JAVA9; boolean sslOnJava8OrLower = ssl && !Constants.JRE_IS_MINIMUM_JAVA9;
HttpClientTransport transport; HttpClientTransport transport;
if (builder.useHttp1_1 || sslOnJava8OrLower) { if (builder.useHttp1_1 || sslOnJava8OrLower) {
if (sslOnJava8OrLower && !builder.useHttp1_1) { if (sslOnJava8OrLower && !builder.useHttp1_1) {
log.warn("Create Http2SolrClient with HTTP/1.1 transport since Java 8 or lower versions does not support SSL + HTTP/2"); log.warn("Create Http2SolrClient with HTTP/1.1 transport since Java 8 or lower versions does not support SSL + HTTP/2");
} else { } else {
log.debug("Create Http2SolrClient with HTTP/1.1 transport"); log.debug("Create Http2SolrClient with HTTP/1.1 transport");
skipping to change at line 871 skipping to change at line 870
public Builder useHttp1_1(boolean useHttp1_1) { public Builder useHttp1_1(boolean useHttp1_1) {
this.useHttp1_1 = useHttp1_1; this.useHttp1_1 = useHttp1_1;
return this; return this;
} }
public Builder connectionTimeout(int connectionTimeOut) { public Builder connectionTimeout(int connectionTimeOut) {
this.connectionTimeout = connectionTimeOut; this.connectionTimeout = connectionTimeOut;
return this; return this;
} }
} }
public Set<String> getQueryParams() { public Set<String> getQueryParams() {
return queryParams; return queryParams;
} }
/** /**
* Expert Method * Expert Method
* *
* @param queryParams set of param keys to only send via the query string * @param queryParams set of param keys to only send via the query string
skipping to change at line 924 skipping to change at line 922
public static void setDefaultSSLConfig(SSLConfig sslConfig) { public static void setDefaultSSLConfig(SSLConfig sslConfig) {
Http2SolrClient.defaultSSLConfig = sslConfig; Http2SolrClient.defaultSSLConfig = sslConfig;
} }
// public for testing, only used by tests // public for testing, only used by tests
public static void resetSslContextFactory() { public static void resetSslContextFactory() {
Http2SolrClient.defaultSSLConfig = null; Http2SolrClient.defaultSSLConfig = null;
} }
private static SslContextFactory getDefaultSslContextFactory() { /* package-private for testing */
static SslContextFactory.Client getDefaultSslContextFactory() {
String checkPeerNameStr = System.getProperty(HttpClientUtil.SYS_PROP_CHECK_P EER_NAME); String checkPeerNameStr = System.getProperty(HttpClientUtil.SYS_PROP_CHECK_P EER_NAME);
boolean sslCheckPeerName = true; boolean sslCheckPeerName = true;
if (checkPeerNameStr == null || "false".equalsIgnoreCase(checkPeerNameStr)) { if (checkPeerNameStr == null || "false".equalsIgnoreCase(checkPeerNameStr)) {
sslCheckPeerName = false; sslCheckPeerName = false;
} }
SslContextFactory.Client sslContextFactory = new SslContextFactory.Client(!s slCheckPeerName); SslContextFactory.Client sslContextFactory = new SslContextFactory.Client(!s slCheckPeerName);
if (null != System.getProperty("javax.net.ssl.keyStore")) { if (null != System.getProperty("javax.net.ssl.keyStore")) {
sslContextFactory.setKeyStorePath sslContextFactory.setKeyStorePath
skipping to change at line 950 skipping to change at line 949
} }
if (null != System.getProperty("javax.net.ssl.trustStore")) { if (null != System.getProperty("javax.net.ssl.trustStore")) {
sslContextFactory.setTrustStorePath sslContextFactory.setTrustStorePath
(System.getProperty("javax.net.ssl.trustStore")); (System.getProperty("javax.net.ssl.trustStore"));
} }
if (null != System.getProperty("javax.net.ssl.trustStorePassword")) { if (null != System.getProperty("javax.net.ssl.trustStorePassword")) {
sslContextFactory.setTrustStorePassword sslContextFactory.setTrustStorePassword
(System.getProperty("javax.net.ssl.trustStorePassword")); (System.getProperty("javax.net.ssl.trustStorePassword"));
} }
sslContextFactory.setEndpointIdentificationAlgorithm(System.getProperty("sol
r.jetty.ssl.verifyClientHostName"));
return sslContextFactory; return sslContextFactory;
} }
} }
 End of changes. 7 change blocks. 
6 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)