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

Harsh J updated MAPREDUCE-4678:
-------------------------------

    Attachment: MAPREDUCE-4678.patch.txt

The changes look good to me as an improvement but can you add some notes on how 
this helps solve negative size exceptions, just so we have it documented?

Your patch has a minor issue that usually arises if you don't (a) use a proper 
IDE for Java or (b) don't compile your code before submitting, both of which 
are good practices to follow :)

Sadly, Java isn't Python, so please wrap () around your if statements and also 
use { } in the structure (for code convention), like so:

{code}
+      if ((args[i]).equalsIgnoreCase("-depth")) {
+        depth = Integer.parseInt(args[i++].trim());
+      } else if ((args[i]).equalsIgnoreCase("-height")) {
+       height = Integer.parseInt(args[i++].trim());
+      } else if ((args[i]).equalsIgnoreCase("-width")) {
+       width = Integer.parseInt(args[i++].trim());
+      }
{code}

And then please submit a new patch (after making sure it at least compiles 
locally! {{mvn compile}}) :)

Thanks much for reporting this in Chris, and for working on the patch.
                
> Running the Pentomino example with defaults throws 
> java.lang.NegativeArraySizeException
> ---------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-4678
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-4678
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>    Affects Versions: 0.20.205.0, 0.23.0
>            Reporter: Chris McConnell
>            Priority: Minor
>         Attachments: MAPREDUCE-4678.patch, MAPREDUCE-4678.patch.txt
>
>
> HADOOP_HOME/hadoop-examples.jar pentomino <output_dir> will fail with the 
> following error message: 
> INFO util.NativeCodeLoader: Loaded the native-hadoop library 
> INFO mapred.FileInputFormat: Total input paths to process : 1 
> INFO mapred.JobClient: Running job: job_xxxxx
> INFO mapred.JobClient: map 0% reduce 0% 
> INFO mapred.JobClient: Task Id : attempt_xxxx, Status : FAILED 
> java.lang.NegativeArraySizeException 
> at org.apache.hadoop.examples.dancing.DistributedPentomino$PentMap.map(Di 
> stributedPentomino.java:95) 
> at org.apache.hadoop.examples.dancing.DistributedPentomino$PentMap.map(Di 
> stributedPentomino.java:51) 
> at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50) 
> at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:391) 
> at org.apache.hadoop.mapred.MapTask.run(MapTask.java:325) 
> at org.apache.hadoop.mapred.Child$4.run(Child.java:270) 
> at java.security.AccessController.doPrivileged(Native Method) 
> at javax.security.auth.Subject.doAs(Subject.java:396) 
> at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformat 
> ion.java:1177) 
> at org.apache.hadoop.mapred.Child.main(Child.java:264)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to