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

x33g5p2x  于2022-01-16 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(84)

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

AsyncDispatcher.createShutDownThread介绍

暂无

代码示例

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

@SuppressWarnings("unchecked")
protected void dispatch(Event event) {
 //all events go thru this loop
 if (LOG.isDebugEnabled()) {
  LOG.debug("Dispatching the event " + event.getClass().getName() + "."
    + event.toString());
 }
 Class<? extends Enum> type = event.getType().getDeclaringClass();
 try{
  EventHandler handler = eventDispatchers.get(type);
  if(handler != null) {
   handler.handle(event);
  } else {
   throw new Exception("No handler for registered for " + type);
  }
 } catch (Throwable t) {
  //TODO Maybe log the state of the queue
  LOG.fatal("Error in dispatcher thread", t);
  // If serviceStop is called, we should exit this thread gracefully.
  if (exitOnDispatchException
    && (ShutdownHookManager.get().isShutdownInProgress()) == false
    && stopped == false) {
   Thread shutDownThread = new Thread(createShutDownThread());
   shutDownThread.setName("AsyncDispatcher ShutDown handler");
   shutDownThread.start();
  }
 }
}

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

@SuppressWarnings("unchecked")
protected void dispatch(Event event) {
 //all events go thru this loop
 if (LOG.isDebugEnabled()) {
  LOG.debug("Dispatching the event " + event.getClass().getName() + "."
    + event.toString());
 }
 Class<? extends Enum> type = event.getType().getDeclaringClass();
 try{
  EventHandler handler = eventDispatchers.get(type);
  if(handler != null) {
   handler.handle(event);
  } else {
   throw new Exception("No handler for registered for " + type);
  }
 } catch (Throwable t) {
  //TODO Maybe log the state of the queue
  LOG.fatal("Error in dispatcher thread", t);
  // If serviceStop is called, we should exit this thread gracefully.
  if (exitOnDispatchException
    && (ShutdownHookManager.get().isShutdownInProgress()) == false
    && stopped == false) {
   Thread shutDownThread = new Thread(createShutDownThread());
   shutDownThread.setName("AsyncDispatcher ShutDown handler");
   shutDownThread.start();
  }
 }
}

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

@SuppressWarnings("unchecked")
protected void dispatch(Event event) {
 //all events go thru this loop
 if (LOG.isDebugEnabled()) {
  LOG.debug("Dispatching the event " + event.getClass().getName() + "."
    + event.toString());
 }
 Class<? extends Enum> type = event.getType().getDeclaringClass();
 try{
  EventHandler handler = eventDispatchers.get(type);
  if(handler != null) {
   handler.handle(event);
  } else {
   throw new Exception("No handler for registered for " + type);
  }
 } catch (Throwable t) {
  //TODO Maybe log the state of the queue
  LOG.fatal("Error in dispatcher thread", t);
  // If serviceStop is called, we should exit this thread gracefully.
  if (exitOnDispatchException
    && (ShutdownHookManager.get().isShutdownInProgress()) == false
    && stopped == false) {
   stopped = true;
   Thread shutDownThread = new Thread(createShutDownThread());
   shutDownThread.setName("AsyncDispatcher ShutDown handler");
   shutDownThread.start();
  }
 }
}

相关文章