You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "Vincent Devillers (JIRA)" <ji...@apache.org> on 2016/12/26 13:46:58 UTC

[jira] [Work started] (KNOX-806) Implement Closeable for deallocable resources

     [ https://issues.apache.org/jira/browse/KNOX-806?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on KNOX-806 started by Vincent Devillers.
----------------------------------------------
> Implement Closeable for deallocable resources
> ---------------------------------------------
>
>                 Key: KNOX-806
>                 URL: https://issues.apache.org/jira/browse/KNOX-806
>             Project: Apache Knox
>          Issue Type: Improvement
>          Components: ClientDSL
>            Reporter: Vincent Devillers
>            Assignee: Vincent Devillers
>            Priority: Minor
>              Labels: KIP-4
>             Fix For: 0.12.0
>
>         Attachments: KNOX-806.patch
>
>
> 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:
> {code:java}
> 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();
>     }
> }
> {code}
> instead of this:
> {code:java}
> String jobId;
> try (BasicResponse response = Workflow.submit(getHadoop()).text(xmlConfiguration).now()){
>     jobId = JsonPath.read(response.getString(), "$.id");
> }
> {code}
> [Source|https://blog.layer4.fr/2016/12/06/knox-production-pitfalls-and-common-mistakes/]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)