---
title: "collection async"
author: "JLK"
date: "2017-08-14T16:43:45Z"
tags: []
categories: ["编程语言"]
slug: "collection-async"
draft: false
lastmod: "2017-08-14T16:43:45Z"
id: 2389637
url: "https://jlk.iteye.com/blog/2389637"
---

## Asynchronous Calls

Since some collection API calls can be long running tasks e.g. Shard Split, you can optionally have the calls run asynchronously. Specifying `async=<request-id>` enables you to make an asynchronous call, the status of which can be requested using the [REQUESTSTATUS](https://lucene.apache.org/solr/guide/6_6/collections-api.html#CollectionsAPI-requeststatus) call at any time.

As of now, REQUESTSTATUS does not automatically clean up the tracking data structures, meaning the status of completed or failed tasks stays stored in ZooKeeper unless cleared manually. DELETESTATUS can be used to clear the stored statuses. However, there is a limit of 10,000 on the number of async call responses stored in a cluster.

### Example

**Input**

```
http://localhost:8983/solr/admin/collections?action=SPLITSHARD&collection=collection1&shard=shard1&async=1000
```

**Output**

```
<response>
  <lst name="responseHeader">
    <int name="status">0</int>
    <int name="QTime">99</int>
  </lst>
  <str name="requestid">1000</str>
</response>
```