You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-issues@hadoop.apache.org by "Ted Yu (JIRA)" <ji...@apache.org> on 2017/03/10 02:08:38 UTC

[jira] [Comment Edited] (MAPREDUCE-5865) RecordReader is not closed in TeraInputFormat#writePartitionFile()

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

Ted Yu edited comment on MAPREDUCE-5865 at 3/10/17 2:08 AM:
------------------------------------------------------------

Patch lgtm


was (Author: yuzhihong@gmail.com):
Patch lgtm.

> RecordReader is not closed in TeraInputFormat#writePartitionFile()
> ------------------------------------------------------------------
>
>                 Key: MAPREDUCE-5865
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-5865
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>          Components: mrv1
>            Reporter: Ted Yu
>              Labels: BB2015-05-TBR
>         Attachments: MAPREDUCE-5865.patch
>
>
> Here is related code:
> {code}
>             RecordReader<Text, Text> reader = 
>               inFormat.createRecordReader(splits.get(sampleStep * idx),
>               context);
>             reader.initialize(splits.get(sampleStep * idx), context);
>             while (reader.nextKeyValue()) {
>               sampler.addKey(new Text(reader.getCurrentKey()));
>               records += 1;
>               if (recordsPerSample <= records) {
>                 break;
>               }
>             }
> {code}
> reader should be closed using finally block.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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