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

Gera Shegalov commented on MAPREDUCE-4815:
------------------------------------------

Thanks for v10 Siqi and for clarification regarding the constructor that I 
overlooked.
 
*FileOutputCommitter*

- {{algorithmVersion}} should be declared final, hence initialized 
unconditionally and validated. Currently we are implying that we support only 1 
and 2.  Throw an exception for invalid values.

nits:
- {{FileOutputCommitter#recoverTask}} has white space issues in your changes. 
- {{if (algorithmVersion == 1)}} : code style is a space after 'if', no space 
after '('
- in the following {{else}} the indentation should be 2 spaces.

*TestFileOutputCommitter*
{{lib.output.TestFileOutputCommitter}} has only white space changes and 
{{mapred.TestFileOutputCommitter}} has too much code duplication. I suggest the 
following approach.
In both of these classes refactor all public test methods to be private methods 
that take version as a parameter. For example:

{code}
public void testRecovery() throws Exception {
...
}
{code}

becomes:

{code}
private void testRecoveryInternal(int version) throws Exception {
  JobConf conf = new JobConf();
  conf.setInt(org.apache.hadoop.mapreduce.lib.output.
        FileOutputCommitter.FILEOUTPUTCOMMITTER_ALGORITHM_VERSION, version);
  ...
}

public void testRecoveryV1() throws Exception {
  testRecoveryInternal(1);
}

public void testRecoveryV2() throws Exception {
  testRecoveryInternal(2);
}
{code}

Also add at least one test for an invalid version.





> FileOutputCommitter.commitJob can be very slow for jobs with many output files
> ------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-4815
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-4815
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>          Components: mrv2
>    Affects Versions: 0.23.3, 2.0.1-alpha, 2.4.1
>            Reporter: Jason Lowe
>            Assignee: Siqi Li
>         Attachments: MAPREDUCE-4815.v10.patch, MAPREDUCE-4815.v3.patch, 
> MAPREDUCE-4815.v4.patch, MAPREDUCE-4815.v5.patch, MAPREDUCE-4815.v6.patch, 
> MAPREDUCE-4815.v7.patch, MAPREDUCE-4815.v8.patch, MAPREDUCE-4815.v9.patch
>
>
> If a job generates many files to commit then the commitJob method call at the 
> end of the job can take minutes.  This is a performance regression from 1.x, 
> as 1.x had the tasks commit directly to the final output directory as they 
> were completing and commitJob had very little to do.  The commit work was 
> processed in parallel and overlapped the processing of outstanding tasks.  In 
> 0.23/2.x, the commit is single-threaded and waits until all tasks have 
> completed before commencing.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to