本文整理汇总了Java中org.apache.hadoop.tools.rumen.TaskAttemptInfo类的典型用法代码示例。如果您正苦于以下问题:Java TaskAttemptInfo类的具体用法?Java TaskAttemptInfo怎么用?Java TaskAttemptInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TaskAttemptInfo类属于org.apache.hadoop.tools.rumen包,在下文中一共展示了TaskAttemptInfo类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSuccessfulAttemptInfo
import org.apache.hadoop.tools.rumen.TaskAttemptInfo; //导入依赖的package包/类
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;
}
示例2: getTaskAttemptInfo
import org.apache.hadoop.tools.rumen.TaskAttemptInfo; //导入依赖的package包/类
@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();
}
示例3: getTaskAttemptInfo
import org.apache.hadoop.tools.rumen.TaskAttemptInfo; //导入依赖的package包/类
@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();
}
示例4: getTaskAttemptInfo
import org.apache.hadoop.tools.rumen.TaskAttemptInfo; //导入依赖的package包/类
@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();
}
示例5: getReduceTaskAttemptInfo
import org.apache.hadoop.tools.rumen.TaskAttemptInfo; //导入依赖的package包/类
/**
* 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;
}
示例6: getReduceTaskAttemptInfo
import org.apache.hadoop.tools.rumen.TaskAttemptInfo; //导入依赖的package包/类
/**
* 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.getTaskType() == TaskType.REDUCE);
TaskID taskId = taskAttemptID.getTaskID();
TaskType taskType = taskAttemptID.getTaskType();
TaskAttemptInfo taskAttemptInfo = jobStory.getTaskAttemptInfo(taskType,
taskId.getId(), taskAttemptID.getId());
if (LOG.isDebugEnabled()) {
LOG.debug("get an attempt: "
+ taskAttemptID.toString()
+ ", state="
+ taskAttemptInfo.getRunState()
+ ", runtime="
+ ((taskType == TaskType.MAP) ? taskAttemptInfo.getRuntime()
: ((ReduceTaskAttemptInfo) taskAttemptInfo).getReduceRuntime()));
}
return taskAttemptInfo;
}
示例7: getMapTaskAttemptInfo
import org.apache.hadoop.tools.rumen.TaskAttemptInfo; //导入依赖的package包/类
/**
* 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;
}
示例8: getTaskAttemptInfo
import org.apache.hadoop.tools.rumen.TaskAttemptInfo; //导入依赖的package包/类
@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);
}
示例9: getMapTaskAttemptInfo
import org.apache.hadoop.tools.rumen.TaskAttemptInfo; //导入依赖的package包/类
/**
* 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.getTaskType() == TaskType.MAP);
JobID jobid = (JobID) taskAttemptID.getJobID();
assert (jobid == getJobID());
// Get splits for the TaskAttempt
TaskSplitMetaInfo split =
taskSplitMetaInfo[taskAttemptID.getTaskID().getId()];
int locality = getClosestLocality(taskTracker, split);
TaskID taskId = taskAttemptID.getTaskID();
TaskType taskType = taskAttemptID.getTaskType();
if (taskId.getTaskType() != TaskType.MAP) {
assert false : "Task " + taskId + " is not MAP :" + taskId.getTaskType();
}
TaskAttemptInfo taskAttemptInfo = jobStory.getMapTaskAttemptInfoAdjusted(
taskId.getId(), taskAttemptID.getId(), locality);
if (LOG.isDebugEnabled()) {
LOG.debug("get an attempt: "
+ taskAttemptID.toString()
+ ", state="
+ taskAttemptInfo.getRunState()
+ ", runtime="
+ ((taskType == TaskType.MAP) ? taskAttemptInfo.getRuntime()
: ((ReduceTaskAttemptInfo) taskAttemptInfo).getReduceRuntime()));
}
return taskAttemptInfo;
}
示例10: getTaskAttemptInfo
import org.apache.hadoop.tools.rumen.TaskAttemptInfo; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public TaskAttemptInfo getTaskAttemptInfo(TaskTracker taskTracker,
TaskAttemptID taskAttemptId) {
JobID jobid = (JobID) taskAttemptId.getJobID();
assert (jobid == getJobID());
return (taskAttemptId.getTaskType() == TaskType.MAP) ? getMapTaskAttemptInfo(
taskTracker, taskAttemptId)
: getReduceTaskAttemptInfo(taskTracker, taskAttemptId);
}
示例11: getTaskAttemptInfo
import org.apache.hadoop.tools.rumen.TaskAttemptInfo; //导入依赖的package包/类
public TaskAttemptInfo getTaskAttemptInfo(TaskType taskType, int taskNumber,
int taskAttemptNumber) {
return job.getTaskAttemptInfo(taskType, taskNumber, taskAttemptNumber);
}