本文整理汇总了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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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;
}