org.apache.hadoop.yarn.event.EventHandler.handle()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中org.apache.hadoop.yarn.event.EventHandler.handle()方法的一些代码示例,展示了EventHandler.handle()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EventHandler.handle()方法的具体详情如下:
包路径:org.apache.hadoop.yarn.event.EventHandler
类名称:EventHandler
方法名:handle

EventHandler.handle介绍

暂无

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common

@Override
 public void handle(Event event) {
  synchronized (mutex) {
   actual.handle(event);
   drained = false;
  }
 }
};

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-app

@Override
 public void transition(JobImpl job, JobEvent event) {
   job.eventHandler.handle(new CommitterJobAbortEvent(job.jobId,
       job.jobContext,
       org.apache.hadoop.mapreduce.JobStatus.State.FAILED));
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-app

@SuppressWarnings("unchecked")
 @Override
 public void transition(TaskAttemptImpl taskAttempt, 
   TaskAttemptEvent event) {
  taskAttempt.eventHandler.handle(new TaskTAttemptEvent(
    taskAttempt.attemptId, 
    TaskEventType.T_ATTEMPT_COMMIT_PENDING));
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Override
public void handle(Event event) {
 // Use hashCode (of ApplicationId) to dispatch the event to the child
 // dispatcher, such that all the writing events of one application will
 // be handled by one thread, the scheduled order of the these events
 // will be preserved
 int index = (event.hashCode() & Integer.MAX_VALUE) % dispatchers.size();
 dispatchers.get(index).getEventHandler().handle(event);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Override
 protected void expire(NodeId id) {
  dispatcher.handle(
    new RMNodeEvent(id, RMNodeEventType.EXPIRE)); 
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Override
 public void handle(Event event) {
  // Use hashCode (of ApplicationId) to dispatch the event to the child
  // dispatcher, such that all the writing events of one application will
  // be handled by one thread, the scheduled order of the these events
  // will be preserved
  int index = (event.hashCode() & Integer.MAX_VALUE) % dispatchers.size();
  dispatchers.get(index).getEventHandler().handle(event);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-app

@Override
 public void transition(JobImpl job, JobEvent event) {
  job.setFinishTime();
  job.eventHandler.handle(new CommitterJobAbortEvent(job.jobId,
    job.jobContext,
    org.apache.hadoop.mapreduce.JobStatus.State.KILLED));
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager

@Override
 public void transition(ContainerImpl container, ContainerEvent event) {
  // Container was PAUSED so tell the scheduler
  container.dispatcher.getEventHandler().handle(
    new ContainerSchedulerEvent(container,
      ContainerSchedulerEventType.CONTAINER_PAUSED));
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager

@Override
@SuppressWarnings("unchecked") // dispatcher not typed
public void run() {
 dispatcher.getEventHandler().handle(
   new LocalizationEvent(LocalizationEventType.CACHE_CLEANUP));
}

代码示例来源:origin: org.apache.tez/tez-dag

protected void internalErrorUncaughtException(TaskEventType type, Exception e) {
 eventHandler.handle(new DAGEventDiagnosticsUpdate(
   this.taskId.getVertexID().getDAGId(), "Uncaught exception when handling  event " + type +
   " on Task " + this.taskId + ", error=" + e.getMessage()));
 eventHandler.handle(new DAGEvent(this.taskId.getVertexID().getDAGId(),
   DAGEventType.INTERNAL_ERROR));
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-app

void logJobHistoryFinishedEvent() {
 this.setFinishTime();
 JobFinishedEvent jfe = createJobFinishedEvent(this);
 LOG.info("Calling handler for JobFinishedEvent ");
 this.getEventHandler().handle(new JobHistoryEvent(this.jobId, jfe));    
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-app

protected JobStateInternal checkReadyForCommit() {
 JobStateInternal currentState = getInternalState();
 if (completedTaskCount == tasks.size()
   && currentState == JobStateInternal.RUNNING) {
  eventHandler.handle(new CommitterJobCommitEvent(jobId, getJobContext()));
  return JobStateInternal.COMMITTING;
 }
 // return the current state as job not ready to commit yet
 return getInternalState();
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager

@Override
 public void transition(ContainerImpl container, ContainerEvent event) {
  // Pause the process/process-grp if it is supported by the container
  container.dispatcher.getEventHandler().handle(
    new ContainersLauncherEvent(container,
      ContainersLauncherEventType.RESUME_CONTAINER));
  ContainerResumeEvent resumeEvent = (ContainerResumeEvent) event;
  container.addDiagnostics(resumeEvent.getDiagnostic() + "\n");
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common

@Override
protected void dispatch(Event event) {
  LOG.info("Dispatching the event " + event.getClass().getName() + "."
   + event.toString());
 Class<? extends Enum> type = event.getType().getDeclaringClass();
 if (eventDispatchers.get(type) != null) {
  eventDispatchers.get(type).handle(event);
 }
}
@Override

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-app

@Override
 public void transition(JobImpl job, JobEvent event) {
  job.metrics.endRunningJob(job);
  job.addDiagnostic("Job setup failed : "
    + ((JobSetupFailedEvent) event).getMessage());
  job.eventHandler.handle(new CommitterJobAbortEvent(job.jobId,
    job.jobContext,
    org.apache.hadoop.mapreduce.JobStatus.State.FAILED));
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager

@Override
 public void transition(LocalizedResource rsrc, ResourceEvent event) {
  ResourceFailedLocalizationEvent failedEvent =
    (ResourceFailedLocalizationEvent) event;
  Queue<ContainerId> containers = rsrc.ref;
  for (ContainerId container : containers) {
   rsrc.dispatcher.getEventHandler().handle(
    new ContainerResourceFailedEvent(container, failedEvent
     .getLocalResourceRequest(), failedEvent.getDiagnosticMessage()));
  }
 }
}

代码示例来源:origin: org.apache.tez/tez-dag

@SuppressWarnings("unchecked")
public void tryKillDAG(DAG dag, String message) throws TezException {
 try {
  logDAGKillRequestEvent(dag.getID(), false);
 } catch (IOException e) {
  throw new TezException(e);
 }
 dispatcher.getEventHandler().handle(new DAGEventTerminateDag(dag.getID(), DAGTerminationCause.DAG_KILL, message));
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-app

@Override
protected void attemptLaunched(TaskAttemptId attemptID) {
 getContext().getEventHandler().handle(
   new TaskAttemptEvent(attemptID, sendFailEvent));
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-app

private void sendTaskStartedEvent() {
 launchTime = getLaunchTime();
 TaskStartedEvent tse = new TaskStartedEvent(
   TypeConverter.fromYarn(taskId), launchTime,
   TypeConverter.fromYarn(taskId.getTaskType()),
   getSplitsAsString());
 eventHandler
   .handle(new JobHistoryEvent(taskId.getJobId(), tse));
 historyTaskStartGenerated = true;
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-app

private void sendFetchFailure(MRApp app, TaskAttempt reduceAttempt, 
  TaskAttempt mapAttempt, String hostname) {
 app.getContext().getEventHandler().handle(
   new JobTaskAttemptFetchFailureEvent(
     reduceAttempt.getID(), 
     Arrays.asList(new TaskAttemptId[] {mapAttempt.getID()}),
       hostname));
}

相关文章

EventHandler类方法