You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by da...@apache.org on 2018/10/08 07:07:41 UTC

[2/2] lucene-solr:jira/http2: Update ref-guide for solrj

Update ref-guide for solrj


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/460d38f6
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/460d38f6
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/460d38f6

Branch: refs/heads/jira/http2
Commit: 460d38f6debcfc0a69898cfbe5a074d916863a6d
Parents: f063934
Author: Cao Manh Dat <da...@apache.org>
Authored: Mon Oct 8 14:04:49 2018 +0700
Committer: Cao Manh Dat <da...@apache.org>
Committed: Mon Oct 8 14:04:49 2018 +0700

----------------------------------------------------------------------
 solr/solr-ref-guide/src/major-changes-in-solr-8.adoc | 11 ++++-------
 solr/solr-ref-guide/src/using-solrj.adoc             |  9 ++++++++-
 2 files changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/460d38f6/solr/solr-ref-guide/src/major-changes-in-solr-8.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/major-changes-in-solr-8.adoc b/solr/solr-ref-guide/src/major-changes-in-solr-8.adoc
index 09e5db4..c8b6262 100644
--- a/solr/solr-ref-guide/src/major-changes-in-solr-8.adoc
+++ b/solr/solr-ref-guide/src/major-changes-in-solr-8.adoc
@@ -47,19 +47,16 @@ multiple requests can be sent in parallel using a same TCP connection.
 
 {solr-javadocs}/solr-solrj/org/apache/solr/client/solrj/impl/Http2SolrClient.html[`Http2SolrClient`]
 with HTTP/2 and async capabilities based on Jetty Client is introduced. This client replaced
-{solr-javadocs}/solr-solrj/org/apache/solr/client/solrj/impl/HttpSolrClient.html[`HttpSolrClient`] and
-{solr-javadocs}/solr-solrj/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.html[`ConcurrentUpdateSolrClient`]
-for sending most of internal requests (sent by
-{solr-javadocs}/solr-core/org/apache/solr/update/UpdateShardHandler.html[`UpdateShardHandler`],
-{solr-javadocs}/solr-core/org/apache/solr/handler/component/HttpShardHandler.html[`HttpShardHandler`]).
-An interesting benchmark result showing gain of using {solr-javadocs}/solr-solrj/org/apache/solr/client/solrj/impl/Http2SolrClient.html[`Http2SolrClient`] had been posted
+`HttpSolrClient`] and `ConcurrentUpdateSolrClient` for sending most of internal requests (sent by
+`UpdateShardHandler`, `HttpShardHandler`).
+An interesting benchmark result showing gain of using `Http2SolrClient` had been posted
 https://issues.apache.org/jira/browse/SOLR-12642?focusedCommentId=16606648&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-16606648[here].
 However this leads to several changes in configuration and authentication setup
 
 * {solr-javadocs}/solr-core/org/apache/solr/update/UpdateShardHandler.html[`UpdateShardHandler.maxConnections`] parameter is no longer being used
 * {solr-javadocs}/solr-core/org/apache/solr/handler/component/HttpShardHandler.html[`HttpShardHandlerFactory.maxConnections`] parameter is no longer being used
 *  Custom {solr-javadocs}/solr-core/org/apache/solr/security/AuthenticationPlugin.html[`AuthenticationPlugin`] must provide its own setup for
-   {solr-javadocs}/solr-solrj/org/apache/solr/client/solrj/impl/Http2SolrClient.html[`Http2SolrClient`] through
+   `Http2SolrClient` through
    {solr-javadocs}/solr-solrj/org/apache/solr/client/solrj/impl/SolrHttpClientBuilder.html[`SolrHttpClientBuilder.setHttp2Configurator`],
    if not internal requests can't be authenticated
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/460d38f6/solr/solr-ref-guide/src/using-solrj.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/using-solrj.adoc b/solr/solr-ref-guide/src/using-solrj.adoc
index 822b0d0..3d136c8 100644
--- a/solr/solr-ref-guide/src/using-solrj.adoc
+++ b/solr/solr-ref-guide/src/using-solrj.adoc
@@ -86,7 +86,9 @@ Requests are sent in the form of {solr-javadocs}/solr-solrj/org/apache/solr/clie
 `SolrClient` has a few concrete implementations, each geared towards a different usage-pattern or resiliency model:
 
 - {solr-javadocs}/solr-solrj/org/apache/solr/client/solrj/impl/HttpSolrClient.html[`HttpSolrClient`] - geared towards query-centric workloads, though also a good general-purpose client.  Communicates directly with a single Solr node.
+- {solr-javadocs}/solr-solrj/org/apache/solr/client/solrj/impl/Http2SolrClient.html[`Http2SolrClient`] - async, non-blocking and general-purpose client that leverage HTTP/2. This class is experimental therefore its API's might change or be removed in minor versions of SolrJ.
 - {solr-javadocs}/solr-solrj/org/apache/solr/client/solrj/impl/LBHttpSolrClient.html[`LBHttpSolrClient`] - balances request load across a list of Solr nodes. Adjusts the list of "in-service" nodes based on node health.
+- {solr-javadocs}/solr-solrj/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.html[`LBHttp2SolrClient`] - just like `LBHttpSolrClient` but using `Http2SolrClient` instead. This class is experimental therefore its API's might change or be removed in minor versions of SolrJ.
 - {solr-javadocs}/solr-solrj/org/apache/solr/client/solrj/impl/CloudSolrClient.html[`CloudSolrClient`] - geared towards communicating with SolrCloud deployments. Uses already-recorded ZooKeeper state to discover and route requests to healthy Solr nodes.
 - {solr-javadocs}/solr-solrj/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.html[`ConcurrentUpdateSolrClient`] - geared towards indexing-centric workloads.  Buffers documents internally before sending larger batches to Solr.
 
@@ -95,13 +97,18 @@ Requests are sent in the form of {solr-javadocs}/solr-solrj/org/apache/solr/clie
 Most SolrJ configuration happens at the `SolrClient` level.  The most common/important of these are discussed below.  For comprehensive information on how to tweak your `SolrClient`, see the Javadocs for the involved client, and its corresponding builder object.
 
 ==== Base URLs
-Most `SolrClient` implementations (with the notable exception of `CloudSolrClient`) require users to specify one or more Solr base URLs, which the client then uses to send HTTP requests to Solr.  The path users include on the base URL they provide has an effect on the behavior of the created client from that point on.
+Most `SolrClient` implementations (except for `CloudSolrClient` and `Http2SolrClient`) require users to specify one or more Solr base URLs, which the client then uses to send HTTP requests to Solr.  The path users include on the base URL they provide has an effect on the behavior of the created client from that point on.
 
 . A URL with a path pointing to a specific core or collection (e.g., `\http://hostname:8983/solr/core1`).  When a core or collection is specified in the base URL, subsequent requests made with that client are not required to re-specify the affected collection.  However, the client is limited to sending requests to  that core/collection, and can not send requests to any others.
 . A URL pointing to the root Solr path (e.g., `\http://hostname:8983/solr`).  When no core or collection is specified in the base URL, requests can be made to any core/collection, but the affected core/collection must be specified on all requests.
 
 Generally speaking, if your `SolrClient` will only be used on a single core/collection, including that entity in the path is the most convenient.  Where more flexibility is required, the collection/core should be excluded.
 
+==== Base URLs of Http2SolrClient
+Since `Http2SolrClient` can manages connections to different nodes efficiently. `Http2SolrClient`
+does not require a `baseUrl`. In case of `baseUrl` is not provided, `SolrRequest.basePath` must be set, so
+`Http2SolrClient` can know which node it will request to. If not an `IllegalArgumentException` will be thrown.
+
 ==== Timeouts
 All `SolrClient` implementations allow users to specify the connection and read timeouts for communicating with Solr.  These are provided at client creation time, as in the example below: