YARN-8441. Typo in CSQueueUtils local variable names: queueGuranteedResource. Contributed by Szilard Nemeth.

This commit is contained in:
Miklos Szegedi 2018-06-20 11:58:18 -07:00
parent 388fafa004
commit 46f9058164

View File

@ -184,7 +184,7 @@ public static void updateUsedCapacity(final ResourceCalculator rc,
if (Resources.greaterThan(rc, totalPartitionResource, if (Resources.greaterThan(rc, totalPartitionResource,
totalPartitionResource, Resources.none())) { totalPartitionResource, Resources.none())) {
Resource queueGuranteedResource = childQueue Resource queueGuaranteedResource = childQueue
.getEffectiveCapacity(nodePartition); .getEffectiveCapacity(nodePartition);
//TODO : Modify below code to support Absolute Resource configurations //TODO : Modify below code to support Absolute Resource configurations
@ -204,14 +204,14 @@ public static void updateUsedCapacity(final ResourceCalculator rc,
QueueCapacities leafQueueTemplateCapacities = parentQueue QueueCapacities leafQueueTemplateCapacities = parentQueue
.getLeafQueueTemplate() .getLeafQueueTemplate()
.getQueueCapacities(); .getQueueCapacities();
queueGuranteedResource = Resources.multiply(totalPartitionResource, queueGuaranteedResource = Resources.multiply(totalPartitionResource,
leafQueueTemplateCapacities.getAbsoluteCapacity leafQueueTemplateCapacities.getAbsoluteCapacity
(nodePartition)); (nodePartition));
} }
// make queueGuranteed >= minimum_allocation to avoid divided by 0. // make queueGuranteed >= minimum_allocation to avoid divided by 0.
queueGuranteedResource = queueGuaranteedResource =
Resources.max(rc, totalPartitionResource, queueGuranteedResource, Resources.max(rc, totalPartitionResource, queueGuaranteedResource,
minimumAllocation); minimumAllocation);
Resource usedResource = queueResourceUsage.getUsed(nodePartition); Resource usedResource = queueResourceUsage.getUsed(nodePartition);
@ -220,12 +220,12 @@ public static void updateUsedCapacity(final ResourceCalculator rc,
totalPartitionResource); totalPartitionResource);
usedCapacity = usedCapacity =
Resources.divide(rc, totalPartitionResource, usedResource, Resources.divide(rc, totalPartitionResource, usedResource,
queueGuranteedResource); queueGuaranteedResource);
Resource resResource = queueResourceUsage.getReserved(nodePartition); Resource resResource = queueResourceUsage.getReserved(nodePartition);
reservedCapacity = reservedCapacity =
Resources.divide(rc, totalPartitionResource, resResource, Resources.divide(rc, totalPartitionResource, resResource,
queueGuranteedResource); queueGuaranteedResource);
absoluteReservedCapacity = absoluteReservedCapacity =
Resources.divide(rc, totalPartitionResource, resResource, Resources.divide(rc, totalPartitionResource, resResource,
totalPartitionResource); totalPartitionResource);
@ -258,16 +258,16 @@ private static Resource getMaxAvailableResourceToQueue(
for (String partition : nodeLabels) { for (String partition : nodeLabels) {
// Calculate guaranteed resource for a label in a queue by below logic. // Calculate guaranteed resource for a label in a queue by below logic.
// (total label resource) * (absolute capacity of label in that queue) // (total label resource) * (absolute capacity of label in that queue)
Resource queueGuranteedResource = queue.getEffectiveCapacity(partition); Resource queueGuaranteedResource = queue.getEffectiveCapacity(partition);
// Available resource in queue for a specific label will be calculated as // Available resource in queue for a specific label will be calculated as
// {(guaranteed resource for a label in a queue) - // {(guaranteed resource for a label in a queue) -
// (resource usage of that label in the queue)} // (resource usage of that label in the queue)}
// Finally accumulate this available resource to get total. // Finally accumulate this available resource to get total.
Resource available = (Resources.greaterThan(rc, cluster, Resource available = (Resources.greaterThan(rc, cluster,
queueGuranteedResource, queueGuaranteedResource,
queue.getQueueResourceUsage().getUsed(partition))) ? Resources queue.getQueueResourceUsage().getUsed(partition))) ? Resources
.componentwiseMax(Resources.subtractFrom(queueGuranteedResource, .componentwiseMax(Resources.subtractFrom(queueGuaranteedResource,
queue.getQueueResourceUsage().getUsed(partition)), Resources queue.getQueueResourceUsage().getUsed(partition)), Resources
.none()) : Resources.none(); .none()) : Resources.none();
Resources.addTo(totalAvailableResource, available); Resources.addTo(totalAvailableResource, available);