hadoop-mapreduce-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kengo Seki (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MAPREDUCE-3642) Remove hardcoded strings from the JC#displayTasks() call.
Date Sun, 03 May 2015 15:26:06 GMT

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

Kengo Seki commented on MAPREDUCE-3642:
---------------------------------------

It seems already fixed. In o.a.h.mapreduce.tools.CLI#run,

{code}
    ... else if ("-list-attempt-ids".equals(cmd)) {
      if (argv.length != 4) {
        displayUsage(cmd);
        return exitCode;
      }
      jobid = argv[1];
      taskType = argv[2];
      taskState = argv[3];
      displayTasks = true;
      if (!taskTypes.contains(
          org.apache.hadoop.util.StringUtils.toUpperCase(taskType))) {
        System.out.println("Error: Invalid task-type: " + taskType);
        displayUsage(cmd);
        return exitCode;
      }
      if (!taskStates.contains(
          org.apache.hadoop.util.StringUtils.toLowerCase(taskState))) {
        System.out.println("Error: Invalid task-state: " + taskState);
        displayUsage(cmd);
        return exitCode;
      }
    } ...
{code}

and in o.a.h.mapreduce.tools.CLI#displayUsage,

{code}
    ... else if ("-list-attempt-ids".equals(cmd)) {
      System.err.println(prefix + "[" + cmd + 
          " <job-id> <task-type> <task-state>]. " +
          "Valid values for <task-type> are " + getTaskTypes() + ". " +
          "Valid values for <task-state> are " + taskStates);
    } ...
{code}

> Remove hardcoded strings from the JC#displayTasks() call.
> ---------------------------------------------------------
>
>                 Key: MAPREDUCE-3642
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-3642
>             Project: Hadoop Map/Reduce
>          Issue Type: Sub-task
>          Components: client
>    Affects Versions: 2.0.0-alpha
>            Reporter: Harsh J
>              Labels: newbie
>         Attachments: MR-3642.1.patch
>
>
> This is to address Eli's comments on the parent task:
> bq. 1. The error messages should generate the lists of valid states and types from their
definitions rather than hard-coding them into the error messages.
> bq. 2. Aren't these types and states defined somewhere already? Seems like they're a
public API and therefore shouldn't have to duplicate the definition of them in taskTypes and
taskStates.



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

Mime
View raw message