org.apache.hadoop.hbase.util
Class JvmPauseMonitor
java.lang.Object
org.apache.hadoop.hbase.util.JvmPauseMonitor
@InterfaceAudience.Private
public class JvmPauseMonitor
- extends Object
Class which sets up a simple thread which runs in a loop sleeping
for a short interval of time. If the sleep takes significantly longer
than its target time, it implies that the JVM or host machine has
paused processing, which may cause other problems. If such a pause is
detected, the thread logs a message.
The original JvmPauseMonitor is:
${hadoop-common-project}/hadoop-common/src/main/java/org/apache/hadoop/util/
JvmPauseMonitor.java
r1503806 | cmccabe | 2013-07-17 01:48:24 +0800 (Wed, 17 Jul 2013) | 1 line
HADOOP-9618. thread which detects GC pauses(Todd Lipcon)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WARN_THRESHOLD_KEY
public static final String WARN_THRESHOLD_KEY
- See Also:
- Constant Field Values
INFO_THRESHOLD_KEY
public static final String INFO_THRESHOLD_KEY
- See Also:
- Constant Field Values
JvmPauseMonitor
public JvmPauseMonitor(org.apache.hadoop.conf.Configuration conf)
JvmPauseMonitor
public JvmPauseMonitor(org.apache.hadoop.conf.Configuration conf,
JvmPauseMonitorSource metricsSource)
start
public void start()
stop
public void stop()
updateMetrics
public void updateMetrics(long sleepTime,
boolean gcDetected)
getMetricsSource
public JvmPauseMonitorSource getMetricsSource()
setMetricsSource
public void setMetricsSource(JvmPauseMonitorSource metricsSource)
main
public static void main(String[] args)
throws Exception
- Simple 'main' to facilitate manual testing of the pause monitor.
This main function just leaks memory into a list. Running this class
with a 1GB heap will very quickly go into "GC hell" and result in
log messages about the GC pauses.
- Throws:
Exception
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.