|
| 1 | +using System; |
| 2 | +using System.Threading; |
| 3 | +using System.Threading.Tasks; |
| 4 | +using Elasticsearch.Net; |
| 5 | + |
| 6 | +namespace Nest |
| 7 | +{ |
| 8 | + public partial interface IElasticClient |
| 9 | + { |
| 10 | + /// <summary> |
| 11 | + /// Rethrottles a running update by query. Rethrottling that speeds up the query takes effect immediately |
| 12 | + /// but rethrotting that slows down the query will take effect after completing the current batch. This prevents scroll timeouts. |
| 13 | + /// <para> </para> |
| 14 | + /// <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html#docs-update-by-query-rethrottle">https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html#docs-update-by-query-rethrottle</a> |
| 15 | + /// </summary> |
| 16 | + IListTasksResponse UpdateByQueryRethrottle(TaskId taskId, Func<UpdateByQueryRethrottleDescriptor, IUpdateByQueryRethrottleRequest> selector = null); |
| 17 | + |
| 18 | + /// <inheritdoc cref="UpdateByQueryRethrottle(Nest.TaskId,System.Func{Nest.UpdateByQueryRethrottleDescriptor,Nest.IUpdateByQueryRethrottleRequest})" /> |
| 19 | + IListTasksResponse UpdateByQueryRethrottle(IUpdateByQueryRethrottleRequest request); |
| 20 | + |
| 21 | + /// <inheritdoc cref="UpdateByQueryRethrottle(Nest.TaskId,System.Func{Nest.UpdateByQueryRethrottleDescriptor,Nest.IUpdateByQueryRethrottleRequest})" /> |
| 22 | + Task<IListTasksResponse> UpdateByQueryRethrottleAsync(TaskId taskId, |
| 23 | + Func<UpdateByQueryRethrottleDescriptor, IUpdateByQueryRethrottleRequest> selector = null, |
| 24 | + CancellationToken cancellationToken = default(CancellationToken) |
| 25 | + ); |
| 26 | + |
| 27 | + /// <inheritdoc cref="UpdateByQueryRethrottle(Nest.TaskId,System.Func{Nest.UpdateByQueryRethrottleDescriptor,Nest.IUpdateByQueryRethrottleRequest})" /> |
| 28 | + Task<IListTasksResponse> UpdateByQueryRethrottleAsync(IUpdateByQueryRethrottleRequest request, |
| 29 | + CancellationToken cancellationToken = default(CancellationToken) |
| 30 | + ); |
| 31 | + } |
| 32 | + |
| 33 | + public partial class ElasticClient |
| 34 | + { |
| 35 | + /// <inheritdoc /> |
| 36 | + public IListTasksResponse UpdateByQueryRethrottle(TaskId taskId, Func<UpdateByQueryRethrottleDescriptor, IUpdateByQueryRethrottleRequest> selector = null) => |
| 37 | + UpdateByQueryRethrottle(selector.InvokeOrDefault(new UpdateByQueryRethrottleDescriptor(taskId))); |
| 38 | + |
| 39 | + /// <inheritdoc /> |
| 40 | + public IListTasksResponse UpdateByQueryRethrottle(IUpdateByQueryRethrottleRequest request) => |
| 41 | + Dispatcher.Dispatch<IUpdateByQueryRethrottleRequest, UpdateByQueryRethrottleRequestParameters, ListTasksResponse>( |
| 42 | + request, |
| 43 | + (p, d) => LowLevelDispatch.UpdateByQueryRethrottleDispatch<ListTasksResponse>(p) |
| 44 | + ); |
| 45 | + |
| 46 | + /// <inheritdoc /> |
| 47 | + public Task<IListTasksResponse> UpdateByQueryRethrottleAsync(TaskId taskId, Func<UpdateByQueryRethrottleDescriptor, IUpdateByQueryRethrottleRequest> selector = null, |
| 48 | + CancellationToken cancellationToken = default(CancellationToken) |
| 49 | + ) => |
| 50 | + UpdateByQueryRethrottleAsync(selector.InvokeOrDefault(new UpdateByQueryRethrottleDescriptor(taskId)), cancellationToken); |
| 51 | + |
| 52 | + /// <inheritdoc /> |
| 53 | + public Task<IListTasksResponse> UpdateByQueryRethrottleAsync(IUpdateByQueryRethrottleRequest request, |
| 54 | + CancellationToken cancellationToken = default(CancellationToken) |
| 55 | + ) => |
| 56 | + Dispatcher.DispatchAsync<IUpdateByQueryRethrottleRequest, UpdateByQueryRethrottleRequestParameters, ListTasksResponse, IListTasksResponse>( |
| 57 | + request, |
| 58 | + cancellationToken, |
| 59 | + (p, d, c) => LowLevelDispatch.UpdateByQueryRethrottleDispatchAsync<ListTasksResponse>(p, c) |
| 60 | + ); |
| 61 | + } |
| 62 | +} |
0 commit comments