public static class CloudSolrClient.Builder extends SolrClientBuilder<CloudSolrClient.Builder>
CloudSolrClient
instances from provided configuration.Modifier and Type | Field and Description |
---|---|
protected boolean |
directUpdatesToLeadersOnly |
protected LBHttpSolrClient.Builder |
lbClientBuilder |
protected LBHttpSolrClient |
loadBalancedSolrClient |
protected boolean |
parallelUpdates |
protected boolean |
shardLeadersOnly |
protected List<String> |
solrUrls |
protected ClusterStateProvider |
stateProvider |
protected String |
zkChroot |
protected Collection<String> |
zkHosts |
connectionTimeoutMillis, httpClient, responseParser, socketTimeoutMillis
Constructor and Description |
---|
Builder()
Deprecated.
use other constructors instead. This constructor will be changing visibility in an upcoming release.
|
Builder(List<String> solrUrls)
Provide a series of Solr URLs to be used when configuring
CloudSolrClient instances. |
Builder(List<String> zkHosts,
Optional<String> zkChroot)
Provide a series of ZK hosts which will be used when configuring
CloudSolrClient instances. |
Modifier and Type | Method and Description |
---|---|
CloudSolrClient |
build()
Create a
CloudSolrClient based on the provided configuration. |
CloudSolrClient.Builder |
getThis()
The solution for the unchecked cast warning.
|
CloudSolrClient.Builder |
sendDirectUpdatesToAnyShardReplica()
Tells
CloudSolrClient.Builder that created clients can send updates
to any shard replica (shard leaders and non-leaders). |
CloudSolrClient.Builder |
sendDirectUpdatesToShardLeadersOnly()
Tells
CloudSolrClient.Builder that created clients should send direct updates to shard leaders only. |
CloudSolrClient.Builder |
sendUpdatesOnlyToShardLeaders()
Tells
CloudSolrClient.Builder that created clients should send updates only to shard leaders. |
CloudSolrClient.Builder |
sendUpdatesToAllReplicasInShard()
Tells
CloudSolrClient.Builder that created clients should send updates to all replicas for a shard. |
CloudSolrClient.Builder |
withClusterStateProvider(ClusterStateProvider stateProvider)
Deprecated.
since this is an expert feature we don't want to expose this to regular users. To use this feature
extend CloudSolrClient.Builder and pass your custom ClusterStateProvider
|
CloudSolrClient.Builder |
withLBHttpSolrClient(LBHttpSolrClient loadBalancedSolrClient)
Provides a
LBHttpSolrClient for the builder to use when creating clients. |
CloudSolrClient.Builder |
withLBHttpSolrClientBuilder(LBHttpSolrClient.Builder lbHttpSolrClientBuilder)
Provides a
HttpClient for the builder to use when creating clients. |
CloudSolrClient.Builder |
withParallelUpdates(boolean parallelUpdates)
Should direct updates to shards be done in parallel (the default) or if not then synchronously?
|
CloudSolrClient.Builder |
withSolrUrl(Collection<String> solrUrls)
Deprecated.
use Solr URL constructors instead
|
CloudSolrClient.Builder |
withSolrUrl(String solrUrl)
Deprecated.
use Solr-URL constructor instead
|
CloudSolrClient.Builder |
withZkChroot(String zkChroot)
Deprecated.
use Zk-host constructor instead
|
CloudSolrClient.Builder |
withZkHost(Collection<String> zkHosts)
Deprecated.
use Zk-host constructor instead
|
CloudSolrClient.Builder |
withZkHost(String zkHost)
Deprecated.
use Zk-host constructor instead
|
withConnectionTimeout, withHttpClient, withResponseParser, withSocketTimeout
protected Collection<String> zkHosts
protected String zkChroot
protected LBHttpSolrClient loadBalancedSolrClient
protected LBHttpSolrClient.Builder lbClientBuilder
protected boolean shardLeadersOnly
protected boolean directUpdatesToLeadersOnly
protected boolean parallelUpdates
protected ClusterStateProvider stateProvider
@Deprecated public Builder()
public Builder(List<String> solrUrls)
CloudSolrClient
instances.
The solr client will use these urls to understand the cluster topology, which solr nodes are active etc.
Provided Solr URLs are expected to point to the root Solr path ("http://hostname:8983/solr"); it should not
include any collections, cores, or other path components.public Builder(List<String> zkHosts, Optional<String> zkChroot)
CloudSolrClient
instances.zkHosts
- a List of at least one ZooKeeper host and portzkChroot
- the path to the root ZooKeeper node containing Solr data. May be empty if Solr-data is located
at the ZooKeeper root@Deprecated public CloudSolrClient.Builder withZkHost(String zkHost)
CloudSolrClient
instances.
Method may be called multiple times. All provided values will be used.zkHost
- The client endpoint of the ZooKeeper quorum containing the cloud
state.@Deprecated public CloudSolrClient.Builder withSolrUrl(String solrUrl)
CloudSolrClient
instances.
Method may be called multiple times. One of the provided values will be used to fetch
the list of live Solr nodes that the underlying HttpClusterStateProvider
would be maintaining.
Provided Solr URL is expected to point to the root Solr path ("http://hostname:8983/solr"); it should not
include any collections, cores, or other path components.@Deprecated public CloudSolrClient.Builder withSolrUrl(Collection<String> solrUrls)
CloudSolrClient
instances.
One of the provided values will be used to fetch the list of live Solr
nodes that the underlying HttpClusterStateProvider
would be maintaining.
Provided Solr URLs are expected to point to the root Solr path ("http://hostname:8983/solr"); they should not
include any collections, cores, or other path components.public CloudSolrClient.Builder withLBHttpSolrClientBuilder(LBHttpSolrClient.Builder lbHttpSolrClientBuilder)
HttpClient
for the builder to use when creating clients.@Deprecated public CloudSolrClient.Builder withZkHost(Collection<String> zkHosts)
zkHosts
- A Java Collection (List, Set, etc) of HOST:PORT strings, one for
each host in the ZooKeeper ensemble. Note that with certain
Collection types like HashSet, the order of hosts in the final
connect string may not be in the same order you added them.@Deprecated public CloudSolrClient.Builder withZkChroot(String zkChroot)
public CloudSolrClient.Builder withLBHttpSolrClient(LBHttpSolrClient loadBalancedSolrClient)
LBHttpSolrClient
for the builder to use when creating clients.public CloudSolrClient.Builder sendUpdatesOnlyToShardLeaders()
CloudSolrClient.Builder
that created clients should send updates only to shard leaders.public CloudSolrClient.Builder sendUpdatesToAllReplicasInShard()
CloudSolrClient.Builder
that created clients should send updates to all replicas for a shard.public CloudSolrClient.Builder sendDirectUpdatesToShardLeadersOnly()
CloudSolrClient.Builder
that created clients should send direct updates to shard leaders only.public CloudSolrClient.Builder sendDirectUpdatesToAnyShardReplica()
CloudSolrClient.Builder
that created clients can send updates
to any shard replica (shard leaders and non-leaders).public CloudSolrClient.Builder withParallelUpdates(boolean parallelUpdates)
@Deprecated public CloudSolrClient.Builder withClusterStateProvider(ClusterStateProvider stateProvider)
public CloudSolrClient build()
CloudSolrClient
based on the provided configuration.public CloudSolrClient.Builder getThis()
SolrClientBuilder
getThis
in class SolrClientBuilder<CloudSolrClient.Builder>
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.