@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.RollController
Independently control the roll of each wal.
|
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
protected T |
abortable |
static long |
DEFAULT_WAL_ROLL_WAIT_TIMEOUT |
protected static String |
WAL_ROLL_PERIOD_KEY |
protected static String |
WAL_ROLL_RETRIES
Configure for the max count of log rolling retry.
|
static String |
WAL_ROLL_WAIT_TIMEOUT
Configure for the timeout of log rolling retry.
|
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 |
|---|---|
void |
addWAL(WAL wal) |
protected void |
afterWALArchive(org.apache.hadoop.fs.Path oldPath,
org.apache.hadoop.fs.Path newPath) |
void |
close() |
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()
Returns true if all WAL roll finished
|
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, yieldprotected static final String WAL_ROLL_PERIOD_KEY
public static final String WAL_ROLL_WAIT_TIMEOUT
public static final long DEFAULT_WAL_ROLL_WAIT_TIMEOUT
protected static final String WAL_ROLL_RETRIES
WAL_ROLL_WAIT_TIMEOUTprotected final ConcurrentMap<WAL,AbstractWALRoller.RollController> wals
public void addWAL(WAL wal)
public void requestRollAll()
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.public boolean walRollFinished()
public void waitUntilWalRollFinished()
throws InterruptedException
requestRollAll().InterruptedExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.