master_timeout parameter is now taken into account when calling cluster pending tasks api through the REST layer

Closes 
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
rest-api-spec/api
src/main/java/org/elasticsearch/rest/action

View File

@ -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"
} }
} }
}, },

View File

@ -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>() {

View File

@ -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