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:
Luca Cavanna 2014-01-20 12:53:55 +01:00
parent 3a558972b2
commit 55a247e257
3 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,10 @@
"local": {
"type": "boolean",
"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"
}
}
},

View File

@ -44,6 +44,7 @@ public class RestPendingClusterTasksAction extends BaseRestHandler {
@Override
public void handleRequest(final RestRequest request, final RestChannel channel) {
PendingClusterTasksRequest pendingClusterTasksRequest = new PendingClusterTasksRequest();
pendingClusterTasksRequest.masterNodeTimeout(request.paramAsTime("master_timeout", pendingClusterTasksRequest.masterNodeTimeout()));
pendingClusterTasksRequest.local(request.paramAsBoolean("local", pendingClusterTasksRequest.local()));
client.admin().cluster().pendingClusterTasks(pendingClusterTasksRequest, new ActionListener<PendingClusterTasksResponse>() {

View File

@ -49,6 +49,7 @@ public class RestPendingClusterTasksAction extends AbstractCatAction {
@Override
public void doRequest(final RestRequest request, final RestChannel channel) {
PendingClusterTasksRequest pendingClusterTasksRequest = new PendingClusterTasksRequest();
pendingClusterTasksRequest.masterNodeTimeout(request.paramAsTime("master_timeout", pendingClusterTasksRequest.masterNodeTimeout()));
pendingClusterTasksRequest.local(request.paramAsBoolean("local", pendingClusterTasksRequest.local()));
client.admin().cluster().pendingClusterTasks(pendingClusterTasksRequest, new ActionListener<PendingClusterTasksResponse>() {
@Override