Java Code Examples for org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants.Values#SUCCESS

The following examples show how to use org.apache.hadoop.tools.rumen.Pre21JobHistoryConstants.Values#SUCCESS . 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: JobBuilder.java    From hadoop with Apache License 2.0 6 votes vote down vote up
private static Values getPre21Value(String name) {
  if (name.equalsIgnoreCase("JOB_CLEANUP")) {
    return Values.CLEANUP;
  }
  if (name.equalsIgnoreCase("JOB_SETUP")) {
    return Values.SETUP;
  }

  // Note that pre-21, the task state of a successful task was logged as 
  // SUCCESS while from 21 onwards, its logged as SUCCEEDED.
  if (name.equalsIgnoreCase(TaskStatus.State.SUCCEEDED.toString())) {
    return Values.SUCCESS;
  }
  
  return Values.valueOf(StringUtils.toUpperCase(name));
}
 
Example 2
Source File: JobBuilder.java    From big-c with Apache License 2.0 6 votes vote down vote up
private static Values getPre21Value(String name) {
  if (name.equalsIgnoreCase("JOB_CLEANUP")) {
    return Values.CLEANUP;
  }
  if (name.equalsIgnoreCase("JOB_SETUP")) {
    return Values.SETUP;
  }

  // Note that pre-21, the task state of a successful task was logged as 
  // SUCCESS while from 21 onwards, its logged as SUCCEEDED.
  if (name.equalsIgnoreCase(TaskStatus.State.SUCCEEDED.toString())) {
    return Values.SUCCESS;
  }
  
  return Values.valueOf(StringUtils.toUpperCase(name));
}
 
Example 3
Source File: ZombieJob.java    From hadoop with Apache License 2.0 5 votes vote down vote up
private static State convertState(Values status) {
  if (status == Values.SUCCESS) {
    return State.SUCCEEDED;
  } else if (status == Values.FAILED) {
    return State.FAILED;
  } else if (status == Values.KILLED) {
    return State.KILLED;
  } else {
    throw new IllegalArgumentException("unknown status " + status);
  }
}
 
Example 4
Source File: ZombieJob.java    From big-c with Apache License 2.0 5 votes vote down vote up
private static State convertState(Values status) {
  if (status == Values.SUCCESS) {
    return State.SUCCEEDED;
  } else if (status == Values.FAILED) {
    return State.FAILED;
  } else if (status == Values.KILLED) {
    return State.KILLED;
  } else {
    throw new IllegalArgumentException("unknown status " + status);
  }
}
 
Example 5
Source File: ZombieJob.java    From RDFS with Apache License 2.0 5 votes vote down vote up
private static State convertState(Values status) {
  if (status == Values.SUCCESS) {
    return State.SUCCEEDED;
  } else if (status == Values.FAILED) {
    return State.FAILED;
  } else if (status == Values.KILLED) {
    return State.KILLED;
  } else {
    throw new IllegalArgumentException("unknown status " + status);
  }
}
 
Example 6
Source File: ZombieJob.java    From hadoop with Apache License 2.0 4 votes vote down vote up
private TaskInfo getTaskInfo(LoggedTask loggedTask) {
  if (loggedTask == null) {
    return new TaskInfo(0, 0, 0, 0, 0);
  }
  List<LoggedTaskAttempt> attempts = loggedTask.getAttempts();

  long inputBytes = -1;
  long inputRecords = -1;
  long outputBytes = -1;
  long outputRecords = -1;
  long heapMegabytes = -1;
  ResourceUsageMetrics metrics = new ResourceUsageMetrics();

  Values type = loggedTask.getTaskType();
  if ((type != Values.MAP) && (type != Values.REDUCE)) {
    throw new IllegalArgumentException(
        "getTaskInfo only supports MAP or REDUCE tasks: " + type.toString()
            + " for task = " + loggedTask.getTaskID());
  }

  for (LoggedTaskAttempt attempt : attempts) {
    attempt = sanitizeLoggedTaskAttempt(attempt);
    // ignore bad attempts or unsuccessful attempts.
    if ((attempt == null) || (attempt.getResult() != Values.SUCCESS)) {
      continue;
    }

    if (type == Values.MAP) {
      inputBytes = attempt.getHdfsBytesRead();
      inputRecords = attempt.getMapInputRecords();
      outputBytes =
          (job.getTotalReduces() > 0) ? attempt.getMapOutputBytes() : attempt
              .getHdfsBytesWritten();
      outputRecords = attempt.getMapOutputRecords();
      heapMegabytes =
          (job.getJobMapMB() > 0) ? job.getJobMapMB() : job
              .getHeapMegabytes();
    } else {
      inputBytes = attempt.getReduceShuffleBytes();
      inputRecords = attempt.getReduceInputRecords();
      outputBytes = attempt.getHdfsBytesWritten();
      outputRecords = attempt.getReduceOutputRecords();
      heapMegabytes =
          (job.getJobReduceMB() > 0) ? job.getJobReduceMB() : job
              .getHeapMegabytes();
    }
    // set the resource usage metrics
    metrics = attempt.getResourceUsageMetrics();
    break;
  }

  TaskInfo taskInfo =
      new TaskInfo(inputBytes, (int) inputRecords, outputBytes,
          (int) outputRecords, (int) heapMegabytes,
          metrics);
  return taskInfo;
}
 
Example 7
Source File: DebugJobProducer.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@Override
public Values getOutcome() {
  return Values.SUCCESS;
 }
 
Example 8
Source File: ZombieJob.java    From big-c with Apache License 2.0 4 votes vote down vote up
private TaskInfo getTaskInfo(LoggedTask loggedTask) {
  if (loggedTask == null) {
    return new TaskInfo(0, 0, 0, 0, 0);
  }
  List<LoggedTaskAttempt> attempts = loggedTask.getAttempts();

  long inputBytes = -1;
  long inputRecords = -1;
  long outputBytes = -1;
  long outputRecords = -1;
  long heapMegabytes = -1;
  ResourceUsageMetrics metrics = new ResourceUsageMetrics();

  Values type = loggedTask.getTaskType();
  if ((type != Values.MAP) && (type != Values.REDUCE)) {
    throw new IllegalArgumentException(
        "getTaskInfo only supports MAP or REDUCE tasks: " + type.toString()
            + " for task = " + loggedTask.getTaskID());
  }

  for (LoggedTaskAttempt attempt : attempts) {
    attempt = sanitizeLoggedTaskAttempt(attempt);
    // ignore bad attempts or unsuccessful attempts.
    if ((attempt == null) || (attempt.getResult() != Values.SUCCESS)) {
      continue;
    }

    if (type == Values.MAP) {
      inputBytes = attempt.getHdfsBytesRead();
      inputRecords = attempt.getMapInputRecords();
      outputBytes =
          (job.getTotalReduces() > 0) ? attempt.getMapOutputBytes() : attempt
              .getHdfsBytesWritten();
      outputRecords = attempt.getMapOutputRecords();
      heapMegabytes =
          (job.getJobMapMB() > 0) ? job.getJobMapMB() : job
              .getHeapMegabytes();
    } else {
      inputBytes = attempt.getReduceShuffleBytes();
      inputRecords = attempt.getReduceInputRecords();
      outputBytes = attempt.getHdfsBytesWritten();
      outputRecords = attempt.getReduceOutputRecords();
      heapMegabytes =
          (job.getJobReduceMB() > 0) ? job.getJobReduceMB() : job
              .getHeapMegabytes();
    }
    // set the resource usage metrics
    metrics = attempt.getResourceUsageMetrics();
    break;
  }

  TaskInfo taskInfo =
      new TaskInfo(inputBytes, (int) inputRecords, outputBytes,
          (int) outputRecords, (int) heapMegabytes,
          metrics);
  return taskInfo;
}
 
Example 9
Source File: DebugJobProducer.java    From big-c with Apache License 2.0 4 votes vote down vote up
@Override
public Values getOutcome() {
  return Values.SUCCESS;
 }
 
Example 10
Source File: ZombieJob.java    From RDFS with Apache License 2.0 4 votes vote down vote up
private TaskInfo getTaskInfo(LoggedTask loggedTask) {
  List<LoggedTaskAttempt> attempts = loggedTask.getAttempts();

  long inputBytes = -1;
  long inputRecords = -1;
  long outputBytes = -1;
  long outputRecords = -1;
  long heapMegabytes = -1;

  Values type = loggedTask.getTaskType();
  if ((type != Values.MAP) && (type != Values.REDUCE)) {
    throw new IllegalArgumentException(
        "getTaskInfo only supports MAP or REDUCE tasks: " + type.toString()
            + " for task = " + loggedTask.getTaskID());
  }

  for (LoggedTaskAttempt attempt : attempts) {
    attempt = sanitizeLoggedTaskAttempt(attempt);
    // ignore bad attempts or unsuccessful attempts.
    if ((attempt == null) || (attempt.getResult() != Values.SUCCESS)) {
      continue;
    }

    if (type == Values.MAP) {
      inputBytes = attempt.getHdfsBytesRead();
      inputRecords = attempt.getMapInputRecords();
      outputBytes =
          (job.getTotalReduces() > 0) ? attempt.getMapOutputBytes() : attempt
              .getHdfsBytesWritten();
      outputRecords = attempt.getMapOutputRecords();
      heapMegabytes =
          (job.getJobMapMB() > 0) ? job.getJobMapMB() : job
              .getHeapMegabytes();
    } else {
      inputBytes = attempt.getReduceShuffleBytes();
      inputRecords = attempt.getReduceInputRecords();
      outputBytes = attempt.getHdfsBytesWritten();
      outputRecords = attempt.getReduceOutputRecords();
      heapMegabytes =
          (job.getJobReduceMB() > 0) ? job.getJobReduceMB() : job
              .getHeapMegabytes();
    }
    break;
  }

  TaskInfo taskInfo =
      new TaskInfo(inputBytes, (int) inputRecords, outputBytes,
          (int) outputRecords, (int) heapMegabytes);
  return taskInfo;
}
 
Example 11
Source File: DebugJobFactory.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public Values getOutcome() {
  return Values.SUCCESS;
}