org.apache.hadoop.yarn.event.Dispatcher类的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(138)

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

Dispatcher介绍

[英]Event Dispatcher interface. It dispatches events to registered event handlers based on event types.
[中]事件调度器接口。它根据事件类型将事件分派给已注册的事件处理程序。

代码示例

代码示例来源:origin: apache/tajo

@Override
protected void serviceInit(Configuration conf) throws Exception {
 dispatcher.register(TaskManagerEvent.EventType.class, this);
 super.serviceInit(conf);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

@SuppressWarnings("unchecked")
/**
 * This method is called to notify the application that
 * new application is stored or updated in state store
 * @param event App event containing the app id and event type
 */
private void notifyApplication(RMAppEvent event) {
 rmDispatcher.getEventHandler().handle(event);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@SuppressWarnings("unchecked")
/**
 * This method is called to notify the application that
 * new application is stored or updated in state store
 * @param event App event containing the app id and event type
 */
private void notifyApplication(RMAppEvent event) {
 rmDispatcher.getEventHandler().handle(event);
}

代码示例来源:origin: org.apache.tajo/tajo-core

@Override
protected void serviceInit(Configuration conf) throws Exception {
 dispatcher.register(TaskManagerEvent.EventType.class, this);
 super.serviceInit(conf);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@SuppressWarnings("unchecked")
/**
 * This method is called to notify the application attempt
 * that new attempt is stored or updated in state store
 * @param event App attempt event containing the app attempt
 * id and event type
 */
private void notifyApplicationAttempt(RMAppAttemptEvent event) {
 rmDispatcher.getEventHandler().handle(event);
}

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

/**
 * Register the handlers for alwaysOn services
 */
private Dispatcher setupDispatcher() {
 Dispatcher dispatcher = createDispatcher();
 dispatcher.register(RMFatalEventType.class,
   new ResourceManager.RMFatalEventDispatcher());
 return dispatcher;
}

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

@SuppressWarnings("unchecked")
/**
 * This method is called to notify the application that
 * new application is stored or updated in state store
 * @param event App event containing the app id and event type
 */
private void notifyApplication(RMAppEvent event) {
 rmDispatcher.getEventHandler().handle(event);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

/**
 * Register the handlers for alwaysOn services
 */
private Dispatcher setupDispatcher() {
 Dispatcher dispatcher = createDispatcher();
 dispatcher.register(RMFatalEventType.class,
   new ResourceManager.RMFatalEventDispatcher());
 return dispatcher;
}

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

@SuppressWarnings("unchecked")
/**
 * This method is called to notify the application attempt
 * that new attempt is stored or updated in state store
 * @param event App attempt event containing the app attempt
 * id and event type
 */
private void notifyApplicationAttempt(RMAppAttemptEvent event) {
 rmDispatcher.getEventHandler().handle(event);
}

代码示例来源:origin: org.apache.tajo/tajo-core

@Override
protected void serviceInit(Configuration conf) throws Exception {
 this.tajoConf = TUtil.checkTypeAndGet(conf, TajoConf.class);
 this.totalResource = createWorkerResource(tajoConf);
 this.availableResource = NodeResources.clone(totalResource);
 this.dispatcher.register(NodeResourceEvent.EventType.class, this);
 validateConf(tajoConf);
 this.enableTest = conf.get(TajoConstants.TEST_KEY, Boolean.FALSE.toString())
   .equalsIgnoreCase(Boolean.TRUE.toString());
 super.serviceInit(conf);
 LOG.info("Initialized NodeResourceManager for " + totalResource);
}

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

@Override
 public void transition(ApplicationImpl app, ApplicationEvent event) {
  LOG.warn("Log Aggregation service failed to initialize, there will " + 
       "be no logs for this application");
  app.dispatcher.getEventHandler().handle(
    new ApplicationLocalizationEvent(
      LocalizationEventType.INIT_APPLICATION_RESOURCES, app));
 }
}

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

@Override
protected void serviceInit(Configuration conf) throws Exception {
 super.serviceInit(conf);
 getDispatcher().register(SystemMetricsEventType.class,
   new TimelineV2EventHandler());
 publishContainerEvents = getConfig().getBoolean(
   YarnConfiguration.RM_PUBLISH_CONTAINER_EVENTS_ENABLED,
   YarnConfiguration.DEFAULT_RM_PUBLISH_CONTAINER_EVENTS_ENABLED);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-nodemanager

@Override
 public void transition(ApplicationImpl app, ApplicationEvent event) {
  LOG.warn("Log Aggregation service failed to initialize, there will " + 
       "be no logs for this application");
  app.dispatcher.getEventHandler().handle(
    new ApplicationLocalizationEvent(
      LocalizationEventType.INIT_APPLICATION_RESOURCES, app));
 }
}

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

@Override
protected void serviceInit(Configuration conf) throws Exception {
 client = TimelineClient.createTimelineClient();
 addIfService(client);
 super.serviceInit(conf);
 getDispatcher().register(SystemMetricsEventType.class,
   new TimelineV1EventHandler());
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-nodemanager

@Override
 public void transition(ApplicationImpl app, ApplicationEvent event) {
  LOG.warn("Log Aggregation service failed to initialize, there will " + 
       "be no logs for this application");
  app.dispatcher.getEventHandler().handle(
    new ApplicationLocalizationEvent(
      LocalizationEventType.INIT_APPLICATION_RESOURCES, app));
 }
}

代码示例来源:origin: org.apache.tajo/tajo-core

@Override
public void serviceInit(Configuration conf) throws Exception {
 this.systemConf = TUtil.checkTypeAndGet(conf, TajoConf.class);
 this.rpcParams = RpcParameterFactory.get(this.systemConf);
 this.heartBeatRequestQueue = Queues.newLinkedBlockingQueue();
 this.serviceTracker = ServiceTrackerFactory.get(systemConf);
 this.workerContext.getNodeResourceManager().getDispatcher().register(NodeStatusEvent.EventType.class, this);
 this.heartBeatInterval = systemConf.getIntVar(TajoConf.ConfVars.WORKER_HEARTBEAT_IDLE_INTERVAL);
 this.updaterThread = new StatusUpdaterThread();
 this.updaterThread.setName("NodeStatusUpdater");
 super.serviceInit(conf);
}

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

@SuppressWarnings("unchecked") // dispatcher not typed
@Override
public void sendKillEvent(int exitStatus, String description) {
 this.isMarkeForKilling = true;
 dispatcher.getEventHandler().handle(
   new ContainerKillEvent(containerId, exitStatus, description));
}

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

@SuppressWarnings("unchecked") // dispatcher not typed
@Override
public void sendPauseEvent(String description) {
 dispatcher.getEventHandler().handle(
   new ContainerPauseEvent(containerId, description));
}

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

@SuppressWarnings("unchecked") // dispatcher not typed
private void sendRelaunchEvent() {
 ContainersLauncherEventType launcherEvent =
   ContainersLauncherEventType.RELAUNCH_CONTAINER;
 dispatcher.getEventHandler().handle(
   new ContainersLauncherEvent(this, launcherEvent));
}

代码示例来源: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));
 }
}

相关文章