Skip to content

Commit 02e8626

Browse files
committed
Rename ReindexRethrottle to just Rethrottle
naming aligns with the fact that the endpoint can be used to rethrottle other ongoing tasks such as update by query as well as reindex operations
1 parent 756e4ec commit 02e8626

File tree

3 files changed

+46
-30
lines changed

3 files changed

+46
-30
lines changed

src/Nest/Document/Multiple/ReindexRethrottle/ElasticClient-ReindexRethrottle.cs

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,54 @@ namespace Nest
66
{
77
public partial interface IElasticClient
88
{
9-
/// <inheritdoc/>
10-
IReindexRethrottleResponse ReindexRethrottle(Func<ReindexRethrottleDescriptor, IReindexRethrottleRequest> selector);
11-
12-
/// <inheritdoc/>
13-
IReindexRethrottleResponse ReindexRethrottle(IReindexRethrottleRequest request);
14-
15-
/// <inheritdoc/>
16-
Task<IReindexRethrottleResponse> ReindexRethrottleAsync(Func<ReindexRethrottleDescriptor, IReindexRethrottleRequest> selector);
17-
18-
/// <inheritdoc/>
19-
Task<IReindexRethrottleResponse> ReindexRethrottleAsync(IReindexRethrottleRequest request);
9+
/// <summary>
10+
/// Rethrottle an existing reindex or update by query task
11+
/// </summary>
12+
IReindexRethrottleResponse Rethrottle(Func<ReindexRethrottleDescriptor, IReindexRethrottleRequest> selector);
13+
14+
/// <summary>
15+
/// Rethrottle an existing reindex or update by query task
16+
/// </summary>
17+
IReindexRethrottleResponse Rethrottle(IReindexRethrottleRequest request);
18+
19+
/// <summary>
20+
/// Rethrottle an existing reindex or update by query task
21+
/// </summary>
22+
Task<IReindexRethrottleResponse> RethrottleAsync(Func<ReindexRethrottleDescriptor, IReindexRethrottleRequest> selector);
23+
24+
/// <summary>
25+
/// Rethrottle an existing reindex or update by query task
26+
/// </summary>
27+
Task<IReindexRethrottleResponse> RethrottleAsync(IReindexRethrottleRequest request);
2028
}
2129

2230
public partial class ElasticClient
2331
{
24-
/// <inheritdoc/>
25-
public IReindexRethrottleResponse ReindexRethrottle(Func<ReindexRethrottleDescriptor, IReindexRethrottleRequest> selector) =>
26-
this.ReindexRethrottle(selector.InvokeOrDefault(new ReindexRethrottleDescriptor()));
27-
28-
/// <inheritdoc/>
29-
public IReindexRethrottleResponse ReindexRethrottle(IReindexRethrottleRequest request) =>
32+
/// <summary>
33+
/// Rethrottle an existing reindex or update by query task
34+
/// </summary>
35+
public IReindexRethrottleResponse Rethrottle(Func<ReindexRethrottleDescriptor, IReindexRethrottleRequest> selector) =>
36+
this.Rethrottle(selector.InvokeOrDefault(new ReindexRethrottleDescriptor()));
37+
38+
/// <summary>
39+
/// Rethrottle an existing reindex or update by query task
40+
/// </summary>
41+
public IReindexRethrottleResponse Rethrottle(IReindexRethrottleRequest request) =>
3042
this.Dispatcher.Dispatch<IReindexRethrottleRequest, ReindexRethrottleRequestParameters, ReindexRethrottleResponse>(
3143
request,
3244
(p, d) => this.LowLevelDispatch.ReindexRethrottleDispatch<ReindexRethrottleResponse>(p)
3345
);
3446

35-
/// <inheritdoc/>
36-
public Task<IReindexRethrottleResponse> ReindexRethrottleAsync(Func<ReindexRethrottleDescriptor, IReindexRethrottleRequest> selector) =>
37-
this.ReindexRethrottleAsync(selector.InvokeOrDefault(new ReindexRethrottleDescriptor()));
47+
/// <summary>
48+
/// Rethrottle an existing reindex or update by query task
49+
/// </summary>
50+
public Task<IReindexRethrottleResponse> RethrottleAsync(Func<ReindexRethrottleDescriptor, IReindexRethrottleRequest> selector) =>
51+
this.RethrottleAsync(selector.InvokeOrDefault(new ReindexRethrottleDescriptor()));
3852

39-
/// <inheritdoc/>
40-
public Task<IReindexRethrottleResponse> ReindexRethrottleAsync(IReindexRethrottleRequest request) =>
53+
/// <summary>
54+
/// Rethrottle an existing reindex or update by query task
55+
/// </summary>
56+
public Task<IReindexRethrottleResponse> RethrottleAsync(IReindexRethrottleRequest request) =>
4157
this.Dispatcher.DispatchAsync<IReindexRethrottleRequest, ReindexRethrottleRequestParameters, ReindexRethrottleResponse, IReindexRethrottleResponse>(
4258
request,
4359
(p, d) => this.LowLevelDispatch.ReindexRethrottleDispatchAsync<ReindexRethrottleResponse>(p)

src/Tests/Document/Multiple/ReindexRethrottle/ReindexRethrottleApiTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ protected override void IntegrationSetup(IElasticClient client, CallUniqueValues
8080
}
8181

8282
protected override LazyResponses ClientUsage() => Calls(
83-
fluent: (client, f) => client.ReindexRethrottle(f),
84-
fluentAsync: (client, f) => client.ReindexRethrottleAsync(f),
85-
request: (client, r) => client.ReindexRethrottle(r),
86-
requestAsync: (client, r) => client.ReindexRethrottleAsync(r)
83+
fluent: (client, f) => client.Rethrottle(f),
84+
fluentAsync: (client, f) => client.RethrottleAsync(f),
85+
request: (client, r) => client.Rethrottle(r),
86+
requestAsync: (client, r) => client.RethrottleAsync(r)
8787
);
8888

8989
protected override bool ExpectIsValid => true;

src/Tests/Document/Multiple/ReindexRethrottle/ReindexRethrottleUrlTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ public class ReindexRethrottleUrlTests : IUrlTests
1313
[U] public async Task Urls()
1414
{
1515
await POST($"/_reindex/rhtoNesNR4aXVIY2bRR4GQ%3A13056/_rethrottle")
16-
.Fluent(c => c.ReindexRethrottle(f=>f.TaskId(_taskId)))
17-
.Request(c => c.ReindexRethrottle(new ReindexRethrottleRequest(_taskId)))
18-
.FluentAsync(c => c.ReindexRethrottleAsync(f=>f.TaskId(_taskId)))
19-
.RequestAsync(c => c.ReindexRethrottleAsync(new ReindexRethrottleRequest(_taskId)))
16+
.Fluent(c => c.Rethrottle(f=>f.TaskId(_taskId)))
17+
.Request(c => c.Rethrottle(new ReindexRethrottleRequest(_taskId)))
18+
.FluentAsync(c => c.RethrottleAsync(f=>f.TaskId(_taskId)))
19+
.RequestAsync(c => c.RethrottleAsync(new ReindexRethrottleRequest(_taskId)))
2020
;
2121

2222
}

0 commit comments

Comments
 (0)