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


Java SchedulerApplication.setCurrentAppAttempt方法代码示例

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


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

示例1: addApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApplication; //导入方法依赖的package包/类
private synchronized void
    addApplicationAttempt(ApplicationAttemptId appAttemptId,
        boolean transferStateFromPreviousAttempt) {
  SchedulerApplication 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());
  rmContext.getDispatcher().getEventHandler().handle(
      new RMAppAttemptEvent(appAttemptId,
          RMAppAttemptEventType.ATTEMPT_ADDED));
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:25,代码来源:FifoScheduler.java

示例2: addApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApplication; //导入方法依赖的package包/类
private synchronized void addApplicationAttempt(
    ApplicationAttemptId applicationAttemptId,
    boolean transferStateFromPreviousAttempt) {
  SchedulerApplication 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());
  rmContext.getDispatcher().getEventHandler() .handle(
      new RMAppAttemptEvent(applicationAttemptId,
        RMAppAttemptEventType.ATTEMPT_ADDED));
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:25,代码来源:CapacityScheduler.java

示例3: addApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApplication; //导入方法依赖的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

示例4: addApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApplication; //导入方法依赖的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

示例5: addApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApplication; //导入方法依赖的package包/类
/**
 * Add a new application attempt to the scheduler.
 */
protected synchronized void addApplicationAttempt(
    ApplicationAttemptId applicationAttemptId,
    boolean transferStateFromPreviousAttempt) {
  SchedulerApplication application =
      applications.get(applicationAttemptId.getApplicationId());
  String user = application.getUser();
  FSLeafQueue queue = (FSLeafQueue) application.getQueue();

  FSSchedulerApp attempt =
      new FSSchedulerApp(applicationAttemptId, user,
          queue, new ActiveUsersManager(getRootQueueMetrics()),
          rmContext);
  if (transferStateFromPreviousAttempt) {
    attempt.transferStateFromPreviousAttempt(application
      .getCurrentAppAttempt());
  }
  application.setCurrentAppAttempt(attempt);

  boolean runnable = maxRunningEnforcer.canAppBeRunnable(queue, user);
  queue.addApp(attempt, runnable);
  if (runnable) {
    maxRunningEnforcer.trackRunnableApp(attempt);
  } else {
    maxRunningEnforcer.trackNonRunnableApp(attempt);
  }
  
  queue.getMetrics().submitAppAttempt(user);

  LOG.info("Added Application Attempt " + applicationAttemptId
      + " to scheduler from user: " + user);
  rmContext.getDispatcher().getEventHandler().handle(
      new RMAppAttemptEvent(applicationAttemptId,
          RMAppAttemptEventType.ATTEMPT_ADDED));
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:38,代码来源:FairScheduler.java

示例6: addApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApplication; //导入方法依赖的package包/类
/**
 * Add a new application attempt to the scheduler.
 */
protected synchronized void addApplicationAttempt(
    ApplicationAttemptId applicationAttemptId,
    boolean transferStateFromPreviousAttempt,
    boolean isAttemptRecovering) {
  SchedulerApplication<FSAppAttempt> application =
      applications.get(applicationAttemptId.getApplicationId());
  String user = application.getUser();
  FSLeafQueue queue = (FSLeafQueue) application.getQueue();

  FSAppAttempt attempt =
      new FSAppAttempt(this, applicationAttemptId, user,
          queue, new ActiveUsersManager(getRootQueueMetrics()),
          rmContext);
  if (transferStateFromPreviousAttempt) {
    attempt.transferStateFromPreviousAttempt(application
        .getCurrentAppAttempt());
  }
  application.setCurrentAppAttempt(attempt);

  boolean runnable = maxRunningEnforcer.canAppBeRunnable(queue, user);
  queue.addApp(attempt, runnable);
  if (runnable) {
    maxRunningEnforcer.trackRunnableApp(attempt);
  } else {
    maxRunningEnforcer.trackNonRunnableApp(attempt);
  }
  
  queue.getMetrics().submitAppAttempt(user);

  LOG.info("Added Application Attempt " + applicationAttemptId
      + " to scheduler from user: " + user);

  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,代码行数:47,代码来源:FairScheduler.java

示例7: addApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApplication; //导入方法依赖的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

示例8: addApplicationAttempt

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApplication; //导入方法依赖的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(), isAttemptRecovering);
  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:hopshadoop,项目名称:hops,代码行数:49,代码来源:CapacityScheduler.java


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