HBASE-2410 spurious warnings from util.Sleeper

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@930985 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Daniel Cryans 2010-04-05 23:40:54 +00:00
parent b1c1873abe
commit 6baf69a757
2 changed files with 5 additions and 3 deletions

View File

@ -263,6 +263,7 @@ Release 0.21.0 - Unreleased
HBASE-2365 Double-assignment around split
HBASE-2398 NPE in HLog.append when calling writer.getLength
(Kannan Muthukkaruppan via Stack)
HBASE-2410 spurious warnings from util.Sleeper
IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable

View File

@ -34,7 +34,7 @@ public class Sleeper {
private final Log LOG = LogFactory.getLog(this.getClass().getName());
private final int period;
private final AtomicBoolean stop;
private static final long TIME_FOR_WARNING = 30000;
private static final long MINIMAL_DELTA_FOR_LOGGING = 10000;
/**
* @param sleep sleep time in milliseconds
@ -75,8 +75,9 @@ public class Sleeper {
Thread.sleep(waitTime);
woke = System.currentTimeMillis();
long slept = woke - now;
if (slept > TIME_FOR_WARNING) {
LOG.warn("We slept " + slept + "ms, this is likely due to a long " +
if (slept - this.period > MINIMAL_DELTA_FOR_LOGGING) {
LOG.warn("We slept " + slept + "ms instead of " + this.period +
"ms, this is likely due to a long " +
"garbage collecting pause and it's usually bad, " +
"see http://wiki.apache.org/hadoop/Hbase/Troubleshooting#A9");
}