YARN-8045. Reduce log output from container status calls. Contributed by Craig Condit
(cherry picked from commit 144a55f0e3
)
This commit is contained in:
parent
a503662d6c
commit
9aae72af84
|
@ -1431,10 +1431,37 @@ public class ContainerManagerImpl extends CompositeService implements
|
|||
}
|
||||
}
|
||||
ContainerStatus containerStatus = container.cloneAndGetContainerStatus();
|
||||
LOG.info("Returning " + containerStatus);
|
||||
logContainerStatus("Returning ", containerStatus);
|
||||
return containerStatus;
|
||||
}
|
||||
|
||||
private void logContainerStatus(String prefix, ContainerStatus status) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(prefix);
|
||||
sb.append("ContainerStatus: [");
|
||||
sb.append("ContainerId: ");
|
||||
sb.append(status.getContainerId()).append(", ");
|
||||
sb.append("ExecutionType: ");
|
||||
sb.append(status.getExecutionType()).append(", ");
|
||||
sb.append("State: ");
|
||||
sb.append(status.getState()).append(", ");
|
||||
sb.append("Capability: ");
|
||||
sb.append(status.getCapability()).append(", ");
|
||||
sb.append("Diagnostics: ");
|
||||
sb.append(LOG.isDebugEnabled() ? status.getDiagnostics() : "...");
|
||||
sb.append(", ");
|
||||
sb.append("ExitStatus: ");
|
||||
sb.append(status.getExitStatus()).append(", ");
|
||||
sb.append("IP: ");
|
||||
sb.append(status.getIPs()).append(", ");
|
||||
sb.append("Host: ");
|
||||
sb.append(status.getHost()).append(", ");
|
||||
sb.append("ContainerSubState: ");
|
||||
sb.append(status.getContainerSubState());
|
||||
sb.append("]");
|
||||
LOG.info(sb.toString());
|
||||
}
|
||||
|
||||
@Private
|
||||
@VisibleForTesting
|
||||
protected void authorizeGetAndStopContainerRequest(ContainerId containerId,
|
||||
|
|
Loading…
Reference in New Issue