@InterfaceAudience.Private public abstract class AbstractWALRoller<T extends Abortable> extends Thread implements Closeable
scheduleFlush(String, List) is abstract here,
 as sometimes we hold a region without a region server but we still want to roll its WAL.
 
 TODO: change to a pool of threads| Modifier and Type | Class and Description | 
|---|---|
| protected class  | AbstractWALRoller.RollControllerIndependently control the roll of each wal. | 
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description | 
|---|---|
| protected T | abortable | 
| private long | checkLowReplicationInterval | 
| private static org.slf4j.Logger | LOG | 
| private long | rollPeriod | 
| private boolean | running | 
| private int | threadWakeFrequency | 
| protected static String | WAL_ROLL_PERIOD_KEY | 
| protected ConcurrentMap<WAL,AbstractWALRoller.RollController> | wals | 
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Modifier | Constructor and Description | 
|---|---|
| protected  | AbstractWALRoller(String name,
                 org.apache.hadoop.conf.Configuration conf,
                 T abortable) | 
| Modifier and Type | Method and Description | 
|---|---|
| private void | abort(String reason,
     Throwable cause) | 
| void | addWAL(WAL wal) | 
| protected void | afterWALArchive(org.apache.hadoop.fs.Path oldPath,
               org.apache.hadoop.fs.Path newPath) | 
| private void | checkLowReplication(long now)we need to check low replication in period, see HBASE-18132 | 
| void | close() | 
| private boolean | isWaiting() | 
| void | requestRollAll() | 
| void | run() | 
| protected abstract void | scheduleFlush(String encodedRegionName,
             List<byte[]> families) | 
| void | waitUntilWalRollFinished()Wait until all wals have been rolled after calling  requestRollAll(). | 
| boolean | walRollFinished() | 
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprivate static final org.slf4j.Logger LOG
protected static final String WAL_ROLL_PERIOD_KEY
protected final ConcurrentMap<WAL,AbstractWALRoller.RollController> wals
private final long rollPeriod
private final int threadWakeFrequency
private final long checkLowReplicationInterval
private volatile boolean running
protected AbstractWALRoller(String name, org.apache.hadoop.conf.Configuration conf, T abortable)
public void requestRollAll()
private void checkLowReplication(long now)
protected void afterWALArchive(org.apache.hadoop.fs.Path oldPath, org.apache.hadoop.fs.Path newPath)
protected abstract void scheduleFlush(String encodedRegionName, List<byte[]> families)
encodedRegionName - Encoded name of region to flush.families - stores of region to flush.private boolean isWaiting()
public boolean walRollFinished()
public void waitUntilWalRollFinished() throws InterruptedException
requestRollAll().InterruptedExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.