hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-7437) IOUtils.copybytes will suppress the stream closure exceptions.
Date Mon, 04 Jul 2011 02:55:22 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-7437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059317#comment-13059317
] 

Hudson commented on HADOOP-7437:
--------------------------------

Integrated in Hadoop-Common-trunk-Commit #670 (See [https://builds.apache.org/job/Hadoop-Common-trunk-Commit/670/])
    HADOOP-7437. IOUtils.copybytes will suppress the stream closure exceptions.  Contributed
by Uma Maheswara Rao G

szetszwo : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1142535
Files : 
* /hadoop/common/trunk/common/CHANGES.txt
* /hadoop/common/trunk/common/src/java/org/apache/hadoop/io/IOUtils.java
* /hadoop/common/trunk/common/src/test/core/org/apache/hadoop/io/TestIOUtils.java


> IOUtils.copybytes will suppress the stream closure exceptions. 
> ---------------------------------------------------------------
>
>                 Key: HADOOP-7437
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7437
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: io
>    Affects Versions: hudson, 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7437.patch
>
>
> {code}
> public static void copyBytes(InputStream in, OutputStream out, long count,
>       boolean close) throws IOException {
>     byte buf[] = new byte[4096];
>     long bytesRemaining = count;
>     int bytesRead;
>     try {
>       .............
>       .............
>     } finally {
>       if (close) {
>         closeStream(out);
>         closeStream(in);
>       }
>     }
>   }
> {code}
> Here if any exception in closing the stream, it will get suppressed here.
> So, better to follow the stream closure pattern as HADOOP-7194.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message