YARN-3258. FairScheduler: Need to add more logging to investigate allocations. Contributed by Anubhav Dhoot.

This commit is contained in:
Tsuyoshi Ozawa 2015-03-31 17:42:44 +09:00
parent 85dc3c14b2
commit b5a22e9838
4 changed files with 22 additions and 1 deletions

View File

@ -86,6 +86,9 @@ Release 2.8.0 - UNRELEASED
YARN-2495. Allow admin specify labels from each NM (Distributed YARN-2495. Allow admin specify labels from each NM (Distributed
configuration for node label). (Naganarasimha G R via wangda) configuration for node label). (Naganarasimha G R via wangda)
YARN-3258. FairScheduler: Need to add more logging to investigate
allocations. (Anubhav Dhoot via ozawa)
OPTIMIZATIONS OPTIMIZATIONS
YARN-3339. TestDockerContainerExecutor should pull a single image and not YARN-3339. TestDockerContainerExecutor should pull a single image and not

View File

@ -570,6 +570,10 @@ public class FSAppAttempt extends SchedulerApplicationAttempt
// Check the AM resource usage for the leaf queue // Check the AM resource usage for the leaf queue
if (getLiveContainers().size() == 0 && !getUnmanagedAM()) { if (getLiveContainers().size() == 0 && !getUnmanagedAM()) {
if (!getQueue().canRunAppAM(getAMResource())) { if (!getQueue().canRunAppAM(getAMResource())) {
if (LOG.isDebugEnabled()) {
LOG.debug("Skipping allocation because maxAMShare limit would " +
"be exceeded");
}
return Resources.none(); return Resources.none();
} }
} }

View File

@ -284,6 +284,8 @@ public class FSLeafQueue extends FSQueue {
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("The updated demand for " + getName() + " is " + demand LOG.debug("The updated demand for " + getName() + " is " + demand
+ "; the max is " + maxRes); + "; the max is " + maxRes);
LOG.debug("The updated fairshare for " + getName() + " is "
+ getFairShare());
} }
} }
@ -304,7 +306,7 @@ public class FSLeafQueue extends FSQueue {
Resource assigned = Resources.none(); Resource assigned = Resources.none();
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("Node " + node.getNodeName() + " offered to queue: " + LOG.debug("Node " + node.getNodeName() + " offered to queue: " +
getName()); getName() + " fairShare: " + getFairShare());
} }
if (!assignContainerPreCheck(node)) { if (!assignContainerPreCheck(node)) {
@ -330,6 +332,10 @@ public class FSLeafQueue extends FSQueue {
assigned = sched.assignContainer(node); assigned = sched.assignContainer(node);
if (!assigned.equals(Resources.none())) { if (!assigned.equals(Resources.none())) {
if (LOG.isDebugEnabled()) {
LOG.debug("Assigned container in queue:" + getName() + " " +
"container:" + assigned);
}
break; break;
} }
} }

View File

@ -23,6 +23,8 @@ import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceAudience.Private; import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.UserGroupInformation;
@ -41,6 +43,9 @@ import org.apache.hadoop.yarn.util.resource.Resources;
@Private @Private
@Unstable @Unstable
public abstract class FSQueue implements Queue, Schedulable { public abstract class FSQueue implements Queue, Schedulable {
private static final Log LOG = LogFactory.getLog(
FSQueue.class.getName());
private Resource fairShare = Resources.createResource(0, 0); private Resource fairShare = Resources.createResource(0, 0);
private Resource steadyFairShare = Resources.createResource(0, 0); private Resource steadyFairShare = Resources.createResource(0, 0);
private final String name; private final String name;
@ -164,6 +169,9 @@ public abstract class FSQueue implements Queue, Schedulable {
public void setFairShare(Resource fairShare) { public void setFairShare(Resource fairShare) {
this.fairShare = fairShare; this.fairShare = fairShare;
metrics.setFairShare(fairShare); metrics.setFairShare(fairShare);
if (LOG.isDebugEnabled()) {
LOG.debug("The updated fairShare for " + getName() + " is " + fairShare);
}
} }
/** Get the steady fair share assigned to this Schedulable. */ /** Get the steady fair share assigned to this Schedulable. */