Description
org.apache.hadoop.gateway.shell.BasicResponse and org.apache.hadoop.gateway.shell.Hadoop are not java.io.Closeable, which means that we have to do this:
BasicResponse response = null; String jobId; try { response = Workflow.submit(getHadoop()).text(xmlConfiguration).now(); jobId = JsonPath.read(response.getString(), "$.id"); } finally { if(response != null) { response.close(); } }
instead of this:
String jobId; try (BasicResponse response = Workflow.submit(getHadoop()).text(xmlConfiguration).now()){ jobId = JsonPath.read(response.getString(), "$.id"); }