Rethrottle API
editRethrottle API
editRethrottle Request
editA RethrottleRequest
can be used to change the current throttling on a running
reindex, update-by-query or delete-by-query task or to disable throttling of
the task entirely. It requires the task Id of the task to change.
In its simplest form, you can use it to disable throttling of a running task using the following:
By providing a requestsPerSecond
argument, the request will change the
existing task throttling to the specified value:
The rethrottling request can be executed by using one of the three appropriate methods depending on whether a reindex, update-by-query or delete-by-query task should be rethrottled:
Asynchronous Execution
editThe asynchronous execution of a rethrottle request requires both the RethrottleRequest
instance and an ActionListener
instance to be passed to the asynchronous
method:
client.reindexRethrottleAsync(request, RequestOptions.DEFAULT, listener); client.updateByQueryRethrottleAsync(request, RequestOptions.DEFAULT, listener); client.deleteByQueryRethrottleAsync(request, RequestOptions.DEFAULT, listener);
Execute reindex rethrottling asynchronously |
|
The same for update-by-query |
|
The same for delete-by-query |
The asynchronous method does not block and returns immediately.
Once it is completed the ActionListener
is called back using the onResponse
method
if the execution successfully completed or using the onFailure
method if
it failed. A typical listener looks like this:
Rethrottle Response
editRethrottling returns the task that has been rethrottled in the form of a
ListTasksResponse
. The structure of this response object is described in detail
in this section.