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

x33g5p2x  于2022-01-28 转载在 其他  
字(9.0k)|赞(0)|评价(0)|浏览(82)

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

QueueManager.getQueue介绍

[英]Gets a queue by name.
[中]按名称获取队列。

代码示例

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

private FSLeafQueue getLeafQueue(String name, boolean create,
                 ApplicationId applicationId,
                 boolean recomputeSteadyShares) {
 FSQueue queue = getQueue(name, create, FSQueueType.LEAF,
   recomputeSteadyShares, applicationId);
 if (queue instanceof FSParentQueue) {
  return null;
 }
 return (FSLeafQueue) queue;
}

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

/**
 * Get a leaf queue by name, creating it if the create param is true and is necessary.
 * If the queue is not or can not be a leaf queue, i.e. it already exists as a
 * parent queue, or one of the parents in its name is already a leaf queue,
 * null is returned.
 * 
 * The root part of the name is optional, so a queue underneath the root 
 * named "queue1" could be referred to  as just "queue1", and a queue named
 * "queue2" underneath a parent named "parent1" that is underneath the root 
 * could be referred to as just "parent1.queue2".
 */
public FSLeafQueue getLeafQueue(String name, boolean create) {
 FSQueue queue = getQueue(name, create, FSQueueType.LEAF);
 if (queue instanceof FSParentQueue) {
  return null;
 }
 return (FSLeafQueue) queue;
}

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

@Override
public List<ApplicationAttemptId> getAppsInQueue(String queueName) {
 FSQueue queue = queueMgr.getQueue(queueName);
 if (queue == null) {
  return null;
 }
 List<ApplicationAttemptId> apps = new ArrayList<ApplicationAttemptId>();
 queue.collectSchedulerApplications(apps);
 return apps;
}

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

@Override
public List<ApplicationAttemptId> getAppsInQueue(String queueName) {
 FSQueue queue = queueMgr.getQueue(queueName);
 if (queue == null) {
  return null;
 }
 List<ApplicationAttemptId> apps = new ArrayList<ApplicationAttemptId>();
 queue.collectSchedulerApplications(apps);
 return apps;
}

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

@Override
public List<ApplicationAttemptId> getAppsInQueue(String queueName) {
 FSQueue queue = queueMgr.getQueue(queueName);
 if (queue == null) {
  return null;
 }
 List<ApplicationAttemptId> apps = new ArrayList<ApplicationAttemptId>();
 queue.collectSchedulerApplications(apps);
 return apps;
}

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

@Override
public synchronized boolean checkAccess(UserGroupInformation callerUGI,
  QueueACL acl, String queueName) {
 FSQueue queue = getQueueManager().getQueue(queueName);
 if (queue == null) {
  if (LOG.isDebugEnabled()) {
   LOG.debug("ACL not found for queue access-type " + acl
     + " for queue " + queueName);
  }
  return false;
 }
 return queue.hasAccess(acl, callerUGI);
}

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

@Override
public synchronized boolean checkAccess(UserGroupInformation callerUGI,
  QueueACL acl, String queueName) {
 FSQueue queue = getQueueManager().getQueue(queueName);
 if (queue == null) {
  if (LOG.isDebugEnabled()) {
   LOG.debug("ACL not found for queue access-type " + acl
     + " for queue " + queueName);
  }
  return false;
 }
 return queue.hasAccess(acl, callerUGI);
}

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

@Override
public QueueInfo getQueueInfo(String queueName, boolean includeChildQueues,
  boolean recursive) throws IOException {
 if (!queueMgr.exists(queueName)) {
  throw new IOException("queue " + queueName + " does not exist");
 }
 return queueMgr.getQueue(queueName).getQueueInfo(includeChildQueues,
   recursive);
}

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

@Override
protected String getReservationQueueName(String planQueueName,
  String reservationQueueName) {
 String planQueueNameFullPath = fs.getQueueManager().getQueue
   (planQueueName).getName();
 if (!reservationQueueName.startsWith(planQueueNameFullPath)) {
  // If name is not a path we need full path for FairScheduler. See
  // YARN-2773 for the root cause
  return planQueueNameFullPath + "." + reservationQueueName;
 }
 return reservationQueueName;
}

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

@Override
public QueueInfo getQueueInfo(String queueName, boolean includeChildQueues,
  boolean recursive) throws IOException {
 if (!queueMgr.exists(queueName)) {
  throw new IOException("queue " + queueName + " does not exist");
 }
 return queueMgr.getQueue(queueName).getQueueInfo(includeChildQueues,
   recursive);
}

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

@Override
protected String getReservationQueueName(String planQueueName,
  String reservationQueueName) {
 String planQueueNameFullPath = fs.getQueueManager().getQueue
   (planQueueName).getName();
 if (!reservationQueueName.startsWith(planQueueNameFullPath)) {
  // If name is not a path we need full path for FairScheduler. See
  // YARN-2773 for the root cause
  return planQueueNameFullPath + "." + reservationQueueName;
 }
 return reservationQueueName;
}

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

@Override
protected String getReservationQueueName(String planQueueName,
  String reservationQueueName) {
 String planQueueNameFullPath = fs.getQueueManager().getQueue
   (planQueueName).getName();
 if (!reservationQueueName.startsWith(planQueueNameFullPath)) {
  // If name is not a path we need full path for FairScheduler. See
  // YARN-2773 for the root cause
  return planQueueNameFullPath + "." + reservationQueueName;
 }
 return reservationQueueName;
}

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

@Override
public QueueInfo getQueueInfo(String queueName, boolean includeChildQueues,
  boolean recursive) throws IOException {
 if (!queueMgr.exists(queueName)) {
  throw new IOException("queue " + queueName + " does not exist");
 }
 return queueMgr.getQueue(queueName).getQueueInfo(includeChildQueues,
   recursive);
}

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

@Override
public boolean checkAccess(UserGroupInformation callerUGI,
  QueueACL acl, String queueName) {
 readLock.lock();
 try {
  FSQueue queue = getQueueManager().getQueue(queueName);
  if (queue == null) {
   if (LOG.isDebugEnabled()) {
    LOG.debug("ACL not found for queue access-type " + acl + " for queue "
      + queueName);
   }
   return false;
  }
  return queue.hasAccess(acl, callerUGI);
 } finally {
  readLock.unlock();
 }
}

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

private void ensureQueueExistsAndIsCompatibleAndIsStatic(
  AllocationConfiguration queueConf, FSQueueType queueType) {
 for (String name : queueConf.getConfiguredQueues().get(queueType)) {
  Boolean removed =
    removeEmptyIncompatibleQueues(name, queueType).orElse(null);
  if (Boolean.FALSE.equals(removed)) {
   incompatibleQueuesPendingRemoval.add(
     new IncompatibleQueueRemovalTask(name, queueType));
  } else {
   FSQueue queue = getQueue(name, true, queueType, false, null);
   if (queue != null) {
    queue.setDynamic(false);
   }
  }
 }
}

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

private String handleMoveToPlanQueue(String targetQueueName) {
 FSQueue dest = queueMgr.getQueue(targetQueueName);
 if (dest != null && allocConf.isReservable(dest.getQueueName())) {
  // use the default child reservation queue of the plan
  targetQueueName = getDefaultQueueForPlanQueue(targetQueueName);
 }
 return targetQueueName;
}

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

@Override
 public Plan getPlan(String planName) {
  // make sure plan name is a full queue name in fair scheduler. For example,
  // "root.default" is the full queue name for "default".
  FSQueue queue = fairScheduler.getQueueManager().getQueue(planName);

  if (queue != null) {
   return super.getPlan(queue.getQueueName());
  } else {
   return null;
  }
 }
}

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

private String handleMoveToPlanQueue(String targetQueueName) {
  FSQueue dest = queueMgr.getQueue(targetQueueName);
  if (dest != null && allocConf.isReservable(dest.getQueueName())) {
   // use the default child reservation queue of the plan
   targetQueueName = getDefaultQueueForPlanQueue(targetQueueName);
  }
  return targetQueueName;
 }
}

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

private String handleMoveToPlanQueue(String targetQueueName) {
  FSQueue dest = queueMgr.getQueue(targetQueueName);
  if (dest != null && allocConf.isReservable(dest.getQueueName())) {
   // use the default child reservation queue of the plan
   targetQueueName = getDefaultQueueForPlanQueue(targetQueueName);
  }
  return targetQueueName;
 }
}

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

/**
 * Submit an application to a given queue and take over the entire cluster.
 *
 * @param queueName queue name
 */
private void takeAllResources(String queueName) {
 // Create an app that takes up all the resources on the cluster
 ApplicationAttemptId appAttemptId
   = createSchedulingRequest(GB, 1, queueName, "default",
   NODE_CAPACITY_MULTIPLE * rmNodes.size());
 greedyApp = scheduler.getSchedulerApp(appAttemptId);
 scheduler.update();
 sendEnoughNodeUpdatesToAssignFully();
 assertEquals(8, greedyApp.getLiveContainers().size());
 // Verify preemptable for queue and app attempt
 assertTrue(
   scheduler.getQueueManager().getQueue(queueName).isPreemptable()
     == greedyApp.isPreemptable());
}

相关文章