当前位置: 首页>>代码示例>>Java>>正文


Java TaskAttemptStateInternal.FAILED属性代码示例

本文整理汇总了Java中org.apache.hadoop.mapreduce.v2.app.job.TaskAttemptStateInternal.FAILED属性的典型用法代码示例。如果您正苦于以下问题:Java TaskAttemptStateInternal.FAILED属性的具体用法?Java TaskAttemptStateInternal.FAILED怎么用?Java TaskAttemptStateInternal.FAILED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.hadoop.mapreduce.v2.app.job.TaskAttemptStateInternal的用法示例。


在下文中一共展示了TaskAttemptStateInternal.FAILED属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isFinished

@Override
public boolean isFinished() {
  readLock.lock();
  try {
    // TODO: Use stateMachine level method?
    return (getInternalState() == TaskAttemptStateInternal.SUCCEEDED || 
            getInternalState() == TaskAttemptStateInternal.FAILED ||
            getInternalState() == TaskAttemptStateInternal.KILLED);
  } finally {
    readLock.unlock();
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:TaskAttemptImpl.java

示例2: handle

@SuppressWarnings("unchecked")
@Override
public void handle(TaskAttemptEvent event) {
  if (LOG.isDebugEnabled()) {
    LOG.debug("Processing " + event.getTaskAttemptID() + " of type "
        + event.getType());
  }
  writeLock.lock();
  try {
    final TaskAttemptStateInternal oldState = getInternalState()  ;
    try {
      stateMachine.doTransition(event.getType(), event);
    } catch (InvalidStateTransitionException e) {
      LOG.error("Can't handle this event at current state for "
          + this.attemptId, e);
      eventHandler.handle(new JobDiagnosticsUpdateEvent(
          this.attemptId.getTaskId().getJobId(), "Invalid event " + event.getType() + 
          " on TaskAttempt " + this.attemptId));
      eventHandler.handle(new JobEvent(this.attemptId.getTaskId().getJobId(),
          JobEventType.INTERNAL_ERROR));
    }
    if (oldState != getInternalState()) {
      if (getInternalState() == TaskAttemptStateInternal.FAILED) {
        String nodeId = null == this.container ? "Not-assigned"
            : this.container.getNodeId().toString();
        LOG.info(attemptId + " transitioned from state " + oldState + " to "
            + getInternalState() + ", event type is " + event.getType()
            + " and nodeId=" + nodeId);
      } else {
        LOG.info(attemptId + " TaskAttempt Transitioned from " + oldState
            + " to " + getInternalState());
      }
    }
  } finally {
    writeLock.unlock();
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:37,代码来源:TaskAttemptImpl.java

示例3: transition

@SuppressWarnings("unchecked")
@Override
public void transition(TaskAttemptImpl taskAttempt, 
    TaskAttemptEvent event) {
  //set the finish time
  taskAttempt.setFinishTime();

  if (event instanceof TaskAttemptKillEvent) {
    taskAttempt.addDiagnosticInfo(
        ((TaskAttemptKillEvent) event).getMessage());
  }

  //send the deallocate event to ContainerAllocator
  taskAttempt.eventHandler.handle(
      new ContainerAllocatorEvent(taskAttempt.attemptId,
      ContainerAllocator.EventType.CONTAINER_DEALLOCATE));

  // send event to speculator that we withdraw our container needs, if
  //  we're transitioning out of UNASSIGNED
  if (withdrawsContainerRequest) {
    taskAttempt.eventHandler.handle
        (new SpeculatorEvent(taskAttempt.getID().getTaskId(), -1));
  }

  switch(finalState) {
    case FAILED:
      taskAttempt.eventHandler.handle(new TaskTAttemptEvent(
          taskAttempt.attemptId,
          TaskEventType.T_ATTEMPT_FAILED));
      break;
    case KILLED:
      taskAttempt.eventHandler.handle(new TaskTAttemptEvent(
          taskAttempt.attemptId,
          TaskEventType.T_ATTEMPT_KILLED));
      break;
    default:
      LOG.error("Task final state is not FAILED or KILLED: " + finalState);
  }
  if (taskAttempt.getLaunchTime() != 0) {
    TaskAttemptUnsuccessfulCompletionEvent tauce =
        createTaskAttemptUnsuccessfulCompletionEvent(taskAttempt,
            finalState);
    if(finalState == TaskAttemptStateInternal.FAILED) {
      taskAttempt.eventHandler
        .handle(createJobCounterUpdateEventTAFailed(taskAttempt, false));
    } else if(finalState == TaskAttemptStateInternal.KILLED) {
      taskAttempt.eventHandler
      .handle(createJobCounterUpdateEventTAKilled(taskAttempt, false));
    }
    taskAttempt.eventHandler.handle(new JobHistoryEvent(
        taskAttempt.attemptId.getTaskId().getJobId(), tauce));
  } else {
    LOG.debug("Not generating HistoryFinish event since start event not " +
        "generated for taskAttempt: " + taskAttempt.getID());
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:56,代码来源:TaskAttemptImpl.java

示例4: transition

@SuppressWarnings("unchecked")
@Override
public void transition(TaskAttemptImpl taskAttempt, 
    TaskAttemptEvent event) {
  if (taskAttempt.getLaunchTime() == 0) {
    sendJHStartEventForAssignedFailTask(taskAttempt);
  }
  //set the finish time
  taskAttempt.setFinishTime();

  if (event instanceof TaskAttemptKillEvent) {
    taskAttempt.addDiagnosticInfo(
        ((TaskAttemptKillEvent) event).getMessage());
  }

  //send the deallocate event to ContainerAllocator
  taskAttempt.eventHandler.handle(
      new ContainerAllocatorEvent(taskAttempt.attemptId,
      ContainerAllocator.EventType.CONTAINER_DEALLOCATE));

  // send event to speculator that we withdraw our container needs, if
  //  we're transitioning out of UNASSIGNED
  if (withdrawsContainerRequest) {
    taskAttempt.eventHandler.handle
        (new SpeculatorEvent(taskAttempt.getID().getTaskId(), -1));
  }

  switch(finalState) {
    case FAILED:
      taskAttempt.eventHandler.handle(new TaskTAttemptEvent(
          taskAttempt.attemptId,
          TaskEventType.T_ATTEMPT_FAILED));
      break;
    case KILLED:
      taskAttempt.eventHandler.handle(new TaskTAttemptEvent(
          taskAttempt.attemptId,
          TaskEventType.T_ATTEMPT_KILLED));
      break;
    default:
      LOG.error("Task final state is not FAILED or KILLED: " + finalState);
  }

  TaskAttemptUnsuccessfulCompletionEvent tauce =
      createTaskAttemptUnsuccessfulCompletionEvent(taskAttempt,
          finalState);
  if(finalState == TaskAttemptStateInternal.FAILED) {
    taskAttempt.eventHandler
      .handle(createJobCounterUpdateEventTAFailed(taskAttempt, false));
  } else if(finalState == TaskAttemptStateInternal.KILLED) {
    taskAttempt.eventHandler
    .handle(createJobCounterUpdateEventTAKilled(taskAttempt, false));
  }
  taskAttempt.eventHandler.handle(new JobHistoryEvent(
      taskAttempt.attemptId.getTaskId().getJobId(), tauce));
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:55,代码来源:TaskAttemptImpl.java

示例5: transition

@SuppressWarnings("unchecked")
@Override
public void transition(TaskAttemptImpl taskAttempt, 
    TaskAttemptEvent event) {
  //set the finish time
  taskAttempt.setFinishTime();
  //send the deallocate event to ContainerAllocator
  taskAttempt.eventHandler.handle(
      new ContainerAllocatorEvent(taskAttempt.attemptId,
      ContainerAllocator.EventType.CONTAINER_DEALLOCATE));

  // send event to speculator that we withdraw our container needs, if
  //  we're transitioning out of UNASSIGNED
  if (withdrawsContainerRequest) {
    taskAttempt.eventHandler.handle
        (new SpeculatorEvent(taskAttempt.getID().getTaskId(), -1));
  }

  switch(finalState) {
    case FAILED:
      taskAttempt.eventHandler.handle(new TaskTAttemptEvent(
          taskAttempt.attemptId,
          TaskEventType.T_ATTEMPT_FAILED));
      break;
    case KILLED:
      taskAttempt.eventHandler.handle(new TaskTAttemptEvent(
          taskAttempt.attemptId,
          TaskEventType.T_ATTEMPT_KILLED));
      break;
    default:
      LOG.error("Task final state is not FAILED or KILLED: " + finalState);
  }
  if (taskAttempt.getLaunchTime() != 0) {
    TaskAttemptUnsuccessfulCompletionEvent tauce =
        createTaskAttemptUnsuccessfulCompletionEvent(taskAttempt,
            finalState);
    if(finalState == TaskAttemptStateInternal.FAILED) {
      taskAttempt.eventHandler
        .handle(createJobCounterUpdateEventTAFailed(taskAttempt, false));
    } else if(finalState == TaskAttemptStateInternal.KILLED) {
      taskAttempt.eventHandler
      .handle(createJobCounterUpdateEventTAKilled(taskAttempt, false));
    }
    taskAttempt.eventHandler.handle(new JobHistoryEvent(
        taskAttempt.attemptId.getTaskId().getJobId(), tauce));
  } else {
    LOG.debug("Not generating HistoryFinish event since start event not " +
        "generated for taskAttempt: " + taskAttempt.getID());
  }
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:50,代码来源:TaskAttemptImpl.java

示例6: transition

@SuppressWarnings("unchecked")
@Override
public void transition(TaskAttemptImpl taskAttempt, 
    TaskAttemptEvent event) {
  if (taskAttempt.getLaunchTime() == 0) {
    sendJHStartEventForAssignedFailTask(taskAttempt);
  }
  //set the finish time
  taskAttempt.setFinishTime();

  if (event instanceof TaskAttemptKillEvent) {
    taskAttempt.addDiagnosticInfo(
        ((TaskAttemptKillEvent) event).getMessage());
  }

  //send the deallocate event to ContainerAllocator
  taskAttempt.eventHandler.handle(
      new ContainerAllocatorEvent(taskAttempt.attemptId,
      ContainerAllocator.EventType.CONTAINER_DEALLOCATE));

  // send event to speculator that we withdraw our container needs, if
  //  we're transitioning out of UNASSIGNED
  if (withdrawsContainerRequest) {
    taskAttempt.eventHandler.handle
        (new SpeculatorEvent(taskAttempt.getID().getTaskId(), -1));
  }

  switch(finalState) {
    case FAILED:
      taskAttempt.eventHandler.handle(new TaskTAttemptEvent(
          taskAttempt.attemptId,
          TaskEventType.T_ATTEMPT_FAILED));
      break;
    case KILLED:
      taskAttempt.eventHandler.handle(new TaskTAttemptKilledEvent(
          taskAttempt.attemptId, false));
      break;
    default:
      LOG.error("Task final state is not FAILED or KILLED: " + finalState);
  }

  TaskAttemptUnsuccessfulCompletionEvent tauce =
      createTaskAttemptUnsuccessfulCompletionEvent(taskAttempt,
          finalState);
  if(finalState == TaskAttemptStateInternal.FAILED) {
    taskAttempt.eventHandler
      .handle(createJobCounterUpdateEventTAFailed(taskAttempt, false));
  } else if(finalState == TaskAttemptStateInternal.KILLED) {
    taskAttempt.eventHandler
    .handle(createJobCounterUpdateEventTAKilled(taskAttempt, false));
  }
  taskAttempt.eventHandler.handle(new JobHistoryEvent(
      taskAttempt.attemptId.getTaskId().getJobId(), tauce));
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:54,代码来源:TaskAttemptImpl.java


注:本文中的org.apache.hadoop.mapreduce.v2.app.job.TaskAttemptStateInternal.FAILED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。