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

Harsh J commented on MAPREDUCE-2944:
------------------------------------

Xie,

Sorry for much back and forth, I should've read up more on the method itself 
before:

- Lets use IllegalArgumentExceptions instead of IO ones. Its more appropriate.
- I noted that the method called internally is the CLI's displayTasks() one. 
Perhaps we can add validation to that itself, and benefit both the API and the 
CLI.
- The sets can be class' field members, no need to initialize them every time 
the method is called. Given the first point, in the super.displayTasks() method 
you only need to add in a set for the type of tasks, and an else clause to the 
state check there will cover the states validation.
- Do update javadoc on @throws IllegalArgumentException stuff wherever 
applicable.
                
> Improve checking of input for Api displayTasks() 
> -------------------------------------------------
>
>                 Key: MAPREDUCE-2944
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2944
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: client
>    Affects Versions: 0.24.0
>            Reporter: XieXianshan
>            Assignee: XieXianshan
>            Priority: Trivial
>             Fix For: 0.24.0
>
>         Attachments: MAPREDUCE-2944.patch, MAPREDUCE-2944_v0.2.patch
>
>
> The JobClient.displayTasks() will do nothing and won't throw any exception 
> either, 
> while user call it with invalid type/state of task.
> To be more friendly,it's better to remain user to check his parameters with 
> an exception. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to