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:
parent
b85fa54ee7
commit
9f60924ed5
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue