HADOOP-19281. MetricsSystemImpl should not print INFO message in CLI (#7071)
Replaced all LOG.info with LOG.debug Contributed by Sarveksha Yeshavantha Raju
This commit is contained in:
parent
3d81dde28b
commit
01401d71ef
@ -26,12 +26,12 @@
|
|||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.security.PrivilegedAction;
|
import java.security.PrivilegedAction;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.apache.hadoop.thirdparty.com.google.common.base.Joiner;
|
|
||||||
import org.apache.hadoop.thirdparty.com.google.common.base.Splitter;
|
import org.apache.hadoop.thirdparty.com.google.common.base.Splitter;
|
||||||
import org.apache.hadoop.thirdparty.com.google.common.collect.Iterables;
|
import org.apache.hadoop.thirdparty.com.google.common.collect.Iterables;
|
||||||
import org.apache.hadoop.thirdparty.com.google.common.collect.Maps;
|
import org.apache.hadoop.thirdparty.com.google.common.collect.Maps;
|
||||||
@ -106,8 +106,8 @@ static MetricsConfig create(String prefix, String... fileNames) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Load configuration from a list of files until the first successful load
|
* Load configuration from a list of files until the first successful load
|
||||||
* @param conf the configuration object
|
* @param prefix The prefix of the configuration.
|
||||||
* @param files the list of filenames to try
|
* @param fileNames the list of filenames to try.
|
||||||
* @return the configuration object
|
* @return the configuration object
|
||||||
*/
|
*/
|
||||||
static MetricsConfig loadFirst(String prefix, String... fileNames) {
|
static MetricsConfig loadFirst(String prefix, String... fileNames) {
|
||||||
@ -119,10 +119,7 @@ static MetricsConfig loadFirst(String prefix, String... fileNames) {
|
|||||||
fh.setFileName(fname);
|
fh.setFileName(fname);
|
||||||
fh.load();
|
fh.load();
|
||||||
Configuration cf = pcf.interpolatedConfiguration();
|
Configuration cf = pcf.interpolatedConfiguration();
|
||||||
LOG.info("Loaded properties from {}", fname);
|
LOG.debug("Loaded properties from {}: {}", fname, cf);
|
||||||
if (LOG.isDebugEnabled()) {
|
|
||||||
LOG.debug("Properties: {}", toString(cf));
|
|
||||||
}
|
|
||||||
MetricsConfig mc = new MetricsConfig(cf, prefix);
|
MetricsConfig mc = new MetricsConfig(cf, prefix);
|
||||||
LOG.debug("Metrics Config: {}", mc);
|
LOG.debug("Metrics Config: {}", mc);
|
||||||
return mc;
|
return mc;
|
||||||
@ -135,8 +132,7 @@ static MetricsConfig loadFirst(String prefix, String... fileNames) {
|
|||||||
throw new MetricsConfigException(e);
|
throw new MetricsConfigException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG.warn("Cannot locate configuration: tried " +
|
LOG.debug("Cannot locate configuration: tried {}", Arrays.asList(fileNames));
|
||||||
Joiner.on(",").join(fileNames));
|
|
||||||
// default to an empty configuration
|
// default to an empty configuration
|
||||||
return new MetricsConfig(new PropertiesConfiguration(), prefix);
|
return new MetricsConfig(new PropertiesConfiguration(), prefix);
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ public synchronized MetricsSystem init(String prefix) {
|
|||||||
++refCount;
|
++refCount;
|
||||||
if (monitoring) {
|
if (monitoring) {
|
||||||
// in mini cluster mode
|
// in mini cluster mode
|
||||||
LOG.info(this.prefix +" metrics system started (again)");
|
LOG.debug("{} metrics system started (again)", prefix);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
switch (initMode()) {
|
switch (initMode()) {
|
||||||
@ -169,7 +169,7 @@ public synchronized MetricsSystem init(String prefix) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case STANDBY:
|
case STANDBY:
|
||||||
LOG.info(prefix +" metrics system started in standby mode");
|
LOG.debug("{} metrics system started in standby mode", prefix);
|
||||||
}
|
}
|
||||||
initSystemMBean();
|
initSystemMBean();
|
||||||
return this;
|
return this;
|
||||||
@ -188,7 +188,7 @@ public synchronized void start() {
|
|||||||
configure(prefix);
|
configure(prefix);
|
||||||
startTimer();
|
startTimer();
|
||||||
monitoring = true;
|
monitoring = true;
|
||||||
LOG.info(prefix +" metrics system started");
|
LOG.debug("{} metrics system started", prefix);
|
||||||
for (Callback cb : callbacks) cb.postStart();
|
for (Callback cb : callbacks) cb.postStart();
|
||||||
for (Callback cb : namedCallbacks.values()) cb.postStart();
|
for (Callback cb : namedCallbacks.values()) cb.postStart();
|
||||||
}
|
}
|
||||||
@ -202,18 +202,18 @@ public synchronized void stop() {
|
|||||||
}
|
}
|
||||||
if (!monitoring) {
|
if (!monitoring) {
|
||||||
// in mini cluster mode
|
// in mini cluster mode
|
||||||
LOG.info(prefix +" metrics system stopped (again)");
|
LOG.debug("{} metrics system stopped (again)", prefix);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (Callback cb : callbacks) cb.preStop();
|
for (Callback cb : callbacks) cb.preStop();
|
||||||
for (Callback cb : namedCallbacks.values()) cb.preStop();
|
for (Callback cb : namedCallbacks.values()) cb.preStop();
|
||||||
LOG.info("Stopping "+ prefix +" metrics system...");
|
LOG.debug("Stopping {} metrics system...", prefix);
|
||||||
stopTimer();
|
stopTimer();
|
||||||
stopSources();
|
stopSources();
|
||||||
stopSinks();
|
stopSinks();
|
||||||
clearConfigs();
|
clearConfigs();
|
||||||
monitoring = false;
|
monitoring = false;
|
||||||
LOG.info(prefix +" metrics system stopped.");
|
LOG.debug("{} metrics system stopped.", prefix);
|
||||||
for (Callback cb : callbacks) cb.postStop();
|
for (Callback cb : callbacks) cb.postStop();
|
||||||
for (Callback cb : namedCallbacks.values()) cb.postStop();
|
for (Callback cb : namedCallbacks.values()) cb.postStop();
|
||||||
}
|
}
|
||||||
@ -302,7 +302,7 @@ synchronized void registerSink(String name, String desc, MetricsSink sink) {
|
|||||||
sinks.put(name, sa);
|
sinks.put(name, sa);
|
||||||
allSinks.put(name, sink);
|
allSinks.put(name, sink);
|
||||||
sa.start();
|
sa.start();
|
||||||
LOG.info("Registered sink "+ name);
|
LOG.debug("Registered sink {}", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -375,8 +375,7 @@ public void run() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, millis, millis);
|
}, millis, millis);
|
||||||
LOG.info("Scheduled Metric snapshot period at " + (period / 1000)
|
LOG.debug("Scheduled Metric snapshot period at {} second(s).", period / 1000);
|
||||||
+ " second(s).");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized void onTimerEvent() {
|
synchronized void onTimerEvent() {
|
||||||
@ -609,7 +608,7 @@ public synchronized boolean shutdown() {
|
|||||||
MBeans.unregister(mbeanName);
|
MBeans.unregister(mbeanName);
|
||||||
mbeanName = null;
|
mbeanName = null;
|
||||||
}
|
}
|
||||||
LOG.info(prefix +" metrics system shutdown complete.");
|
LOG.debug("{} metrics system shutdown complete.", prefix);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user