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

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

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

AsyncDispatcher.getConfig介绍

暂无

代码示例

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

@Override
protected void serviceStop() throws Exception {
 if (drainEventsOnStop) {
  blockNewEvents = true;
  LOG.info("AsyncDispatcher is draining to stop, igonring any new events.");
  long endTime = System.currentTimeMillis() + getConfig()
    .getLong(YarnConfiguration.DISPATCHER_DRAIN_EVENTS_TIMEOUT,
      YarnConfiguration.DEFAULT_DISPATCHER_DRAIN_EVENTS_TIMEOUT);
  synchronized (waitForDrained) {
   while (!drained && eventHandlingThread != null
     && eventHandlingThread.isAlive()
     && System.currentTimeMillis() < endTime) {
    waitForDrained.wait(1000);
    LOG.info("Waiting for AsyncDispatcher to drain. Thread state is :" +
      eventHandlingThread.getState());
   }
  }
 }
 stopped = true;
 if (eventHandlingThread != null) {
  eventHandlingThread.interrupt();
  try {
   eventHandlingThread.join();
  } catch (InterruptedException ie) {
   LOG.warn("Interrupted Exception while stopping", ie);
  }
 }
 // stop all the components
 super.serviceStop();
}

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

@Override
protected void serviceStop() throws Exception {
 if (drainEventsOnStop) {
  blockNewEvents = true;
  LOG.info("AsyncDispatcher is draining to stop, igonring any new events.");
  long endTime = System.currentTimeMillis() + getConfig()
    .getLong(YarnConfiguration.DISPATCHER_DRAIN_EVENTS_TIMEOUT,
      YarnConfiguration.DEFAULT_DISPATCHER_DRAIN_EVENTS_TIMEOUT);
  synchronized (waitForDrained) {
   while (!drained && eventHandlingThread != null
     && eventHandlingThread.isAlive()
     && System.currentTimeMillis() < endTime) {
    waitForDrained.wait(1000);
    LOG.info("Waiting for AsyncDispatcher to drain. Thread state is :" +
      eventHandlingThread.getState());
   }
  }
 }
 stopped = true;
 if (eventHandlingThread != null) {
  eventHandlingThread.interrupt();
  try {
   eventHandlingThread.join();
  } catch (InterruptedException ie) {
   LOG.warn("Interrupted Exception while stopping", ie);
  }
 }
 // stop all the components
 super.serviceStop();
}

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

@Override
protected void serviceStop() throws Exception {
 if (drainEventsOnStop) {
  blockNewEvents = true;
  LOG.info("AsyncDispatcher is draining to stop, ignoring any new events.");
  long endTime = System.currentTimeMillis() + getConfig()
    .getLong(YarnConfiguration.DISPATCHER_DRAIN_EVENTS_TIMEOUT,
      YarnConfiguration.DEFAULT_DISPATCHER_DRAIN_EVENTS_TIMEOUT);
  synchronized (waitForDrained) {
   while (!isDrained() && eventHandlingThread != null
     && eventHandlingThread.isAlive()
     && System.currentTimeMillis() < endTime) {
    waitForDrained.wait(100);
    LOG.info("Waiting for AsyncDispatcher to drain. Thread state is :" +
      eventHandlingThread.getState());
   }
  }
 }
 stopped = true;
 if (eventHandlingThread != null) {
  eventHandlingThread.interrupt();
  try {
   eventHandlingThread.join();
  } catch (InterruptedException ie) {
   LOG.warn("Interrupted Exception while stopping", ie);
  }
 }
 // stop all the components
 super.serviceStop();
}

相关文章