Remove redundant reads of human flag (#23074)

The human flag is centrally handled in RestChannel, no need to have Rest actions manually read it and set it to the builder
This commit is contained in:
Luca Cavanna 2017-02-09 14:58:01 +01:00 committed by GitHub
parent b85fa54ee7
commit 9f60924ed5
1 changed files with 0 additions and 2 deletions

View File

@ -67,12 +67,10 @@ public class RestClusterAllocationExplainAction extends BaseRestHandler {
try {
req.includeYesDecisions(request.paramAsBoolean("include_yes_decisions", false));
req.includeDiskInfo(request.paramAsBoolean("include_disk_info", false));
final boolean humanReadable = request.paramAsBoolean("human", false);
return channel ->
client.admin().cluster().allocationExplain(req, new RestBuilderListener<ClusterAllocationExplainResponse>(channel) {
@Override
public RestResponse buildResponse(ClusterAllocationExplainResponse response, XContentBuilder builder) throws Exception {
builder.humanReadable(humanReadable);
response.getExplanation().toXContent(builder, ToXContent.EMPTY_PARAMS);
return new BytesRestResponse(RestStatus.OK, builder);
}