YARN-5899. Debug log in AbstractCSQueue#canAssignToThisQueue needs improvement. Contributed by Ying Zhang.

(cherry picked from commit 9594c35dcb)
This commit is contained in:
Sunil G 2017-01-10 14:08:01 +05:30
parent 74bf9c6e4b
commit 3190a4ba44
1 changed files with 28 additions and 17 deletions

View File

@ -632,30 +632,41 @@ public abstract class AbstractCSQueue implements CSQueue {
if (Resources.lessThan(resourceCalculator, clusterResource, if (Resources.lessThan(resourceCalculator, clusterResource,
newTotalWithoutReservedResource, currentLimitResource)) { newTotalWithoutReservedResource, currentLimitResource)) {
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug( LOG.debug("try to use reserved: " + getQueueName()
"try to use reserved: " + getQueueName() + " usedResources: " + " usedResources: " + queueUsage.getUsed()
+ queueUsage.getUsed() + ", clusterResources: " + ", clusterResources: " + clusterResource
+ clusterResource + ", reservedResources: " + ", reservedResources: " + resourceCouldBeUnreserved
+ resourceCouldBeUnreserved
+ ", capacity-without-reserved: " + ", capacity-without-reserved: "
+ newTotalWithoutReservedResource + ", maxLimitCapacity: " + newTotalWithoutReservedResource
+ currentLimitResource); + ", maxLimitCapacity: " + currentLimitResource);
} }
return true; return true;
} }
} }
// Can not assign to this queue
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug(getQueueName() + "Check assign to queue, nodePartition=" LOG.debug("Failed to assign to queue: " + getQueueName()
+ nodePartition + " usedResources: " + queueUsage + " nodePatrition: " + nodePartition
.getUsed(nodePartition) + " clusterResources: " + clusterResource + ", usedResources: " + queueUsage.getUsed(nodePartition)
+ " currentUsedCapacity " + Resources + ", clusterResources: " + clusterResource
+ ", reservedResources: " + resourceCouldBeUnreserved
+ ", maxLimitCapacity: " + currentLimitResource
+ ", currTotalUsed:" + usedExceptKillable);
}
return false;
}
if (LOG.isDebugEnabled()) {
LOG.debug("Check assign to queue: " + getQueueName()
+ " nodePartition: " + nodePartition
+ ", usedResources: " + queueUsage.getUsed(nodePartition)
+ ", clusterResources: " + clusterResource
+ ", currentUsedCapacity: " + Resources
.divide(resourceCalculator, clusterResource, .divide(resourceCalculator, clusterResource,
queueUsage.getUsed(nodePartition), labelManager queueUsage.getUsed(nodePartition), labelManager
.getResourceByLabel(nodePartition, clusterResource)) .getResourceByLabel(nodePartition, clusterResource))
+ " max-capacity: " + queueCapacities + ", max-capacity: " + queueCapacities
.getAbsoluteMaximumCapacity(nodePartition) + ")"); .getAbsoluteMaximumCapacity(nodePartition));
}
return false;
} }
return true; return true;
} finally { } finally {