HBASE-1816 Master rewrite; should have removed safe-mode from client-side too...

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@830801 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2009-10-29 00:01:44 +00:00
parent 66728e6f67
commit 67c1fc3436
3 changed files with 8 additions and 41 deletions

View File

@ -39,10 +39,6 @@ import org.apache.hadoop.util.StringUtils;
/**
* Compact region on request and then run split if appropriate
*
* NOTE: This class extends Thread rather than Chore because the sleep time
* can be interrupted when there is something to do, rather than the Chore
* sleep time which is invariant.
*/
class CompactSplitThread extends Thread implements HConstants {
static final Log LOG = LogFactory.getLog(CompactSplitThread.class);
@ -74,7 +70,7 @@ class CompactSplitThread extends Thread implements HConstants {
@Override
public void run() {
while (!this.server.isStopRequested() && this.server.isInSafeMode()) {
while (!this.server.isStopRequested()) {
try {
Thread.sleep(this.frequency);
} catch (InterruptedException ex) {

View File

@ -126,8 +126,6 @@ public class HRegionServer implements HConstants, HRegionInterface,
protected final AtomicBoolean quiesced = new AtomicBoolean(false);
protected final AtomicBoolean safeMode = new AtomicBoolean(true);
// Go down hard. Used if file system becomes unavailable and also in
// debugging and unit tests.
protected volatile boolean abortRequested;
@ -861,28 +859,15 @@ public class HRegionServer implements HConstants, HRegionInterface,
}
/**
* Thread for toggling safemode after some configurable interval.
* Thread that gradually ups compaction limit.
*/
private class CompactionLimitThread extends Thread {
protected CompactionLimitThread() {}
@Override
public void run() {
// First wait until we exit safe mode
synchronized (safeMode) {
while(safeMode.get()) {
LOG.debug("Waiting to exit safe mode");
try {
safeMode.wait();
} catch (InterruptedException e) {
// ignore
}
}
}
// now that safemode is off, slowly increase the per-cycle compaction
// limit, finally setting it to unlimited (-1)
// Slowly increase per-cycle compaction limit, finally setting it to
// unlimited (-1)
int compactionCheckInterval =
conf.getInt("hbase.regionserver.thread.splitcompactcheckfrequency",
20 * 1000);
@ -1145,16 +1130,9 @@ public class HRegionServer implements HConstants, HRegionInterface,
}
}
// Set up the safe mode handler if safe mode has been configured.
if (!conf.getBoolean("hbase.regionserver.safemode", true)) {
safeMode.set(false);
compactSplitThread.setLimit(-1);
LOG.debug("skipping safe mode");
} else {
this.compactionLimitThread = new CompactionLimitThread();
Threads.setDaemonThreadRunning(this.compactionLimitThread, n + ".safeMode",
handler);
}
this.compactionLimitThread = new CompactionLimitThread();
Threads.setDaemonThreadRunning(this.compactionLimitThread, n +
".compactionLimitThread", handler);
// Start Server. This service is like leases in that it internally runs
// a thread.
@ -2108,13 +2086,6 @@ public class HRegionServer implements HConstants, HRegionInterface,
return stopRequested.get();
}
/**
* @return true if the region server is in safe mode
*/
public boolean isInSafeMode() {
return safeMode.get();
}
/**
*
* @return the configuration

View File

@ -132,7 +132,7 @@ class MemStoreFlusher extends Thread implements FlushRequester {
@Override
public void run() {
while (!this.server.isStopRequested() && this.server.isInSafeMode()) {
while (!this.server.isStopRequested()) {
try {
Thread.sleep(threadWakeFrequency);
} catch (InterruptedException ex) {