public class ReplicationSource.ReplicationSourceWorkerThread extends Thread
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
ReplicationSourceWorkerThread(String walGroupId,
PriorityBlockingQueue<org.apache.hadoop.fs.Path> queue,
ReplicationQueueInfo replicationQueueInfo,
ReplicationSource source) |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.fs.Path |
getCurrentPath() |
long |
getCurrentPosition() |
protected boolean |
getNextPath()
Poll for the next path
|
protected boolean |
openReader(int sleepMultiplier)
Open a reader on the current path
|
protected boolean |
processEndOfFile()
If the queue isn't empty, switch to the next one Else if this is a recovered queue, it means
we're done! Else we'll just continue to try reading the log file
|
protected boolean |
readAllEntriesToReplicateOrNextFile(boolean currentWALisBeingWrittenTo,
List<WAL.Entry> entries)
Read all the entries from the current log files and retain those that need to be replicated.
|
void |
run() |
void |
setWorkerRunning(boolean workerRunning) |
protected void |
shipEdits(boolean currentWALisBeingWrittenTo,
List<WAL.Entry> entries)
Do the shipping logic
|
void |
startup() |
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
public ReplicationSourceWorkerThread(String walGroupId, PriorityBlockingQueue<org.apache.hadoop.fs.Path> queue, ReplicationQueueInfo replicationQueueInfo, ReplicationSource source)
protected boolean readAllEntriesToReplicateOrNextFile(boolean currentWALisBeingWrittenTo, List<WAL.Entry> entries) throws IOException
currentWALisBeingWrittenTo
- is the current WAL being written toentries
- resulting entries to be replicatedIOException
protected boolean getNextPath()
protected boolean openReader(int sleepMultiplier)
sleepMultiplier
- by how many times the default sleeping time is augmentedprotected void shipEdits(boolean currentWALisBeingWrittenTo, List<WAL.Entry> entries)
currentWALisBeingWrittenTo
- was the current WAL being (seemingly)
written to when this method was calledprotected boolean processEndOfFile()
public void startup()
public org.apache.hadoop.fs.Path getCurrentPath()
public long getCurrentPosition()
public void setWorkerRunning(boolean workerRunning)
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.