org.apache.hadoop.tools.rumen.TaskAttemptInfo Java Examples

The following examples show how to use org.apache.hadoop.tools.rumen.TaskAttemptInfo. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SleepJob.java    From hadoop with Apache License 2.0 6 votes vote down vote up
private TaskAttemptInfo getSuccessfulAttemptInfo(TaskType type, int task) {
  TaskAttemptInfo ret;
  for (int i = 0; true; ++i) {
    // Rumen should make up an attempt if it's missing. Or this won't work
    // at all. It's hard to discern what is happening in there.
    ret = jobdesc.getTaskAttemptInfo(type, task, i);
    if (ret.getRunState() == TaskStatus.State.SUCCEEDED) {
      break;
    }
  }
  if(ret.getRunState() != TaskStatus.State.SUCCEEDED) {
    LOG.warn("No sucessful attempts tasktype " + type +" task "+ task);
  }

  return ret;
}
 
Example #2
Source File: DebugJobProducer.java    From hadoop with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings({ "deprecation", "incomplete-switch" })
@Override
public TaskAttemptInfo getTaskAttemptInfo(
  TaskType taskType, int taskNumber, int taskAttemptNumber) {
  switch (taskType) {
    case MAP:
      return new MapTaskAttemptInfo(
        State.SUCCEEDED, 
        new TaskInfo(
          m_bytesIn[taskNumber], m_recsIn[taskNumber],
          m_bytesOut[taskNumber], m_recsOut[taskNumber], -1),
        100);

    case REDUCE:
      return new ReduceTaskAttemptInfo(
        State.SUCCEEDED, 
        new TaskInfo(
          r_bytesIn[taskNumber], r_recsIn[taskNumber],
          r_bytesOut[taskNumber], r_recsOut[taskNumber], -1),
        100, 100, 100);
  }
  throw new UnsupportedOperationException();
}
 
Example #3
Source File: SleepJob.java    From big-c with Apache License 2.0 6 votes vote down vote up
private TaskAttemptInfo getSuccessfulAttemptInfo(TaskType type, int task) {
  TaskAttemptInfo ret;
  for (int i = 0; true; ++i) {
    // Rumen should make up an attempt if it's missing. Or this won't work
    // at all. It's hard to discern what is happening in there.
    ret = jobdesc.getTaskAttemptInfo(type, task, i);
    if (ret.getRunState() == TaskStatus.State.SUCCEEDED) {
      break;
    }
  }
  if(ret.getRunState() != TaskStatus.State.SUCCEEDED) {
    LOG.warn("No sucessful attempts tasktype " + type +" task "+ task);
  }

  return ret;
}
 
Example #4
Source File: DebugJobProducer.java    From big-c with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings({ "deprecation", "incomplete-switch" })
@Override
public TaskAttemptInfo getTaskAttemptInfo(
  TaskType taskType, int taskNumber, int taskAttemptNumber) {
  switch (taskType) {
    case MAP:
      return new MapTaskAttemptInfo(
        State.SUCCEEDED, 
        new TaskInfo(
          m_bytesIn[taskNumber], m_recsIn[taskNumber],
          m_bytesOut[taskNumber], m_recsOut[taskNumber], -1),
        100);

    case REDUCE:
      return new ReduceTaskAttemptInfo(
        State.SUCCEEDED, 
        new TaskInfo(
          r_bytesIn[taskNumber], r_recsIn[taskNumber],
          r_bytesOut[taskNumber], r_recsOut[taskNumber], -1),
        100, 100, 100);
  }
  throw new UnsupportedOperationException();
}
 
Example #5
Source File: SimulatorJobInProgress.java    From RDFS with Apache License 2.0 6 votes vote down vote up
/**
 * Given the reduce taskAttemptID, returns the TaskAttemptInfo. Deconstructs
 * the reduce taskAttemptID and looks up the jobStory with the parts taskType,
 * id of task, id of task attempt.
 * 
 * @param taskTracker
 *          tasktracker
 * @param taskAttemptID
 *          task-attempt
 * @return TaskAttemptInfo for the reduce task-attempt
 */
private TaskAttemptInfo getReduceTaskAttemptInfo(TaskTracker taskTracker,
    TaskAttemptID taskAttemptID) {
  assert (!taskAttemptID.isMap());
  TaskID taskId = taskAttemptID.getTaskID();
  TaskType taskType;
  if (taskAttemptID.isMap()) {
    taskType = TaskType.MAP;
  } else {
    taskType = TaskType.REDUCE;
  }

  TaskAttemptInfo taskAttemptInfo = jobStory.getTaskAttemptInfo(taskType,
      taskId.getId(), taskAttemptID.getId());
  if (LOG.isDebugEnabled()) {
    LOG.debug("get an attempt: "
        + taskAttemptID.toString()
        + ", state="
        + taskAttemptInfo.getRunState()
        + ", runtime="
        + ((taskAttemptID.isMap()) ? taskAttemptInfo.getRuntime()
            : ((ReduceTaskAttemptInfo) taskAttemptInfo).getReduceRuntime()));
  }
  return taskAttemptInfo;
}
 
Example #6
Source File: SimulatorJobInProgress.java    From RDFS with Apache License 2.0 5 votes vote down vote up
/**
 * Given the map taskAttemptID, returns the TaskAttemptInfo. Deconstructs the
 * map's taskAttemptID and looks up the jobStory with the parts taskType, id
 * of task, id of task attempt.
 * 
 * @param taskTracker
 *          tasktracker
 * @param taskAttemptID
 *          task-attempt
 * @return TaskAttemptInfo for the map task-attempt
 */
@SuppressWarnings("deprecation")
private synchronized TaskAttemptInfo getMapTaskAttemptInfo(
    TaskTracker taskTracker, TaskAttemptID taskAttemptID) {
  assert (taskAttemptID.isMap());

  JobID jobid = (JobID) taskAttemptID.getJobID();
  assert (jobid == getJobID());

  // Get splits for the TaskAttempt
  RawSplit split = splits[taskAttemptID.getTaskID().getId()];
  int locality = getClosestLocality(taskTracker, split);

  TaskID taskId = taskAttemptID.getTaskID();
  if (!taskId.isMap()) {
    assert false : "Task " + taskId + " is not MAP :"; 
  }
  
  TaskAttemptInfo taskAttemptInfo = jobStory.getMapTaskAttemptInfoAdjusted(
      taskId.getId(), taskAttemptID.getId(), locality);

  if (LOG.isDebugEnabled()) {
    LOG.debug("get an attempt: "
        + taskAttemptID.toString()
        + ", state="
        + taskAttemptInfo.getRunState()
        + ", runtime="
        + ((taskId.isMap()) ? taskAttemptInfo.getRuntime()
            : ((ReduceTaskAttemptInfo) taskAttemptInfo).getReduceRuntime()));
  }
  return taskAttemptInfo;
}
 
Example #7
Source File: SimulatorJobInProgress.java    From RDFS with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("deprecation")
public TaskAttemptInfo getTaskAttemptInfo(TaskTracker taskTracker,
    TaskAttemptID taskAttemptId) {
  JobID jobid = (JobID) taskAttemptId.getJobID();
  assert (jobid == getJobID());

  return (taskAttemptId.isMap()) ? getMapTaskAttemptInfo(
      taskTracker, taskAttemptId)
      : getReduceTaskAttemptInfo(taskTracker, taskAttemptId);
}
 
Example #8
Source File: DebugJobFactory.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public TaskAttemptInfo getMapTaskAttemptInfoAdjusted(int taskNumber,
    int taskAttemptNumber, int locality) {
  throw new UnsupportedOperationException();
}
 
Example #9
Source File: JobFactory.java    From hadoop with Apache License 2.0 4 votes vote down vote up
public TaskAttemptInfo getTaskAttemptInfo(TaskType taskType, int taskNumber,
    int taskAttemptNumber) {
  return job.getTaskAttemptInfo(taskType, taskNumber, taskAttemptNumber);
}
 
Example #10
Source File: DebugJobFactory.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public TaskAttemptInfo getTaskAttemptInfo(TaskType taskType,
    int taskNumber, int taskAttemptNumber) {
  throw new UnsupportedOperationException();
}
 
Example #11
Source File: JobFactory.java    From RDFS with Apache License 2.0 4 votes vote down vote up
public TaskAttemptInfo getMapTaskAttemptInfoAdjusted(
    int taskNumber, int taskAttemptNumber, int locality) {
  return job.getMapTaskAttemptInfoAdjusted(
      taskNumber, taskAttemptNumber, locality);
}
 
Example #12
Source File: JobFactory.java    From RDFS with Apache License 2.0 4 votes vote down vote up
public TaskAttemptInfo getTaskAttemptInfo(TaskType taskType, int taskNumber,
    int taskAttemptNumber) {
  return job.getTaskAttemptInfo(taskType, taskNumber, taskAttemptNumber);
}
 
Example #13
Source File: FakeJobs.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public TaskAttemptInfo getMapTaskAttemptInfoAdjusted(int taskNumber,
    int taskAttemptNumber, int locality) {
  return getTaskAttemptInfo(TaskType.MAP, taskNumber, taskAttemptNumber);
}
 
Example #14
Source File: TestSimulatorJobClient.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public TaskAttemptInfo getTaskAttemptInfo(TaskType taskType,
    int taskNumber, int taskAttemptNumber) {
  throw new UnsupportedOperationException();
}
 
Example #15
Source File: TestSimulatorJobClient.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public TaskAttemptInfo getMapTaskAttemptInfoAdjusted(int taskNumber,
    int taskAttemptNumber, int locality) {
  throw new UnsupportedOperationException();
}
 
Example #16
Source File: SimulatorLaunchTaskAction.java    From RDFS with Apache License 2.0 4 votes vote down vote up
/** Get the resource usage model for the task. */
public TaskAttemptInfo getTaskAttemptInfo() {
  return taskAttemptInfo;
}
 
Example #17
Source File: SimulatorLaunchTaskAction.java    From RDFS with Apache License 2.0 4 votes vote down vote up
/**
 * Constructs a SimulatorLaunchTaskAction object for a {@link Task}.
 * @param task Task task to be launched
 * @param taskAttemptInfo resource usage model for task execution
 */            
public SimulatorLaunchTaskAction(Task task,
                                 TaskAttemptInfo taskAttemptInfo) {
  super(task);
  this.taskAttemptInfo = taskAttemptInfo;
}
 
Example #18
Source File: SimulatorJobStory.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public TaskAttemptInfo getTaskAttemptInfo(TaskType taskType, int taskNumber,
    int taskAttemptNumber) {
  return job.getTaskAttemptInfo(taskType, taskNumber, taskAttemptNumber);
}
 
Example #19
Source File: SimulatorJobStory.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public TaskAttemptInfo getMapTaskAttemptInfoAdjusted(int taskNumber,
    int taskAttemptNumber, int locality) {
  return job.getMapTaskAttemptInfoAdjusted(taskNumber, taskAttemptNumber,
      locality);
}
 
Example #20
Source File: DebugJobProducer.java    From big-c with Apache License 2.0 4 votes vote down vote up
@Override
public TaskAttemptInfo getMapTaskAttemptInfoAdjusted(
  int taskNumber, int taskAttemptNumber, int locality) {
  throw new UnsupportedOperationException();
}
 
Example #21
Source File: JobFactory.java    From big-c with Apache License 2.0 4 votes vote down vote up
public TaskAttemptInfo getMapTaskAttemptInfoAdjusted(
    int taskNumber, int taskAttemptNumber, int locality) {
  return job.getMapTaskAttemptInfoAdjusted(
      taskNumber, taskAttemptNumber, locality);
}
 
Example #22
Source File: JobFactory.java    From big-c with Apache License 2.0 4 votes vote down vote up
public TaskAttemptInfo getTaskAttemptInfo(TaskType taskType, int taskNumber,
    int taskAttemptNumber) {
  return job.getTaskAttemptInfo(taskType, taskNumber, taskAttemptNumber);
}
 
Example #23
Source File: DebugJobProducer.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@Override
public TaskAttemptInfo getMapTaskAttemptInfoAdjusted(
  int taskNumber, int taskAttemptNumber, int locality) {
  throw new UnsupportedOperationException();
}
 
Example #24
Source File: JobFactory.java    From hadoop with Apache License 2.0 4 votes vote down vote up
public TaskAttemptInfo getMapTaskAttemptInfoAdjusted(
    int taskNumber, int taskAttemptNumber, int locality) {
  return job.getMapTaskAttemptInfoAdjusted(
      taskNumber, taskAttemptNumber, locality);
}