Uploaded image for project: 'Apache Knox'
  1. Apache Knox
  2. KNOX-806

Implement Closeable for deallocable resources

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.12.0
    • ClientDSL

    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");
      }
      

      Source

      Attachments

        1. KNOX-806.patch
          3 kB
          Vincent Devillers

        Activity

          People

            treydone Vincent Devillers
            treydone Vincent Devillers
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: