Remove redundant reads of human flag
The human flag is centrally handled in RestChannel, no need to have Rest actions manually read it and set it to the builder
@@ -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);
}
