|  | @@ -16,13 +16,16 @@ import org.elasticsearch.common.inject.Inject;
 | 
	
		
			
				|  |  |  import org.elasticsearch.common.io.stream.StreamInput;
 | 
	
		
			
				|  |  |  import org.elasticsearch.common.io.stream.StreamOutput;
 | 
	
		
			
				|  |  |  import org.elasticsearch.node.NodeService;
 | 
	
		
			
				|  |  | +import org.elasticsearch.tasks.CancellableTask;
 | 
	
		
			
				|  |  |  import org.elasticsearch.tasks.Task;
 | 
	
		
			
				|  |  | +import org.elasticsearch.tasks.TaskId;
 | 
	
		
			
				|  |  |  import org.elasticsearch.threadpool.ThreadPool;
 | 
	
		
			
				|  |  |  import org.elasticsearch.transport.TransportRequest;
 | 
	
		
			
				|  |  |  import org.elasticsearch.transport.TransportService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import java.io.IOException;
 | 
	
		
			
				|  |  |  import java.util.List;
 | 
	
		
			
				|  |  | +import java.util.Map;
 | 
	
		
			
				|  |  |  import java.util.Set;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  public class TransportNodesStatsAction extends TransportNodesAction<NodesStatsRequest,
 | 
	
	
		
			
				|  | @@ -57,6 +60,8 @@ public class TransportNodesStatsAction extends TransportNodesAction<NodesStatsRe
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      protected NodeStats nodeOperation(NodeStatsRequest nodeStatsRequest, Task task) {
 | 
	
		
			
				|  |  | +        assert task instanceof CancellableTask;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          NodesStatsRequest request = nodeStatsRequest.request;
 | 
	
		
			
				|  |  |          Set<String> metrics = request.requestedMetrics();
 | 
	
		
			
				|  |  |          return nodeService.stats(
 | 
	
	
		
			
				|  | @@ -90,6 +95,11 @@ public class TransportNodesStatsAction extends TransportNodesAction<NodesStatsRe
 | 
	
		
			
				|  |  |              this.request = request;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        @Override
 | 
	
		
			
				|  |  | +        public Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String, String> headers) {
 | 
	
		
			
				|  |  | +            return new CancellableTask(id, type, action, "", parentTaskId, headers);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          @Override
 | 
	
		
			
				|  |  |          public void writeTo(StreamOutput out) throws IOException {
 | 
	
		
			
				|  |  |              super.writeTo(out);
 |