You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2019/12/23 17:33:09 UTC

[GitHub] [hadoop-ozone] vivekratnavel commented on a change in pull request #387: HDDS-2787. Use try-with-resources or close resource in finally block

vivekratnavel commented on a change in pull request #387: HDDS-2787. Use try-with-resources or close resource in finally block
URL: https://github.com/apache/hadoop-ozone/pull/387#discussion_r360955380
 
 

 ##########
 File path: hadoop-ozone/ozonefs/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneClientAdapterImpl.java
 ##########
 @@ -203,10 +203,9 @@ protected void incrementCounter(Statistic objectsRead) {
   public OzoneFSOutputStream createFile(String key, boolean overWrite,
       boolean recursive) throws IOException {
     incrementCounter(Statistic.OBJECTS_CREATED);
-    try {
-      OzoneOutputStream ozoneOutputStream = bucket
-          .createFile(key, 0, replicationType, replicationFactor, overWrite,
-              recursive);
+    try (OzoneOutputStream ozoneOutputStream = bucket
+        .createFile(key, 0, replicationType, replicationFactor, overWrite,
+            recursive)) {
 
 Review comment:
   @adoroszlai Thanks for the review. You are right! I fixed this in the latest patch.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org