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


Java TaskAttemptDiagnosticsUpdateEvent类代码示例

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


TaskAttemptDiagnosticsUpdateEvent类属于org.apache.hadoop.mapreduce.v2.app.job.event包,在下文中一共展示了TaskAttemptDiagnosticsUpdateEvent类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reportDiagnosticInfo

import org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptDiagnosticsUpdateEvent; //导入依赖的package包/类
@Override
 public void reportDiagnosticInfo(TaskAttemptID taskAttemptID, String diagnosticInfo)
throws IOException {
   diagnosticInfo = StringInterner.weakIntern(diagnosticInfo);
   LOG.info("Diagnostics report from " + taskAttemptID.toString() + ": "
       + diagnosticInfo);

   org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID =
     TypeConverter.toYarn(taskAttemptID);
   taskHeartbeatHandler.progressing(attemptID);

   // This is mainly used for cases where we want to propagate exception traces
   // of tasks that fail.

   // This call exists as a hadoop mapreduce legacy wherein all changes in
   // counters/progress/phase/output-size are reported through statusUpdate()
   // call but not diagnosticInformation.
   context.getEventHandler().handle(
       new TaskAttemptDiagnosticsUpdateEvent(attemptID, diagnosticInfo));
 }
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:TaskAttemptListenerImpl.java

示例2: killTaskAttempt

import org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptDiagnosticsUpdateEvent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public KillTaskAttemptResponse killTaskAttempt(
    KillTaskAttemptRequest request) throws IOException {
  TaskAttemptId taskAttemptId = request.getTaskAttemptId();
  UserGroupInformation callerUGI = UserGroupInformation.getCurrentUser();
  String message = "Kill task attempt " + taskAttemptId
      + " received from " + callerUGI + " at "
      + Server.getRemoteAddress();
  LOG.info(message);
  verifyAndGetAttempt(taskAttemptId, JobACL.MODIFY_JOB);
  appContext.getEventHandler().handle(
      new TaskAttemptDiagnosticsUpdateEvent(taskAttemptId, message));
  appContext.getEventHandler().handle(
      new TaskAttemptEvent(taskAttemptId, 
          TaskAttemptEventType.TA_KILL));
  KillTaskAttemptResponse response = 
    recordFactory.newRecordInstance(KillTaskAttemptResponse.class);
  return response;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:MRClientService.java

示例3: failTaskAttempt

import org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptDiagnosticsUpdateEvent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public FailTaskAttemptResponse failTaskAttempt(
    FailTaskAttemptRequest request) throws IOException {
  TaskAttemptId taskAttemptId = request.getTaskAttemptId();
  UserGroupInformation callerUGI = UserGroupInformation.getCurrentUser();
  String message = "Fail task attempt " + taskAttemptId
      + " received from " + callerUGI + " at "
      + Server.getRemoteAddress();
  LOG.info(message);
  verifyAndGetAttempt(taskAttemptId, JobACL.MODIFY_JOB);
  appContext.getEventHandler().handle(
      new TaskAttemptDiagnosticsUpdateEvent(taskAttemptId, message));
  appContext.getEventHandler().handle(
      new TaskAttemptEvent(taskAttemptId, 
          TaskAttemptEventType.TA_FAILMSG));
  FailTaskAttemptResponse response = recordFactory.
    newRecordInstance(FailTaskAttemptResponse.class);
  return response;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:MRClientService.java

示例4: failTaskAttempt

import org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptDiagnosticsUpdateEvent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public FailTaskAttemptResponse failTaskAttempt(
    FailTaskAttemptRequest request) throws IOException {
  TaskAttemptId taskAttemptId = request.getTaskAttemptId();
  UserGroupInformation callerUGI = UserGroupInformation.getCurrentUser();
  String message = "Fail task attempt " + taskAttemptId
      + " received from " + callerUGI + " at "
      + Server.getRemoteAddress();
  LOG.info(message);
  verifyAndGetAttempt(taskAttemptId, JobACL.MODIFY_JOB);
  appContext.getEventHandler().handle(
      new TaskAttemptDiagnosticsUpdateEvent(taskAttemptId, message));
  appContext.getEventHandler().handle(
      new TaskAttemptEvent(taskAttemptId, 
          TaskAttemptEventType.TA_FAILMSG_BY_CLIENT));
  FailTaskAttemptResponse response = recordFactory.
    newRecordInstance(FailTaskAttemptResponse.class);
  return response;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:21,代码来源:MRClientService.java

示例5: testTaskAttemptDiagnosticEventOnFinishing

import org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptDiagnosticsUpdateEvent; //导入依赖的package包/类
@Test
public void testTaskAttemptDiagnosticEventOnFinishing() throws Exception {
  MockEventHandler eventHandler = new MockEventHandler();
  TaskAttemptImpl taImpl = createTaskAttemptImpl(eventHandler);

  taImpl.handle(new TaskAttemptEvent(taImpl.getID(),
      TaskAttemptEventType.TA_DONE));

  assertEquals("Task attempt is not in RUNNING state", taImpl.getState(),
      TaskAttemptState.SUCCEEDED);
  assertEquals("Task attempt's internal state is not " +
      "SUCCESS_FINISHING_CONTAINER", taImpl.getInternalState(),
      TaskAttemptStateInternal.SUCCESS_FINISHING_CONTAINER);

  // TA_DIAGNOSTICS_UPDATE doesn't change state
  taImpl.handle(new TaskAttemptDiagnosticsUpdateEvent(taImpl.getID(),
      "Task got updated"));
  assertEquals("Task attempt is not in RUNNING state", taImpl.getState(),
      TaskAttemptState.SUCCEEDED);
  assertEquals("Task attempt's internal state is not " +
      "SUCCESS_FINISHING_CONTAINER", taImpl.getInternalState(),
      TaskAttemptStateInternal.SUCCESS_FINISHING_CONTAINER);

  assertFalse("InternalError occurred", eventHandler.internalError);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:26,代码来源:TestTaskAttempt.java

示例6: killTaskAttempt

import org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptDiagnosticsUpdateEvent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public KillTaskAttemptResponse killTaskAttempt(
    KillTaskAttemptRequest request) throws IOException {
  TaskAttemptId taskAttemptId = request.getTaskAttemptId();
  String message = "Kill task attempt received from client " + taskAttemptId;
  LOG.info(message);
  verifyAndGetAttempt(taskAttemptId, true);
  appContext.getEventHandler().handle(
      new TaskAttemptDiagnosticsUpdateEvent(taskAttemptId, message));
  appContext.getEventHandler().handle(
      new TaskAttemptEvent(taskAttemptId, 
          TaskAttemptEventType.TA_KILL));
  KillTaskAttemptResponse response = 
    recordFactory.newRecordInstance(KillTaskAttemptResponse.class);
  return response;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:18,代码来源:MRClientService.java

示例7: failTaskAttempt

import org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptDiagnosticsUpdateEvent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public FailTaskAttemptResponse failTaskAttempt(
    FailTaskAttemptRequest request) throws IOException {
  TaskAttemptId taskAttemptId = request.getTaskAttemptId();
  String message = "Fail task attempt received from client " + taskAttemptId;
  LOG.info(message);
  verifyAndGetAttempt(taskAttemptId, true);
  appContext.getEventHandler().handle(
      new TaskAttemptDiagnosticsUpdateEvent(taskAttemptId, message));
  appContext.getEventHandler().handle(
      new TaskAttemptEvent(taskAttemptId, 
          TaskAttemptEventType.TA_FAILMSG));
  FailTaskAttemptResponse response = recordFactory.
    newRecordInstance(FailTaskAttemptResponse.class);
  return response;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:18,代码来源:MRClientService.java

示例8: processFinishedContainer

import org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptDiagnosticsUpdateEvent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@VisibleForTesting
void processFinishedContainer(ContainerStatus container) {
  LOG.info("Received completed container " + container.getContainerId());
  TaskAttemptId attemptID = assignedRequests.get(container.getContainerId());
  if (attemptID == null) {
    LOG.error("Container complete event for unknown container "
        + container.getContainerId());
  } else {
    pendingRelease.remove(container.getContainerId());
    assignedRequests.remove(attemptID);

    // Send the diagnostics
    String diagnostic = StringInterner.weakIntern(container.getDiagnostics());
    eventHandler.handle(new TaskAttemptDiagnosticsUpdateEvent(attemptID,
        diagnostic));

    // send the container completed event to Task attempt
    eventHandler.handle(createContainerFinishedEvent(container, attemptID));
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:22,代码来源:RMContainerAllocator.java

示例9: testHandlingFinishedContainers

import org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptDiagnosticsUpdateEvent; //导入依赖的package包/类
/**
 * MAPREDUCE-6771. Test if RMContainerAllocator generates the events in the
 * right order while processing finished containers.
 */
@Test
public void testHandlingFinishedContainers() {
  EventHandler eventHandler = mock(EventHandler.class);

  AppContext context = mock(MRAppMaster.RunningAppContext.class);
  when(context.getClock()).thenReturn(new ControlledClock());
  when(context.getClusterInfo()).thenReturn(
      new ClusterInfo(Resource.newInstance(10240, 1)));
  when(context.getEventHandler()).thenReturn(eventHandler);
  RMContainerAllocator containerAllocator =
      new RMContainerAllocatorForFinishedContainer(null, context);

  ContainerStatus finishedContainer = ContainerStatus.newInstance(
      mock(ContainerId.class), ContainerState.COMPLETE, "", 0);
  containerAllocator.processFinishedContainer(finishedContainer);

  InOrder inOrder = inOrder(eventHandler);
  inOrder.verify(eventHandler).handle(
      isA(TaskAttemptDiagnosticsUpdateEvent.class));
  inOrder.verify(eventHandler).handle(isA(TaskAttemptEvent.class));
  inOrder.verifyNoMoreInteractions();
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:27,代码来源:TestRMContainerAllocator.java

示例10: transition

import org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptDiagnosticsUpdateEvent; //导入依赖的package包/类
@Override
public void transition(TaskAttemptImpl taskAttempt, 
    TaskAttemptEvent event) {
  TaskAttemptDiagnosticsUpdateEvent diagEvent =
      (TaskAttemptDiagnosticsUpdateEvent) event;
  LOG.info("Diagnostics report from " + taskAttempt.attemptId + ": "
      + diagEvent.getDiagnosticInfo());
  taskAttempt.addDiagnosticInfo(diagEvent.getDiagnosticInfo());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:TaskAttemptImpl.java

示例11: sendContainerLaunchFailedMsg

import org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptDiagnosticsUpdateEvent; //导入依赖的package包/类
@SuppressWarnings("unchecked")
void sendContainerLaunchFailedMsg(TaskAttemptId taskAttemptID,
    String message) {
  LOG.error(message);
  context.getEventHandler().handle(
      new TaskAttemptDiagnosticsUpdateEvent(taskAttemptID, message));
  context.getEventHandler().handle(
      new TaskAttemptEvent(taskAttemptID,
          TaskAttemptEventType.TA_CONTAINER_LAUNCH_FAILED));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:ContainerLauncherImpl.java

示例12: run

import org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptDiagnosticsUpdateEvent; //导入依赖的package包/类
@Override
public void run() {
  while (!stopped && !Thread.currentThread().isInterrupted()) {
    Iterator<Map.Entry<TaskAttemptId, ReportTime>> iterator =
        runningAttempts.entrySet().iterator();

    // avoid calculating current time everytime in loop
    long currentTime = clock.getTime();

    while (iterator.hasNext()) {
      Map.Entry<TaskAttemptId, ReportTime> entry = iterator.next();
      boolean taskTimedOut = (taskTimeOut > 0) && 
          (currentTime > (entry.getValue().getLastProgress() + taskTimeOut));
       
      if(taskTimedOut) {
        // task is lost, remove from the list and raise lost event
        iterator.remove();
        eventHandler.handle(new TaskAttemptDiagnosticsUpdateEvent(entry
            .getKey(), "AttemptID:" + entry.getKey().toString()
            + " Timed out after " + taskTimeOut / 1000 + " secs"));
        eventHandler.handle(new TaskAttemptEvent(entry.getKey(),
            TaskAttemptEventType.TA_TIMED_OUT));
      }
    }
    try {
      Thread.sleep(taskTimeOutCheckInterval);
    } catch (InterruptedException e) {
      LOG.info("TaskHeartbeatHandler thread interrupted");
      break;
    }
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:33,代码来源:TaskHeartbeatHandler.java

示例13: attemptLaunched

import org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptDiagnosticsUpdateEvent; //导入依赖的package包/类
@Override
protected void attemptLaunched(TaskAttemptId attemptID) {
  getContext().getEventHandler().handle(
      new TaskAttemptDiagnosticsUpdateEvent(attemptID,
          "Test Diagnostic Event"));
  getContext().getEventHandler().handle(
      new TaskAttemptEvent(attemptID, TaskAttemptEventType.TA_FAILMSG));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:TestTaskAttempt.java


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