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


Java CSQueue.getChildQueues方法代码示例

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


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

示例1: getQueues

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入方法依赖的package包/类
protected CapacitySchedulerQueueInfoList getQueues(CSQueue parent,
    NodeLabel nodeLabel) {
  CSQueue parentQueue = parent;
  CapacitySchedulerQueueInfoList queuesInfo =
      new CapacitySchedulerQueueInfoList();
  for (CSQueue queue : parentQueue.getChildQueues()) {
    CapacitySchedulerQueueInfo info;
    if (queue instanceof LeafQueue) {
      info =
          new CapacitySchedulerLeafQueueInfo((LeafQueue) queue,
              nodeLabel.getLabelName());
    } else {
      info = new CapacitySchedulerQueueInfo(queue, nodeLabel.getLabelName());
      info.queues = getQueues(queue, nodeLabel);
    }
    queuesInfo.addToQueueInfoList(info);
  }
  return queuesInfo;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:CapacitySchedulerInfo.java

示例2: getQueues

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入方法依赖的package包/类
protected CapacitySchedulerQueueInfoList getQueues(CSQueue parent) {
  CSQueue parentQueue = parent;
  CapacitySchedulerQueueInfoList queuesInfo =
      new CapacitySchedulerQueueInfoList();
  for (CSQueue queue : parentQueue.getChildQueues()) {
    CapacitySchedulerQueueInfo info;
    if (queue instanceof LeafQueue) {
      info =
          new CapacitySchedulerLeafQueueInfo((LeafQueue) queue);
    } else {
      info = new CapacitySchedulerQueueInfo(queue);
      info.queues = getQueues(queue);
    }
    queuesInfo.addToQueueInfoList(info);
  }
  return queuesInfo;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:18,代码来源:CapacitySchedulerInfo.java

示例3: refreshQueues

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入方法依赖的package包/类
public void refreshQueues(CSQueue parent, CSQueue current) {
  try {
    writeLock.lock();
    PreemptableQueue parentEntity = null;
    if (parent != null) {
      parentEntity = entities.get(parent.getQueueName());
    }

    if (!entities.containsKey(current.getQueueName())) {
      entities.put(current.getQueueName(),
          new PreemptableQueue(parentEntity));
    }

    if (current.getChildQueues() != null) {
      for (CSQueue child : current.getChildQueues()) {
        refreshQueues(current, child);
      }
    }
  }
  finally {
    writeLock.unlock();
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:24,代码来源:PreemptionManager.java

示例4: getQueues

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入方法依赖的package包/类
protected CapacitySchedulerQueueInfoList getQueues(CSQueue parent) {
  CSQueue parentQueue = parent;
  CapacitySchedulerQueueInfoList queuesInfo = new CapacitySchedulerQueueInfoList();
  for (CSQueue queue : parentQueue.getChildQueues()) {
    CapacitySchedulerQueueInfo info;
    if (queue instanceof LeafQueue) {
      info = new CapacitySchedulerLeafQueueInfo((LeafQueue)queue);
    } else {
      info = new CapacitySchedulerQueueInfo(queue);
      info.queues = getQueues(queue);
    }
    queuesInfo.addToQueueInfoList(info);
  }
  return queuesInfo;
}
 
开发者ID:yncxcw,项目名称:big-c,代码行数:16,代码来源:CapacitySchedulerInfo.java

示例5: cloneQueues

import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入方法依赖的package包/类
/**
 * This method walks a tree of CSQueue and clones the portion of the state
 * relevant for preemption in TempQueue(s). It also maintains a pointer to
 * the leaves. Finally it aggregates pending resources in each queue and rolls
 * it up to higher levels.
 *
 * @param curQueue current queue which I'm looking at now
 * @param partitionResource the total amount of resources in the cluster
 * @return the root of the cloned queue hierarchy
 */
private TempQueuePerPartition cloneQueues(CSQueue curQueue,
    Resource partitionResource, String partitionToLookAt) {
  TempQueuePerPartition ret;
  synchronized (curQueue) {
    String queueName = curQueue.getQueueName();
    QueueCapacities qc = curQueue.getQueueCapacities();
    float absCap = qc.getAbsoluteCapacity(partitionToLookAt);
    float absMaxCap = qc.getAbsoluteMaximumCapacity(partitionToLookAt);
    boolean preemptionDisabled = curQueue.getPreemptionDisabled();

    Resource current = Resources.clone(
        curQueue.getQueueResourceUsage().getUsed(partitionToLookAt));
    Resource killable = Resources.none();

    Resource reserved = Resources.clone(
        curQueue.getQueueResourceUsage().getReserved(partitionToLookAt));
    if (null != preemptableQueues.get(queueName)) {
      killable = Resources.clone(preemptableQueues.get(queueName)
          .getKillableResource(partitionToLookAt));
    }

    // when partition is a non-exclusive partition, the actual maxCapacity
    // could more than specified maxCapacity
    try {
      if (!scheduler.getRMContext().getNodeLabelManager()
          .isExclusiveNodeLabel(partitionToLookAt)) {
        absMaxCap = 1.0f;
      }
    } catch (IOException e) {
      // This may cause by partition removed when running capacity monitor,
      // just ignore the error, this will be corrected when doing next check.
    }

    ret = new TempQueuePerPartition(queueName, current, preemptionDisabled,
        partitionToLookAt, killable, absCap, absMaxCap, partitionResource,
        reserved, curQueue);

    if (curQueue instanceof ParentQueue) {
      // Recursively add children
      for (CSQueue c : curQueue.getChildQueues()) {
        TempQueuePerPartition subq = cloneQueues(c, partitionResource,
            partitionToLookAt);
        ret.addChild(subq);
      }
    }
  }
  addTempQueuePartition(ret);
  return ret;
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:60,代码来源:ProportionalCapacityPreemptionPolicy.java


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