本文整理汇总了Java中org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser.TaskAttemptInfo方法的典型用法代码示例。如果您正苦于以下问题:Java JobHistoryParser.TaskAttemptInfo方法的具体用法?Java JobHistoryParser.TaskAttemptInfo怎么用?Java JobHistoryParser.TaskAttemptInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser
的用法示例。
在下文中一共展示了JobHistoryParser.TaskAttemptInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTaskExecTime
import org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser; //导入方法依赖的package包/类
private long[] getTaskExecTime(JobHistoryParser.TaskAttemptInfo attempInfo) {
long startTime = attempInfo.getStartTime();
long finishTime = attempInfo.getFinishTime();
boolean isMapper = (attempInfo.getTaskType() == TaskType.MAP);
long[] time;
if (isMapper) {
time = new long[]{finishTime - startTime, 0, 0, startTime, finishTime};
} else {
long shuffleFinishTime = attempInfo.getShuffleFinishTime();
long mergeFinishTime = attempInfo.getSortFinishTime();
time = new long[]{finishTime - startTime, shuffleFinishTime - startTime,
mergeFinishTime - shuffleFinishTime, startTime, finishTime};
}
return time;
}
示例2: MockTaskInfo
import org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser; //导入方法依赖的package包/类
public MockTaskInfo(int id, boolean succeeded) {
this.taskId = new TaskID("job1", 1, TaskType.MAP, id);
this.taskType = TaskType.MAP;
this.succeeded = succeeded;
this.counters = new Counters();
this.finishTime = System.currentTimeMillis();
this.startTime = finishTime - 10000;
this.failedDueToAttemptId = new TaskAttemptID(taskId, 0);
this.successfulAttemptId = new TaskAttemptID(taskId, 1);
this.attemptsMap = new HashMap<TaskAttemptID, JobHistoryParser.TaskAttemptInfo>();
this.attemptsMap.put(failedDueToAttemptId, new JobHistoryParser.TaskAttemptInfo());
this.attemptsMap.put(successfulAttemptId, new JobHistoryParser.TaskAttemptInfo());
}
示例3: getAllTaskAttempts
import org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser; //导入方法依赖的package包/类
public Map<TaskAttemptID, JobHistoryParser.TaskAttemptInfo> getAllTaskAttempts() {
return attemptsMap;
}