hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r930985 - in /hadoop/hbase/trunk: CHANGES.txt core/src/main/java/org/apache/hadoop/hbase/util/Sleeper.java
Date Mon, 05 Apr 2010 23:40:54 GMT
Author: jdcryans
Date: Mon Apr  5 23:40:54 2010
New Revision: 930985

URL: http://svn.apache.org/viewvc?rev=930985&view=rev
Log:
HBASE-2410  spurious warnings from util.Sleeper

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/util/Sleeper.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=930985&r1=930984&r2=930985&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Mon Apr  5 23:40:54 2010
@@ -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

Modified: hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/util/Sleeper.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/util/Sleeper.java?rev=930985&r1=930984&r2=930985&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/util/Sleeper.java (original)
+++ hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/util/Sleeper.java Mon Apr
 5 23:40:54 2010
@@ -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");
         }



Mime
View raw message