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


Java RMContext.getDispatcher方法代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.server.resourcemanager.RMContext.getDispatcher方法的典型用法代码示例。如果您正苦于以下问题:Java RMContext.getDispatcher方法的具体用法?Java RMContext.getDispatcher怎么用?Java RMContext.getDispatcher使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.yarn.server.resourcemanager.RMContext的用法示例。


在下文中一共展示了RMContext.getDispatcher方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RMAppImpl

import org.apache.hadoop.yarn.server.resourcemanager.RMContext; //导入方法依赖的package包/类
public RMAppImpl(ApplicationId applicationId, RMContext rmContext,
    Configuration config, String name, String user, String queue,
    ApplicationSubmissionContext submissionContext, YarnScheduler scheduler,
    ApplicationMasterService masterService, long submitTime,
    String applicationType, Set<String> applicationTags, 
    ResourceRequest amReq) {

  this.systemClock = new SystemClock();

  this.applicationId = applicationId;
  this.name = name;
  this.rmContext = rmContext;
  this.dispatcher = rmContext.getDispatcher();
  this.handler = dispatcher.getEventHandler();
  this.conf = config;
  this.user = user;
  this.queue = queue;
  this.submissionContext = submissionContext;
  this.scheduler = scheduler;
  this.masterService = masterService;
  this.submitTime = submitTime;
  this.startTime = this.systemClock.getTime();
  this.applicationType = applicationType;
  this.applicationTags = applicationTags;
  this.amReq = amReq;

  int globalMaxAppAttempts = conf.getInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,
      YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS);
  int individualMaxAppAttempts = submissionContext.getMaxAppAttempts();
  if (individualMaxAppAttempts <= 0 ||
      individualMaxAppAttempts > globalMaxAppAttempts) {
    this.maxAppAttempts = globalMaxAppAttempts;
    LOG.warn("The specific max attempts: " + individualMaxAppAttempts
        + " for application: " + applicationId.getId()
        + " is invalid, because it is out of the range [1, "
        + globalMaxAppAttempts + "]. Use the global max attempts instead.");
  } else {
    this.maxAppAttempts = individualMaxAppAttempts;
  }

  this.attemptFailuresValidityInterval =
      submissionContext.getAttemptFailuresValidityInterval();
  if (this.attemptFailuresValidityInterval > 0) {
    LOG.info("The attemptFailuresValidityInterval for the application: "
        + this.applicationId + " is " + this.attemptFailuresValidityInterval
        + ".");
  }

  ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
  this.readLock = lock.readLock();
  this.writeLock = lock.writeLock();

  this.stateMachine = stateMachineFactory.make(this);

  rmContext.getRMApplicationHistoryWriter().applicationStarted(this);
  rmContext.getSystemMetricsPublisher().appCreated(this, startTime);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:58,代码来源:RMAppImpl.java


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