/** * Absorbs one TaskAttemptStatus * * @param reportedStatus the status report that we got from a task attempt * that we want to fold into the speculation data for this job * @param timestamp the time this status corresponds to. This matters * because statuses contain progress. */ protected void statusUpdate(TaskAttemptStatus reportedStatus, long timestamp) { String stateString = reportedStatus.taskState.toString(); TaskAttemptId attemptID = reportedStatus.id; TaskId taskID = attemptID.getTaskId(); Job job = context.getJob(taskID.getJobId()); if (job == null) { return; } Task task = job.getTask(taskID); if (task == null) { return; } estimator.updateAttempt(reportedStatus, timestamp); if (stateString.equals(TaskAttemptState.RUNNING.name())) { runningTasks.putIfAbsent(taskID, Boolean.TRUE); } else { runningTasks.remove(taskID, Boolean.TRUE); if (!stateString.equals(TaskAttemptState.STARTING.name())) { runningTaskAttemptStatistics.remove(attemptID); } } }
public static TaskAttemptState convertFromProtoFormat(TaskAttemptStateProto e) { return TaskAttemptState.valueOf(e.name().replace(TASK_ATTEMPT_STATE_PREFIX, "")); }
public String getState() { return this.state.toString(); }
public static TaskAttemptStateProto convertToProtoFormat(TaskAttemptState e) { return TaskAttemptStateProto.valueOf(TASK_ATTEMPT_STATE_PREFIX + e.name()); } public static TaskAttemptState convertFromProtoFormat(TaskAttemptStateProto e) {
public void waitForState(TaskAttempt attempt, TaskAttemptState finalState) throws Exception { int timeoutSecs = 0; TaskAttemptReport report = attempt.getReport(); while (!finalState.equals(report.getTaskAttemptState()) && timeoutSecs++ < 20) { System.out.println("TaskAttempt State is : " + report.getTaskAttemptState() + " Waiting for state : " + finalState + " progress : " + report.getProgress()); report = attempt.getReport(); Thread.sleep(500); } System.out.println("TaskAttempt State is : " + report.getTaskAttemptState()); Assert.assertEquals("TaskAttempt state is not correct (timedout)", finalState, report.getTaskAttemptState()); }
public String getState() { return this.state.toString(); }
public static TaskAttemptStateProto convertToProtoFormat(TaskAttemptState e) { return TaskAttemptStateProto.valueOf(TASK_ATTEMPT_STATE_PREFIX + e.name()); } public static TaskAttemptState convertFromProtoFormat(TaskAttemptStateProto e) {
if (TaskAttemptState.RUNNING.equals(attempt.getState())) { report.addRunningAttempt(attempt.getID());
public String getState() { return this.state.toString(); }
/** * Absorbs one TaskAttemptStatus * * @param reportedStatus the status report that we got from a task attempt * that we want to fold into the speculation data for this job * @param timestamp the time this status corresponds to. This matters * because statuses contain progress. */ protected void statusUpdate(TaskAttemptStatus reportedStatus, long timestamp) { String stateString = reportedStatus.taskState.toString(); TaskAttemptId attemptID = reportedStatus.id; TaskId taskID = attemptID.getTaskId(); Job job = context.getJob(taskID.getJobId()); if (job == null) { return; } Task task = job.getTask(taskID); if (task == null) { return; } estimator.updateAttempt(reportedStatus, timestamp); if (stateString.equals(TaskAttemptState.RUNNING.name())) { runningTasks.putIfAbsent(taskID, Boolean.TRUE); } else { runningTasks.remove(taskID, Boolean.TRUE); if (!stateString.equals(TaskAttemptState.STARTING.name())) { runningTaskAttemptStatistics.remove(attemptID); } } }
public static TaskAttemptState convertFromProtoFormat(TaskAttemptStateProto e) { return TaskAttemptState.valueOf(e.name().replace(TASK_ATTEMPT_STATE_PREFIX, "")); }
public static TaskAttemptStateProto convertToProtoFormat(TaskAttemptState e) { return TaskAttemptStateProto.valueOf(TASK_ATTEMPT_STATE_PREFIX + e.name()); } public static TaskAttemptState convertFromProtoFormat(TaskAttemptStateProto e) {
if (TaskAttemptState.RUNNING.equals(attempt.getState())) { report.addRunningAttempt(attempt.getID());
@GET @Path("/jobs/{jobid}/tasks/{taskid}/attempts/{attemptid}/state") @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 }) public JobTaskAttemptState getJobTaskAttemptState( @Context HttpServletRequest hsr, @PathParam("jobid") String jid, @PathParam("taskid") String tid, @PathParam("attemptid") String attId) throws IOException, InterruptedException { init(); Job job = getJobFromJobIdString(jid, appCtx); checkAccess(job, hsr); Task task = getTaskFromTaskIdString(tid, job); TaskAttempt ta = getTaskAttemptFromTaskAttemptString(attId, task); return new JobTaskAttemptState(ta.getState().toString()); }
/** * Absorbs one TaskAttemptStatus * * @param reportedStatus the status report that we got from a task attempt * that we want to fold into the speculation data for this job * @param timestamp the time this status corresponds to. This matters * because statuses contain progress. */ protected void statusUpdate(TaskAttemptStatus reportedStatus, long timestamp) { String stateString = reportedStatus.taskState.toString(); TaskAttemptId attemptID = reportedStatus.id; TaskId taskID = attemptID.getTaskId(); Job job = context.getJob(taskID.getJobId()); if (job == null) { return; } Task task = job.getTask(taskID); if (task == null) { return; } estimator.updateAttempt(reportedStatus, timestamp); if (stateString.equals(TaskAttemptState.RUNNING.name())) { runningTasks.putIfAbsent(taskID, Boolean.TRUE); } else { runningTasks.remove(taskID, Boolean.TRUE); if (!stateString.equals(TaskAttemptState.STARTING.name())) { runningTaskAttemptStatistics.remove(attemptID); } } }
public static TaskAttemptState convertFromProtoFormat(TaskAttemptStateProto e) { return TaskAttemptState.valueOf(e.name().replace(TASK_ATTEMPT_STATE_PREFIX, "")); }
public static TaskAttemptStateProto convertToProtoFormat(TaskAttemptState e) { return TaskAttemptStateProto.valueOf(TASK_ATTEMPT_STATE_PREFIX + e.name()); } public static TaskAttemptState convertFromProtoFormat(TaskAttemptStateProto e) {
if (TaskAttemptState.RUNNING.equals(attempt.getState())) { report.addRunningAttempt(attempt.getID());
@GET @Path("/jobs/{jobid}/tasks/{taskid}/attempts/{attemptid}/state") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public JobTaskAttemptState getJobTaskAttemptState( @Context HttpServletRequest hsr, @PathParam("jobid") String jid, @PathParam("taskid") String tid, @PathParam("attemptid") String attId) throws IOException, InterruptedException { init(); Job job = getJobFromJobIdString(jid, appCtx); checkAccess(job, hsr); Task task = getTaskFromTaskIdString(tid, job); TaskAttempt ta = getTaskAttemptFromTaskAttemptString(attId, task); return new JobTaskAttemptState(ta.getState().toString()); }
public static TaskAttemptState convertFromProtoFormat(TaskAttemptStateProto e) { return TaskAttemptState.valueOf(e.name().replace(TASK_ATTEMPT_STATE_PREFIX, "")); }