master_timeout parameter is now taken into account when calling cluster pending tasks api through the REST layer
Closes #4806
This commit is contained in:
parent
3a558972b2
commit
55a247e257
rest-api-spec/api
src/main/java/org/elasticsearch/rest/action
|
@ -11,6 +11,10 @@
|
||||||
"local": {
|
"local": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Return local information, do not retrieve the state from master node (default: false)"
|
"description": "Return local information, do not retrieve the state from master node (default: false)"
|
||||||
|
},
|
||||||
|
"master_timeout": {
|
||||||
|
"type": "time",
|
||||||
|
"description": "Specify timeout for connection to master"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -44,6 +44,7 @@ public class RestPendingClusterTasksAction extends BaseRestHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handleRequest(final RestRequest request, final RestChannel channel) {
|
public void handleRequest(final RestRequest request, final RestChannel channel) {
|
||||||
PendingClusterTasksRequest pendingClusterTasksRequest = new PendingClusterTasksRequest();
|
PendingClusterTasksRequest pendingClusterTasksRequest = new PendingClusterTasksRequest();
|
||||||
|
pendingClusterTasksRequest.masterNodeTimeout(request.paramAsTime("master_timeout", pendingClusterTasksRequest.masterNodeTimeout()));
|
||||||
pendingClusterTasksRequest.local(request.paramAsBoolean("local", pendingClusterTasksRequest.local()));
|
pendingClusterTasksRequest.local(request.paramAsBoolean("local", pendingClusterTasksRequest.local()));
|
||||||
client.admin().cluster().pendingClusterTasks(pendingClusterTasksRequest, new ActionListener<PendingClusterTasksResponse>() {
|
client.admin().cluster().pendingClusterTasks(pendingClusterTasksRequest, new ActionListener<PendingClusterTasksResponse>() {
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ public class RestPendingClusterTasksAction extends AbstractCatAction {
|
||||||
@Override
|
@Override
|
||||||
public void doRequest(final RestRequest request, final RestChannel channel) {
|
public void doRequest(final RestRequest request, final RestChannel channel) {
|
||||||
PendingClusterTasksRequest pendingClusterTasksRequest = new PendingClusterTasksRequest();
|
PendingClusterTasksRequest pendingClusterTasksRequest = new PendingClusterTasksRequest();
|
||||||
|
pendingClusterTasksRequest.masterNodeTimeout(request.paramAsTime("master_timeout", pendingClusterTasksRequest.masterNodeTimeout()));
|
||||||
pendingClusterTasksRequest.local(request.paramAsBoolean("local", pendingClusterTasksRequest.local()));
|
pendingClusterTasksRequest.local(request.paramAsBoolean("local", pendingClusterTasksRequest.local()));
|
||||||
client.admin().cluster().pendingClusterTasks(pendingClusterTasksRequest, new ActionListener<PendingClusterTasksResponse>() {
|
client.admin().cluster().pendingClusterTasks(pendingClusterTasksRequest, new ActionListener<PendingClusterTasksResponse>() {
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue