YARN-6977. Node information is not provided for non am containers in RM logs. (Suma Shivaprasad via wangda)

Change-Id: I0c44d09a560446dee2ba68c2b9ae69fce0ec1d3e
(cherry picked from commit 8a42e922fad613f3cf1cc6cb0f3fa72546a9cc56)
This commit is contained in:
Wangda Tan 2017-09-15 21:24:11 -07:00
parent ef8cd5dc56
commit 958e8c0e25
3 changed files with 23 additions and 8 deletions

View File

@ -170,14 +170,6 @@ protected synchronized void allocateContainer(RMContainer rmContainer,
launchedContainers.put(container.getId(),
new ContainerInfo(rmContainer, launchedOnNode));
if (LOG.isDebugEnabled()) {
LOG.debug("Assigned container " + container.getId() + " of capacity "
+ container.getResource() + " on host " + rmNode.getNodeAddress()
+ ", which has " + numContainers + " containers, "
+ getAllocatedResource() + " used and " + getUnallocatedResource()
+ " available after allocation");
}
}
/**

View File

@ -160,4 +160,17 @@ public synchronized Resource getTotalKillableResources() {
public synchronized Map<ContainerId, RMContainer> getKillableContainers() {
return Collections.unmodifiableMap(killableContainers);
}
protected synchronized void allocateContainer(RMContainer rmContainer,
boolean launchedOnNode) {
super.allocateContainer(rmContainer, launchedOnNode);
final Container container = rmContainer.getContainer();
LOG.info("Assigned container " + container.getId() + " of capacity "
+ container.getResource() + " on host " + getRMNode().getNodeAddress()
+ ", which has " + getNumContainers() + " containers, "
+ getAllocatedResource() + " used and " + getUnallocatedResource()
+ " available after allocation");
}
}

View File

@ -25,6 +25,7 @@
import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
import org.apache.hadoop.yarn.api.records.Container;
import org.apache.hadoop.yarn.api.records.ContainerId;
import org.apache.hadoop.yarn.api.records.Resource;
import org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainer;
@ -239,6 +240,15 @@ Set<RMContainer> getContainersForPreemption() {
protected synchronized void allocateContainer(RMContainer rmContainer,
boolean launchedOnNode) {
super.allocateContainer(rmContainer, launchedOnNode);
if (LOG.isDebugEnabled()) {
final Container container = rmContainer.getContainer();
LOG.debug("Assigned container " + container.getId() + " of capacity "
+ container.getResource() + " on host " + getRMNode().getNodeAddress()
+ ", which has " + getNumContainers() + " containers, "
+ getAllocatedResource() + " used and " + getUnallocatedResource()
+ " available after allocation");
}
Resource allocated = rmContainer.getAllocatedResource();
if (!Resources.isNone(allocated)) {
// check for satisfied preemption request and update bookkeeping