YARN-4057. If ContainersMonitor is not enabled, only print related log info one time. Contributed by Jun Gong.

This commit is contained in:
Zhihai Xu 2015-08-18 11:36:02 -07:00
parent 3a76a010b8
commit 14215c8ef8
2 changed files with 10 additions and 3 deletions

View File

@ -404,6 +404,9 @@ Release 2.8.0 - UNRELEASED
YARN-4031. Add JvmPauseMonitor to ApplicationHistoryServer and
WebAppProxyServer (djp via rkanter)
YARN-4057. If ContainersMonitor is not enabled, only print
related log info one time. (Jun Gong via zxu)
OPTIMIZATIONS
YARN-3339. TestDockerContainerExecutor should pull a single image and not

View File

@ -73,6 +73,7 @@ public class ContainersMonitorImpl extends AbstractService implements
private boolean pmemCheckEnabled;
private boolean vmemCheckEnabled;
private boolean containersMonitorEnabled;
private long maxVCoresAllottedForContainers;
@ -153,6 +154,9 @@ protected void serviceInit(Configuration conf) throws Exception {
LOG.info("Physical memory check enabled: " + pmemCheckEnabled);
LOG.info("Virtual memory check enabled: " + vmemCheckEnabled);
containersMonitorEnabled = isEnabled();
LOG.info("ContainersMonitor enabled: " + containersMonitorEnabled);
nodeCpuPercentageForYARN =
NodeManagerHardwareUtils.getNodeCpuPercentage(conf);
@ -205,7 +209,7 @@ private boolean isEnabled() {
@Override
protected void serviceStart() throws Exception {
if (this.isEnabled()) {
if (containersMonitorEnabled) {
this.monitoringThread.start();
}
super.serviceStart();
@ -213,7 +217,7 @@ protected void serviceStart() throws Exception {
@Override
protected void serviceStop() throws Exception {
if (this.isEnabled()) {
if (containersMonitorEnabled) {
this.monitoringThread.interrupt();
try {
this.monitoringThread.join();
@ -648,7 +652,7 @@ public void setContainersUtilization(ResourceUtilization utilization) {
@Override
public void handle(ContainersMonitorEvent monitoringEvent) {
if (!isEnabled()) {
if (!containersMonitorEnabled) {
return;
}