gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-14 00:52:49 29 4
gpt4 key购买 nike

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

YarnScheduler.removeQueue介绍

[英]Remove an existing queue. Implementations might limit when a queue could be removed (e.g., must have zero entitlement, and no applications running, or must be a leaf, etc..).
[中]删除现有队列。实现可能会限制可以删除队列的时间(例如,必须具有零权限,并且没有正在运行的应用程序,或者必须是叶子,等等)。

代码示例

代码示例来源: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

LOG.info("Killing applications in queue: {}", expiredReservation);
} else {
 scheduler.removeQueue(expiredReservation);
 LOG.info("Queue: " + expiredReservation + " removed");

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