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 2015/07/15 17:54:04 UTC

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

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

Ted Yu updated MAPREDUCE-5865:
------------------------------
    Description: 
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.

  was:
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.


> 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.4#6332)