hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uma Maheswara Rao G (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-7437) IOUtils.copybytes will suppress the stream closure exceptions.
Date Thu, 07 Jul 2011 02:45:16 GMT

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

Uma Maheswara Rao G commented on HADOOP-7437:
---------------------------------------------

Hi Eli, thanks for comments.
 when i checked the code, i found that we already handled as part of HADOOP-7194 for other
copybytes  api.

> 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