org.apache.solr.client.solrj.impl

## Class CloudSolrClient.Builder

- java.lang.Object
- - org.apache.solr.client.solrj.impl.CloudSolrClient.Builder

- Enclosing class:
    CloudSolrClient

      public static class CloudSolrClient.Builder
      extends Object

  Constructs `CloudSolrClient` instances from provided configuration.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Builder()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `CloudSolrClient` | `build()` Create a `CloudSolrClient` based on the provided configuration.
    `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 updats only to shard leaders.
    `CloudSolrClient.Builder` | `sendUpdatesToAllReplicasInShard()` Tells `CloudSolrClient.Builder` that created clients should send updates to all replicas for a shard.
    `CloudSolrClient.Builder` | `withHttpClient(org.apache.http.client.HttpClient httpClient)` Provides a `HttpClient` for the builder to use when creating clients.
    `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` | `withZkChroot(String zkChroot)` Provides a ZooKeeper chroot for the builder to use when creating clients.
    `CloudSolrClient.Builder` | `withZkHost(Collection<String> zkHosts)` Provide a series of ZooKeeper client endpoints for the builder to use when creating clients.
    `CloudSolrClient.Builder` | `withZkHost(String zkHost)` Provide a ZooKeeper client endpoint to be used when configuring `CloudSolrClient` instances.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Builder

          public Builder()

  - ### Method Detail

    - #### withZkHost

          public CloudSolrClient.Builder withZkHost(String zkHost)

      Provide a ZooKeeper client endpoint to be used when configuring `CloudSolrClient` instances. Method may be called multiple times. All provided values will be used.
      Parameters:
        `zkHost` - The client endpoint of the ZooKeeper quorum containing the cloud state.

    - #### withLBHttpSolrClientBuilder

          public CloudSolrClient.Builder withLBHttpSolrClientBuilder(LBHttpSolrClient.Builder lbHttpSolrClientBuilder)

      Provides a `HttpClient` for the builder to use when creating clients.

    - #### withHttpClient

          public CloudSolrClient.Builder withHttpClient(org.apache.http.client.HttpClient httpClient)

      Provides a `HttpClient` for the builder to use when creating clients.

    - #### withZkHost

          public CloudSolrClient.Builder withZkHost(Collection<String> zkHosts)

      Provide a series of ZooKeeper client endpoints for the builder to use when creating clients. Method may be called multiple times. All provided values will be used.
      Parameters:
        `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.

    - #### withZkChroot

          public CloudSolrClient.Builder withZkChroot(String zkChroot)

      Provides a ZooKeeper chroot for the builder to use when creating clients.

    - #### withLBHttpSolrClient

          public CloudSolrClient.Builder withLBHttpSolrClient(LBHttpSolrClient loadBalancedSolrClient)

      Provides a `LBHttpSolrClient` for the builder to use when creating clients.

    - #### sendUpdatesOnlyToShardLeaders

          public CloudSolrClient.Builder sendUpdatesOnlyToShardLeaders()

      Tells `CloudSolrClient.Builder` that created clients should send updats only to shard leaders.

    - #### sendUpdatesToAllReplicasInShard

          public CloudSolrClient.Builder sendUpdatesToAllReplicasInShard()

      Tells `CloudSolrClient.Builder` that created clients should send updates to all replicas for a shard.

    - #### sendDirectUpdatesToShardLeadersOnly

          public CloudSolrClient.Builder sendDirectUpdatesToShardLeadersOnly()

      Tells `CloudSolrClient.Builder` that created clients should send direct updates to shard leaders only.

    - #### sendDirectUpdatesToAnyShardReplica

          public CloudSolrClient.Builder sendDirectUpdatesToAnyShardReplica()

      Tells `CloudSolrClient.Builder` that created clients can send updates to any shard replica (shard leaders and non-leaders).

    - #### build

          public CloudSolrClient build()

      Create a `CloudSolrClient` based on the provided configuration.

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.