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


Java FiCaSchedulerApp.transferStateFromPreviousAttempt方法代码示例

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


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

示例1: addApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.fica.FiCaSchedulerApp; //导入方法依赖的package包/类
@VisibleForTesting
public synchronized void
    addApplicationAttempt(ApplicationAttemptId appAttemptId,
        boolean transferStateFromPreviousAttempt,
        boolean isAttemptRecovering) {
  SchedulerApplication<FiCaSchedulerApp> application =
      applications.get(appAttemptId.getApplicationId());
  String user = application.getUser();
  // TODO: Fix store
  FiCaSchedulerApp schedulerApp =
      new FiCaSchedulerApp(appAttemptId, user, DEFAULT_QUEUE,
        activeUsersManager, this.rmContext);

  if (transferStateFromPreviousAttempt) {
    schedulerApp.transferStateFromPreviousAttempt(application
      .getCurrentAppAttempt());
  }
  application.setCurrentAppAttempt(schedulerApp);

  metrics.submitAppAttempt(user);
  LOG.info("Added Application Attempt " + appAttemptId
      + " to scheduler from user " + application.getUser());
  if (isAttemptRecovering) {
    if (LOG.isDebugEnabled()) {
      LOG.debug(appAttemptId
          + " is recovering. Skipping notifying ATTEMPT_ADDED");
    }
  } else {
    rmContext.getDispatcher().getEventHandler().handle(
      new RMAppAttemptEvent(appAttemptId,
          RMAppAttemptEventType.ATTEMPT_ADDED));
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:34,代码来源:FifoScheduler.java

示例2: addApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.fica.FiCaSchedulerApp; //导入方法依赖的package包/类
private synchronized void addApplicationAttempt(
    ApplicationAttemptId applicationAttemptId,
    boolean transferStateFromPreviousAttempt,
    boolean isAttemptRecovering) {
  SchedulerApplication<FiCaSchedulerApp> application =
      applications.get(applicationAttemptId.getApplicationId());
  CSQueue queue = (CSQueue) application.getQueue();

  FiCaSchedulerApp attempt =
      new FiCaSchedulerApp(applicationAttemptId, application.getUser(),
        queue, queue.getActiveUsersManager(), rmContext);
  if (transferStateFromPreviousAttempt) {
    attempt.transferStateFromPreviousAttempt(application
      .getCurrentAppAttempt());
  }
  application.setCurrentAppAttempt(attempt);

  queue.submitApplicationAttempt(attempt, application.getUser());
  LOG.info("Added Application Attempt " + applicationAttemptId
      + " to scheduler from user " + application.getUser() + " in queue "
      + queue.getQueueName());
  if (isAttemptRecovering) {
    if (LOG.isDebugEnabled()) {
      LOG.debug(applicationAttemptId
          + " is recovering. Skipping notifying ATTEMPT_ADDED");
    }
  } else {
    rmContext.getDispatcher().getEventHandler().handle(
      new RMAppAttemptEvent(applicationAttemptId,
          RMAppAttemptEventType.ATTEMPT_ADDED));
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:33,代码来源:CapacityScheduler.java

示例3: addApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.fica.FiCaSchedulerApp; //导入方法依赖的package包/类
private synchronized void addApplicationAttempt(
    ApplicationAttemptId applicationAttemptId,
    boolean transferStateFromPreviousAttempt,
    boolean isAttemptRecovering) {
  SchedulerApplication<FiCaSchedulerApp> application =
      applications.get(applicationAttemptId.getApplicationId());
  if (application == null) {
    LOG.warn("Application " + applicationAttemptId.getApplicationId() +
        " cannot be found in scheduler.");
    return;
  }
  CSQueue queue = (CSQueue) application.getQueue();

  FiCaSchedulerApp attempt = new FiCaSchedulerApp(applicationAttemptId,
      application.getUser(), queue, queue.getActiveUsersManager(), rmContext,
      application.getPriority());
  if (transferStateFromPreviousAttempt) {
    attempt.transferStateFromPreviousAttempt(
        application.getCurrentAppAttempt());
  }
  application.setCurrentAppAttempt(attempt);

  // Update attempt priority to the latest to avoid race condition i.e
  // SchedulerApplicationAttempt is created with old priority but it is not
  // set to SchedulerApplication#setCurrentAppAttempt.
  // Scenario would occur is
  // 1. SchdulerApplicationAttempt is created with old priority.
  // 2. updateApplicationPriority() updates SchedulerApplication. Since
  // currentAttempt is null, it just return.
  // 3. ScheduelerApplcationAttempt is set in
  // SchedulerApplication#setCurrentAppAttempt.
  attempt.setPriority(application.getPriority());

  queue.submitApplicationAttempt(attempt, application.getUser());
  LOG.info("Added Application Attempt " + applicationAttemptId
      + " to scheduler from user " + application.getUser() + " in queue "
      + queue.getQueueName());
  if (isAttemptRecovering) {
    if (LOG.isDebugEnabled()) {
      LOG.debug(applicationAttemptId
          + " is recovering. Skipping notifying ATTEMPT_ADDED");
    }
  } else {
    rmContext.getDispatcher().getEventHandler().handle(
      new RMAppAttemptEvent(applicationAttemptId,
          RMAppAttemptEventType.ATTEMPT_ADDED));
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:49,代码来源:CapacityScheduler.java


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