gpt4 book ai didi

org.apache.hadoop.yarn.server.resourcemanager.scheduler.YarnScheduler.killAllAppsInQueue()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 02:18:49 27 4
gpt4 key购买 nike

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

YarnScheduler.killAllAppsInQueue介绍

[英]Terminate all applications in the specified queue.
[中]终止指定队列中的所有应用程序。

代码示例

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

/**
 * First sets entitlement of queues to zero to prevent new app submission.
 * Then move all apps in the set of queues to the parent plan queue's default
 * reservation queue if move is enabled. Finally cleanups the queue by killing
 * any apps (if move is disabled or move failed) and removing the queue
 */
protected void cleanupExpiredQueues(String planQueueName,
  boolean shouldMove, Set<String> toRemove, String defReservationQueue) {
 for (String expiredReservationId : toRemove) {
  try {
   // reduce entitlement to 0
   String expiredReservation = getReservationQueueName(planQueueName,
     expiredReservationId);
   setQueueEntitlement(planQueueName, expiredReservation, 0.0f, 0.0f);
   if (shouldMove) {
    moveAppsInQueueSync(expiredReservation, defReservationQueue);
   }
   if (scheduler.getAppsInQueue(expiredReservation).size() > 0) {
    scheduler.killAllAppsInQueue(expiredReservation);
    LOG.info("Killing applications in queue: {}", expiredReservation);
   } else {
    scheduler.removeQueue(expiredReservation);
    LOG.info("Queue: " + expiredReservation + " removed");
   }
  } catch (YarnException e) {
   LOG.warn("Exception while trying to expire reservation: {}",
     expiredReservationId, e);
  }
 }
}

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

/**
 * First sets entitlement of queues to zero to prevent new app submission.
 * Then move all apps in the set of queues to the parent plan queue's default
 * reservation queue if move is enabled. Finally cleanups the queue by killing
 * any apps (if move is disabled or move failed) and removing the queue
 */
protected void cleanupExpiredQueues(String planQueueName,
  boolean shouldMove, Set<String> toRemove, String defReservationQueue) {
 for (String expiredReservationId : toRemove) {
  try {
   // reduce entitlement to 0
   String expiredReservation = getReservationQueueName(planQueueName,
     expiredReservationId);
   setQueueEntitlement(planQueueName, expiredReservation, 0.0f, 0.0f);
   if (shouldMove) {
    moveAppsInQueueSync(expiredReservation, defReservationQueue);
   }
   if (scheduler.getAppsInQueue(expiredReservation).size() > 0) {
    scheduler.killAllAppsInQueue(expiredReservation);
    LOG.info("Killing applications in queue: {}", expiredReservation);
   } else {
    scheduler.removeQueue(expiredReservation);
    LOG.info("Queue: " + expiredReservation + " removed");
   }
  } catch (YarnException e) {
   LOG.warn("Exception while trying to expire reservation: {}",
     expiredReservationId, e);
  }
 }
}

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

int size = (appsInQueue == null ? 0 : appsInQueue.size());
if (size > 0) {
 scheduler.killAllAppsInQueue(expiredReservation);
 LOG.info("Killing applications in queue: {}", expiredReservation);
} else {

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

scheduler.killAllAppsInQueue("DOES_NOT_EXIST");
 Assert.fail();
} catch (YarnException e) {

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com