You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-issues@hadoop.apache.org by "Rajesh Putta (JIRA)" <ji...@apache.org> on 2011/08/01 10:59:09 UTC

[jira] [Commented] (MAPREDUCE-2759) TaskTrackerAction should follow Open Closed Principle

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

Rajesh Putta commented on MAPREDUCE-2759:
-----------------------------------------

{code:title=TaskTrackerAction.java|borderStyle=solid}
switch (actionType) {
    case LAUNCH_TASK:
      {
        action = new LaunchTaskAction();
      }
      break;
    case KILL_TASK:
      {
        action = new KillTaskAction();
      }
      break;
    case KILL_JOB:
      {
        action = new KillJobAction();
      }
      break;
    case REINIT_TRACKER:
      {
        action = new ReinitTrackerAction();
      }
      break;
    case COMMIT_TASK:
      {
        action = new CommitTaskAction();
      }
      break;
{code} 
In the above case, for every action that are going to be added in the future the number of cases increases.

> TaskTrackerAction should follow Open Closed Principle
> -----------------------------------------------------
>
>                 Key: MAPREDUCE-2759
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2759
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: tasktracker
>    Affects Versions: 0.23.0
>         Environment: NA
>            Reporter: Rajesh Putta
>            Priority: Minor
>
> In the class TaskTrackerAction  there are fixed actions or directions specified from the Job Tracker to the Task Tracker.So if in the future if some more actions are specified from the Job Tracker to Task Tracker,Current implementation is breaking Open Closed Principle(Open for extension,closed for modification).As the number of actions increases in the future, the code need to be modified to incorporate the actions.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira