protected Callable<Response> callable() {
return new Callable<Response>() {
@Override
public Response call() throws Exception {
URIBuilder uri = uri(Yarn.SERVICE_PATH, "/v1/cluster/apps");
HttpPost request = new HttpPost(uri.build());
HttpEntity entity = null;
if (text != null) {
entity = new StringEntity(text, ContentType.APPLICATION_JSON);
} else if (file != null) {
entity = new FileEntity(new File(file), ContentType.APPLICATION_JSON);