@InterfaceAudience.Private @InterfaceStability.Evolving class ReplicationSourceWALReader extends Thread
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
private org.apache.hadoop.conf.Configuration |
conf |
private long |
currentPosition |
private BlockingQueue<WALEntryBatch> |
entryBatchQueue |
private boolean |
eofAutoRecovery |
private WALEntryFilter |
filter |
private org.apache.hadoop.fs.FileSystem |
fs |
private boolean |
isReaderRunning |
private static org.slf4j.Logger |
LOG |
private PriorityBlockingQueue<org.apache.hadoop.fs.Path> |
logQueue |
private int |
maxRetriesMultiplier |
private int |
replicationBatchCountCapacity |
private long |
replicationBatchSizeCapacity |
private long |
sleepForRetries |
private ReplicationSource |
source |
private long |
totalBufferQuota |
private AtomicLong |
totalBufferUsed |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
ReplicationSourceWALReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.conf.Configuration conf,
PriorityBlockingQueue<org.apache.hadoop.fs.Path> logQueue,
long startPosition,
WALEntryFilter filter,
ReplicationSource source)
Creates a reader worker for a given WAL queue.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
acquireBufferQuota(long size) |
protected boolean |
addEntryToBatch(WALEntryBatch batch,
WAL.Entry entry) |
private boolean |
checkQuota() |
private Pair<Integer,Integer> |
countDistinctRowKeysAndHFiles(WALEdit edit)
Count the number of different row keys in the given edit because of mini-batching.
|
protected WALEntryBatch |
createBatch(WALEntryStream entryStream) |
protected WAL.Entry |
filterEntry(WAL.Entry entry) |
org.apache.hadoop.fs.Path |
getCurrentPath() |
static long |
getEntrySizeExcludeBulkLoad(WAL.Entry entry) |
private long |
getEntrySizeIncludeBulkLoad(WAL.Entry entry) |
private void |
handleEmptyWALEntryBatch(org.apache.hadoop.fs.Path currentPath) |
private void |
handleEofException(IOException e) |
boolean |
isReaderRunning() |
WALEntryBatch |
poll(long timeout) |
protected WALEntryBatch |
readWALEntries(WALEntryStream entryStream) |
void |
run() |
void |
setReaderRunning(boolean readerRunning) |
private int |
sizeOfStoreFilesIncludeBulkLoad(WALEdit edit)
Calculate the total size of all the store files
|
protected static boolean |
switched(WALEntryStream entryStream,
org.apache.hadoop.fs.Path path) |
WALEntryBatch |
take()
Retrieves the next batch of WAL entries from the queue, waiting up to the specified time for a
batch to become available
|
private void |
updateBatchStats(WALEntryBatch batch,
WAL.Entry entry,
long entrySize) |
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
private final PriorityBlockingQueue<org.apache.hadoop.fs.Path> logQueue
private final org.apache.hadoop.fs.FileSystem fs
private final org.apache.hadoop.conf.Configuration conf
private final WALEntryFilter filter
private final ReplicationSource source
private final BlockingQueue<WALEntryBatch> entryBatchQueue
private final long replicationBatchSizeCapacity
private final int replicationBatchCountCapacity
private long currentPosition
private final long sleepForRetries
private final int maxRetriesMultiplier
private final boolean eofAutoRecovery
private boolean isReaderRunning
private AtomicLong totalBufferUsed
private long totalBufferQuota
public ReplicationSourceWALReader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf, PriorityBlockingQueue<org.apache.hadoop.fs.Path> logQueue, long startPosition, WALEntryFilter filter, ReplicationSource source)
fs
- the files system to useconf
- configuration to uselogQueue
- The WAL queue to read off ofstartPosition
- position in the first WAL to start reading fromfilter
- The filter to use while readingsource
- replication sourceprotected final boolean addEntryToBatch(WALEntryBatch batch, WAL.Entry entry)
protected static final boolean switched(WALEntryStream entryStream, org.apache.hadoop.fs.Path path)
protected WALEntryBatch readWALEntries(WALEntryStream entryStream) throws IOException, InterruptedException
IOException
InterruptedException
private void handleEmptyWALEntryBatch(org.apache.hadoop.fs.Path currentPath) throws InterruptedException
InterruptedException
private void handleEofException(IOException e)
public org.apache.hadoop.fs.Path getCurrentPath()
private boolean checkQuota()
protected final WALEntryBatch createBatch(WALEntryStream entryStream)
protected final WAL.Entry filterEntry(WAL.Entry entry)
public WALEntryBatch take() throws InterruptedException
InterruptedException
- if interrupted while waitingpublic WALEntryBatch poll(long timeout) throws InterruptedException
InterruptedException
private long getEntrySizeIncludeBulkLoad(WAL.Entry entry)
public static long getEntrySizeExcludeBulkLoad(WAL.Entry entry)
private void updateBatchStats(WALEntryBatch batch, WAL.Entry entry, long entrySize)
private Pair<Integer,Integer> countDistinctRowKeysAndHFiles(WALEdit edit)
edit
- edit to count row keys fromprivate int sizeOfStoreFilesIncludeBulkLoad(WALEdit edit)
edit
- edit to count row keys fromprivate boolean acquireBufferQuota(long size)
size
- delta size for grown bufferpublic boolean isReaderRunning()
public void setReaderRunning(boolean readerRunning)
readerRunning
- the readerRunning to setCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.