Fix maxCompletedTasks parameter in OverlordClientImpl. (#14667)

It was sent to the server as "maxCompletedTasks", but the server expects
"max". This caused it to be ignored. This bug was introduced in #14581.
This commit is contained in:
Gian Merlino 2023-07-26 15:12:20 -07:00 committed by GitHub
parent add9796d46
commit 4a68f8a294
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -147,7 +147,7 @@ public class OverlordClientImpl implements OverlordClient
}
if (maxCompletedTasks != null) {
pathBuilder.append(params == 0 ? '?' : '&').append("maxCompletedTasks=").append(maxCompletedTasks);
pathBuilder.append(params == 0 ? '?' : '&').append("max=").append(maxCompletedTasks);
}
return FutureUtils.transform(

View File

@ -184,7 +184,7 @@ public class OverlordClientImplTest
serviceClient.expectAndRespond(
new RequestBuilder(
HttpMethod.GET,
"/druid/indexer/v1/tasks?state=RUNNING&datasource=foo%3F&maxCompletedTasks=0"
"/druid/indexer/v1/tasks?state=RUNNING&datasource=foo%3F&max=0"
),
HttpResponseStatus.OK,
ImmutableMap.of(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON),
@ -203,7 +203,7 @@ public class OverlordClientImplTest
serviceClient.expectAndRespond(
new RequestBuilder(
HttpMethod.GET,
"/druid/indexer/v1/tasks?maxCompletedTasks=0"
"/druid/indexer/v1/tasks?max=0"
),
HttpResponseStatus.OK,
ImmutableMap.of(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON),