hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "niccolo becchi (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HADOOP-13320) Fix arguments check in the WordCount v2.0 in the MapReduce Documentation
Date Fri, 24 Jun 2016 14:14:16 GMT

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

niccolo becchi updated HADOOP-13320:
------------------------------------
    Description: 
This issue is affecting the documentation page, so the code is not covered by any tests. It's
actually visible on the page:
https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html
On the Example: WordCount v2.0 

The actual arguments check is wrong, as it's never printing the message of the correct usage.
So, running the code with a wrong number of parameters we get the exception:

yarn jar /var/tmp/WordCount.jar task0.WordCount2

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.rangeCheck(ArrayList.java:635)
    at java.util.ArrayList.get(ArrayList.java:411)
    at task0.WordCount2.main(WordCount2.java:131)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

Intead than the expected message

 Usage: wordcount <in> <out> [-skip skipPatternFile]

  was:
The actual arguments check is wrong, as it's never printing the message of the correct usage.
So, running the code with a wrong number of parameters we get the exception:

yarn jar /var/tmp/WordCount.jar task0.WordCount2

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.rangeCheck(ArrayList.java:635)
    at java.util.ArrayList.get(ArrayList.java:411)
    at task0.WordCount2.main(WordCount2.java:131)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

Intead than the expected message

 Usage: wordcount <in> <out> [-skip skipPatternFile]


> Fix arguments check in the WordCount v2.0 in the MapReduce Documentation 
> -------------------------------------------------------------------------
>
>                 Key: HADOOP-13320
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13320
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: documentation
>            Reporter: niccolo becchi
>            Priority: Trivial
>
> This issue is affecting the documentation page, so the code is not covered by any tests.
It's actually visible on the page:
> https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html
> On the Example: WordCount v2.0 
> The actual arguments check is wrong, as it's never printing the message of the correct
usage. So, running the code with a wrong number of parameters we get the exception:
> yarn jar /var/tmp/WordCount.jar task0.WordCount2
> Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>     at java.util.ArrayList.rangeCheck(ArrayList.java:635)
>     at java.util.ArrayList.get(ArrayList.java:411)
>     at task0.WordCount2.main(WordCount2.java:131)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:606)
>     at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
>     at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
> Intead than the expected message
>  Usage: wordcount <in> <out> [-skip skipPatternFile]



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

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


Mime
View raw message