@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 threadsModifier 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 |
private long |
checkLowReplicationInterval |
static long |
DEFAULT_WAL_ROLL_WAIT_TIMEOUT |
private static org.slf4j.Logger |
LOG |
private int |
maxRollRetry |
private long |
rollPeriod |
private long |
rollWaitTimeout |
private boolean |
running |
private int |
threadWakeFrequency |
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 |
---|---|
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()
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, yield
private static final org.slf4j.Logger LOG
protected 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_TIMEOUT
protected final ConcurrentMap<WAL,AbstractWALRoller.RollController> wals
private final long rollPeriod
private final int threadWakeFrequency
private final long checkLowReplicationInterval
private final long rollWaitTimeout
private final int maxRollRetry
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()
.InterruptedException
public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.