本文整理汇总了Java中org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue类的典型用法代码示例。如果您正苦于以下问题:Java CSQueue类的具体用法?Java CSQueue怎么用?Java CSQueue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CSQueue类属于org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity包,在下文中一共展示了CSQueue类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: printString
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入依赖的package包/类
void printString(CSQueue nq, String indent) {
if (nq instanceof ParentQueue) {
System.out.println(indent + nq.getQueueName()
+ " cur:" + nq.getAbsoluteUsedCapacity()
+ " guar:" + nq.getAbsoluteCapacity()
);
for (CSQueue q : ((ParentQueue)nq).getChildQueues()) {
printString(q, indent + " ");
}
} else {
System.out.println(indent + nq.getQueueName()
+ " pen:" + ((LeafQueue) nq).getTotalResourcePending()
+ " cur:" + nq.getAbsoluteUsedCapacity()
+ " guar:" + nq.getAbsoluteCapacity()
);
for (FiCaSchedulerApp a : ((LeafQueue)nq).getApplications()) {
System.out.println(indent + " " + a.getApplicationId());
}
}
}
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:TestProportionalCapacityPreemptionPolicy.java
示例3: 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
示例4: printString
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入依赖的package包/类
void printString(CSQueue nq, String indent) {
if (nq instanceof ParentQueue) {
System.out.println(indent + nq.getQueueName()
+ " cur:" + nq.getAbsoluteUsedCapacity()
+ " guar:" + nq.getAbsoluteCapacity()
);
for (CSQueue q : ((ParentQueue)nq).getChildQueues()) {
printString(q, indent + " ");
}
} else {
System.out.println(indent + nq.getQueueName()
+ " pen:"
+ ((LeafQueue) nq).getTotalPendingResourcesConsideringUserLimit(
isA(Resource.class), isA(String.class))
+ " cur:" + nq.getAbsoluteUsedCapacity()
+ " guar:" + nq.getAbsoluteCapacity()
);
for (FiCaSchedulerApp a : ((LeafQueue)nq).getApplications()) {
System.out.println(indent + " " + a.getApplicationId());
}
}
}
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:23,代码来源:TestProportionalCapacityPreemptionPolicy.java
示例5: getUnallocatedReservedResources
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入依赖的package包/类
private Resource getUnallocatedReservedResources(
ReservationAllocation reservation) {
Resource resResource;
CSQueue resQueue =
scheduler.getQueue(reservation.getReservationId().toString());
if (resQueue != null) {
resResource =
Resources.subtract(
reservation.getResourcesAtTime(now),
Resources.multiply(scheduler.getClusterResource(),
resQueue.getAbsoluteCapacity()));
} else {
resResource = reservation.getResourcesAtTime(now);
}
return resResource;
}
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:17,代码来源:CapacitySchedulerPlanFollower.java
示例6: initializePlan
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入依赖的package包/类
@Override
protected Plan initializePlan(String planQueueName) throws YarnException {
SharingPolicy adPolicy = getAdmissionPolicy(planQueueName);
String planQueuePath = capScheduler.getQueue(planQueueName).getQueuePath();
adPolicy.init(planQueuePath, capScheduler.getConfiguration());
CSQueue planQueue = capScheduler.getQueue(planQueueName);
// Calculate the max plan capacity
Resource minAllocation = capScheduler.getMinimumResourceCapability();
ResourceCalculator rescCalc = capScheduler.getResourceCalculator();
Resource totCap =
rescCalc.multiplyAndNormalizeDown(capScheduler.getClusterResource(),
planQueue.getAbsoluteCapacity(), minAllocation);
Plan plan =
new InMemoryPlan(capScheduler.getRootQueueMetrics(), adPolicy,
getAgent(planQueuePath), totCap, planStepSize, rescCalc,
minAllocation, capScheduler.getMaximumResourceCapability(),
planQueueName, getReplanner(planQueuePath), capScheduler
.getConfiguration().getMoveOnExpiry(planQueuePath));
LOG.info("Intialized plan {0} based on reservable queue {1}",
plan.toString(), planQueueName);
return plan;
}
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:23,代码来源:CapacityReservationSystem.java
示例7: CapacitySchedulerQueueInfo
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入依赖的package包/类
CapacitySchedulerQueueInfo(CSQueue q) {
queuePath = q.getQueuePath();
capacity = q.getCapacity() * 100;
usedCapacity = q.getUsedCapacity() * 100;
maxCapacity = q.getMaximumCapacity();
if (maxCapacity < EPSILON || maxCapacity > 1f)
maxCapacity = 1f;
maxCapacity *= 100;
absoluteCapacity = cap(q.getAbsoluteCapacity(), 0f, 1f) * 100;
absoluteMaxCapacity = cap(q.getAbsoluteMaximumCapacity(), 0f, 1f) * 100;
absoluteUsedCapacity = cap(q.getAbsoluteUsedCapacity(), 0f, 1f) * 100;
numApplications = q.getNumApplications();
usedResources = q.getUsedResources().toString();
queueName = q.getQueueName();
state = q.getState();
resourcesUsed = new ResourceInfo(q.getUsedResources());
}
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:20,代码来源:CapacitySchedulerQueueInfo.java
示例8: 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
示例9: CapacitySchedulerQueueInfo
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入依赖的package包/类
CapacitySchedulerQueueInfo(CSQueue q) {
queuePath = q.getQueuePath();
capacity = q.getCapacity() * 100;
usedCapacity = q.getUsedCapacity() * 100;
maxCapacity = q.getMaximumCapacity();
if (maxCapacity < EPSILON || maxCapacity > 1f)
maxCapacity = 1f;
maxCapacity *= 100;
absoluteCapacity = cap(q.getAbsoluteCapacity(), 0f, 1f) * 100;
absoluteMaxCapacity = cap(q.getAbsoluteMaximumCapacity(), 0f, 1f) * 100;
absoluteUsedCapacity = cap(q.getAbsoluteUsedCapacity(), 0f, 1f) * 100;
numApplications = q.getNumApplications();
queueName = q.getQueueName();
state = q.getState();
resourcesUsed = new ResourceInfo(q.getUsedResources());
}
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:19,代码来源:CapacitySchedulerQueueInfo.java
示例10: CapacitySchedulerQueueInfo
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入依赖的package包/类
CapacitySchedulerQueueInfo(CSQueue q, String nodeLabel) {
QueueCapacities qCapacities = q.getQueueCapacities();
ResourceUsage queueResourceUsage = q.getQueueResourceUsage();
queuePath = q.getQueuePath();
capacity = qCapacities.getCapacity(nodeLabel) * 100;
usedCapacity = q.getUsedCapacity(nodeLabel) * 100;
maxCapacity = qCapacities.getMaximumCapacity(nodeLabel);
if (maxCapacity < EPSILON || maxCapacity > 1f)
maxCapacity = 1f;
maxCapacity *= 100;
absoluteCapacity =
cap(qCapacities.getAbsoluteCapacity(nodeLabel), 0f, 1f) * 100;
absoluteMaxCapacity =
cap(qCapacities.getAbsoluteMaximumCapacity(nodeLabel), 0f, 1f) * 100;
absoluteUsedCapacity = q.getAbsoluteUsedCapacity(nodeLabel) * 100;
numApplications = q.getNumApplications();
queueName = q.getQueueName();
state = q.getState();
resourcesUsed = new ResourceInfo(queueResourceUsage.getUsed(nodeLabel));
if (q instanceof PlanQueue && !((PlanQueue) q).showReservationsAsQueues()) {
hideReservationQueues = true;
}
// add labels
Set<String> labelSet = q.getAccessibleNodeLabels();
if (labelSet != null) {
nodeLabels.addAll(labelSet);
Collections.sort(nodeLabels);
}
}
开发者ID:naver,项目名称:hadoop,代码行数:34,代码来源:CapacitySchedulerQueueInfo.java
示例11: CapacitySchedulerInfo
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入依赖的package包/类
public CapacitySchedulerInfo(CSQueue parent, NodeLabel nodeLabel) {
this.queueName = parent.getQueueName();
this.usedCapacity = parent.getUsedCapacity() * 100;
this.capacity = parent.getCapacity() * 100;
float max = parent.getMaximumCapacity();
if (max < EPSILON || max > 1f)
max = 1f;
this.maxCapacity = max * 100;
queues = getQueues(parent, nodeLabel);
}
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:CapacitySchedulerInfo.java
示例12: getPlanQueue
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入依赖的package包/类
@Override
protected Queue getPlanQueue(String planQueueName) {
CSQueue queue = cs.getQueue(planQueueName);
if (!(queue instanceof PlanQueue)) {
LOG.error("The Plan is not an PlanQueue!");
return null;
}
return queue;
}
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:CapacitySchedulerPlanFollower.java
示例13: getReservationQueueResourceIfExists
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入依赖的package包/类
@Override
protected Resource getReservationQueueResourceIfExists(Plan plan,
ReservationId reservationId) {
CSQueue resQueue = cs.getQueue(reservationId.toString());
Resource reservationResource = null;
if (resQueue != null) {
reservationResource = Resources.multiply(cs.getClusterResource(),
resQueue.getAbsoluteCapacity());
}
return reservationResource;
}
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:CapacitySchedulerPlanFollower.java
示例14: getPlanQueueCapacity
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入依赖的package包/类
@Override
protected Resource getPlanQueueCapacity(String planQueueName) {
Resource minAllocation = getMinAllocation();
ResourceCalculator rescCalc = getResourceCalculator();
CSQueue planQueue = capScheduler.getQueue(planQueueName);
return rescCalc.multiplyAndNormalizeDown(capScheduler.getClusterResource(),
planQueue.getAbsoluteCapacity(), minAllocation);
}
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:CapacityReservationSystem.java
示例15: editSchedule
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入依赖的package包/类
@Override
public void editSchedule() {
CSQueue root = scheduler.getRootQueue();
Resource clusterResources = Resources.clone(scheduler.getClusterResource());
clusterResources = getNonLabeledResources(clusterResources);
setNodeLabels(scheduler.getRMContext().getNodeLabelManager()
.getNodeLabels());
containerBasedPreemptOrKill(root, clusterResources);
}
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:ProportionalCapacityPreemptionPolicy.java
示例16: assertReservationQueueExists
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入依赖的package包/类
@Override
protected void assertReservationQueueExists(ReservationId r2,
double expectedCapacity, double expectedMaxCapacity) {
CSQueue q = cs.getQueue(r2.toString());
assertNotNull(q);
Assert.assertEquals(expectedCapacity, q.getCapacity(), 0.01);
Assert.assertEquals(expectedMaxCapacity, q.getMaximumCapacity(), 1.0);
}
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:TestCapacitySchedulerPlanFollower.java
示例17: mockParentQueue
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入依赖的package包/类
ParentQueue mockParentQueue(ParentQueue p, int subqueues,
Deque<ParentQueue> pqs) {
ParentQueue pq = mock(ParentQueue.class);
List<CSQueue> cqs = new ArrayList<CSQueue>();
when(pq.getChildQueues()).thenReturn(cqs);
for (int i = 0; i < subqueues; ++i) {
pqs.add(pq);
}
if (p != null) {
p.getChildQueues().add(pq);
}
return pq;
}
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:TestProportionalCapacityPreemptionPolicy.java
示例18: CapacitySchedulerQueueInfo
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入依赖的package包/类
CapacitySchedulerQueueInfo(CSQueue q) {
queuePath = q.getQueuePath();
capacity = q.getCapacity() * 100;
usedCapacity = q.getUsedCapacity() * 100;
maxCapacity = q.getMaximumCapacity();
if (maxCapacity < EPSILON || maxCapacity > 1f)
maxCapacity = 1f;
maxCapacity *= 100;
absoluteCapacity =
cap(q.getAbsoluteCapacity(), 0f, 1f) * 100;
absoluteMaxCapacity =
cap(q.getAbsoluteMaximumCapacity(), 0f, 1f) * 100;
absoluteUsedCapacity =
cap(q.getAbsoluteUsedCapacity(), 0f, 1f) * 100;
numApplications = q.getNumApplications();
allocatedContainers = q.getMetrics().getAllocatedContainers();
pendingContainers = q.getMetrics().getPendingContainers();
reservedContainers = q.getMetrics().getReservedContainers();
queueName = q.getQueueName();
state = q.getState();
resourcesUsed = new ResourceInfo(q.getUsedResources());
if (q instanceof PlanQueue && !((PlanQueue) q).showReservationsAsQueues()) {
hideReservationQueues = true;
}
// add labels
Set<String> labelSet = q.getAccessibleNodeLabels();
if (labelSet != null) {
nodeLabels.addAll(labelSet);
Collections.sort(nodeLabels);
}
QueueCapacities qCapacities = q.getQueueCapacities();
capacities = new QueueCapacitiesInfo(qCapacities);
ResourceUsage queueResourceUsage = q.getQueueResourceUsage();
populateQueueResourceUsage(queueResourceUsage);
}
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:41,代码来源:CapacitySchedulerQueueInfo.java
示例19: CapacitySchedulerInfo
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入依赖的package包/类
public CapacitySchedulerInfo(CSQueue parent, CapacityScheduler cs) {
this.queueName = parent.getQueueName();
this.usedCapacity = parent.getUsedCapacity() * 100;
this.capacity = parent.getCapacity() * 100;
float max = parent.getMaximumCapacity();
if (max < EPSILON || max > 1f)
max = 1f;
this.maxCapacity = max * 100;
capacities = new QueueCapacitiesInfo(parent.getQueueCapacities());
queues = getQueues(parent);
health = new CapacitySchedulerHealthInfo(cs);
}
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:14,代码来源:CapacitySchedulerInfo.java
示例20: checkAbsCapacities
import org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue; //导入依赖的package包/类
private void checkAbsCapacities(CSQueue queue, String partition,
float guaranteed, float max, float used) {
QueueCapacities qc = queue.getQueueCapacities();
Assert.assertEquals(guaranteed, qc.getAbsoluteCapacity(partition), 1e-3);
Assert.assertEquals(max, qc.getAbsoluteMaximumCapacity(partition), 1e-3);
Assert.assertEquals(used, qc.getAbsoluteUsedCapacity(partition), 1e-3);
}
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:8,代码来源:TestProportionalCapacityPreemptionPolicyForNodePartitions.java
注:本文中的org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论