Index:conf/hbase-default.xml =================================================================== ---conf/hbase-default.xml (revision 627044) +++conf/hbase-default.xml (working copy) @@ -156,6 +156,16 @@ + hbase.regionserver.optionallogrollinterval + 1800000 + + Amount of time to wait since the last time a the region server's log was + rolled before invoking an optional log roll (An optional log roll is a + one in which the log does not contain hbase.regionserver.maxlogentries). + Default: 30 minutes (in miliseconds) + + + hbase.hregion.memcache.flush.size 67108864 Index:src/java/org/apache/hadoop/hbase/HRegionServer.java =================================================================== ---src/java/org/apache/hadoop/hbase/HRegionServer.java (revision 627044) +++src/java/org/apache/hadoop/hbase/HRegionServer.java (working copy) @@ -508,12 +508,17 @@ /** Runs periodically to determine if the HLog should be rolled */ class LogRoller extends Thread implements LogRollListener { private final Integer rollLock = new Integer(0); + private final long optionalLogRollInterval; + private long lastLogRollTime; private volatile boolean rollLog; /** constructor */ public LogRoller() { super(); + this.optionalLogRollInterval = conf.getLong( + "hbase.regionserver.optionallogrollinterval", 30L * 60L * 1000L); this.rollLog = false; + lastLogRollTime = System.currentTimeMillis(); } /** {@inheritDoc} */ @@ -521,12 +526,18 @@ public void run() { while (!stopRequested.get()) { while (!rollLog && !stopRequested.get()) { - synchronized (rollLock) { - try { - rollLock.wait(threadWakeFrequency); + long now = System.currentTimeMillis(); + if (this.lastLogRollTime + this.optionalLogRollInterval <= now) { + rollLog = true; + this.lastLogRollTime = now; + } else { + synchronized (rollLock) { + try { + rollLock.wait(threadWakeFrequency); - } catch (InterruptedException e) { - continue; + } catch (InterruptedException e) { + continue; + } } } }