Package org.apache.solr.client.solrj.impl

# Class LBAsyncSolrClient

java.lang.Object
org.apache.solr.client.solrj.SolrClient
org.apache.solr.client.solrj.impl.LBSolrClient
org.apache.solr.client.solrj.impl.LBAsyncSolrClient

All Implemented Interfaces:
  `Closeable`, `Serializable`, `AutoCloseable`

public abstract class LBAsyncSolrClient extends LBSolrClient
A `LBSolrClient` adding `requestAsync(Req)`.

See Also:
  - Serialized Form

## Nested Class Summary

## Nested classes/interfaces inherited from class org.apache.solr.client.solrj.impl.LBSolrClient

`LBSolrClient.Builder<C extends HttpSolrClientBase>, LBSolrClient.Endpoint, LBSolrClient.EndpointIterator, LBSolrClient.EndpointWrapper, LBSolrClient.Req, LBSolrClient.Rsp`

## Nested classes/interfaces inherited from class org.apache.solr.client.solrj.SolrClient

`SolrClient.SolrClientFunction<C extends SolrClient,R>`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final HttpSolrClientBase`
`solrClient`

### Fields inherited from class org.apache.solr.client.solrj.impl.LBSolrClient

`aliveCheckIntervalMillis, parser, requestWriter, RETRY_CODES, UPDATE_LIVE_SERVER_MESSAGE, zombieServers`

### Fields inherited from class org.apache.solr.client.solrj.SolrClient

`defaultCollection`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`LBAsyncSolrClient(LBSolrClient.Builder<?> builder)`

## Method Summary

Modifier and Type
Method
Description
`protected HttpSolrClientBase`
`getClient(LBSolrClient.Endpoint endpoint)`
`CompletableFuture<LBSolrClient.Rsp>`
`requestAsync(LBSolrClient.Req req)`
Execute an asynchronous request against one or more hosts for a given collection.
`protected abstract CompletableFuture<NamedList<Object>>`
`requestAsyncWithUrl(SolrClient client, String baseUrl, SolrRequest<?> request)`

### Methods inherited from class org.apache.solr.client.solrj.impl.LBSolrClient

`addSolrServer, close, createServerWrapper, doRequest, getParser, getRequestWriter, makeServerAZombie, makeServerAZombie, makeServerAZombie, normalize, pickServer, removeSolrServer, request, request, request, reviveZombieServer, updateAliveList`

### Methods inherited from class org.apache.solr.client.solrj.SolrClient

`add, add, add, add, add, add, add, add, add, add, addBean, addBean, addBean, addBean, addBeans, addBeans, addBeans, addBeans, addBeans, addBeans, commit, commit, commit, commit, commit, commit, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteById, deleteByQuery, deleteByQuery, deleteByQuery, deleteByQuery, getById, getById, getById, getById, getById, getById, getById, getById, getContext, getDefaultCollection, optimize, optimize, optimize, optimize, optimize, optimize, ping, ping, query, query, query, query, queryAndStreamResponse, queryAndStreamResponse, queryAndStreamResponse, request, rollback, rollback`

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

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

## Field Details

### solrClient

protected final HttpSolrClientBase solrClient

## Constructor Details

### LBAsyncSolrClient

protected LBAsyncSolrClient(LBSolrClient.Builder<?> builder)

## Method Details

### getClient

protected HttpSolrClientBase getClient(LBSolrClient.Endpoint endpoint)

Specified by:
  `getClient` in class `LBSolrClient`

### requestAsync

public CompletableFuture<LBSolrClient.Rsp> requestAsync(LBSolrClient.Req req)
Execute an asynchronous request against one or more hosts for a given collection. The passed-in Req object includes a List of Endpoints. This method always begins with the first Endpoint in the list and if unsuccessful tries each in turn until the request is successful. Consequently, this method does not actually Load Balance. It is up to the caller to shuffle the List of Endpoints if Load Balancing is desired.

Parameters:
  `req` - the wrapped request to perform
Returns:
  a `CompletableFuture` that tracks the progress of the async request.

### requestAsyncWithUrl

protected abstract CompletableFuture<NamedList<Object>> requestAsyncWithUrl(SolrClient client, String baseUrl, SolrRequest<?> request) throws SolrServerException, IOException

Throws:
  `SolrServerException`
  `IOException`