@InterfaceAudience.Private public class ReplicationSourceShipper extends Thread
Modifier and Type | Class and Description |
---|---|
static class |
ReplicationSourceShipper.WorkerState |
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
protected org.apache.hadoop.conf.Configuration |
conf |
protected org.apache.hadoop.fs.Path |
currentPath |
protected ReplicationSourceWALReader |
entryReader |
protected long |
lastLoggedPosition |
private static org.slf4j.Logger |
LOG |
protected int |
maxRetriesMultiplier |
protected PriorityBlockingQueue<org.apache.hadoop.fs.Path> |
queue |
protected long |
sleepForRetries |
protected ReplicationSourceInterface |
source |
private ReplicationSourceShipper.WorkerState |
state |
protected String |
walGroupId |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
ReplicationSourceShipper(org.apache.hadoop.conf.Configuration conf,
String walGroupId,
PriorityBlockingQueue<org.apache.hadoop.fs.Path> queue,
ReplicationSourceInterface source) |
Modifier and Type | Method and Description |
---|---|
private void |
cleanUpHFileRefs(WALEdit edit) |
org.apache.hadoop.fs.Path |
getCurrentPath() |
long |
getCurrentPosition() |
PriorityBlockingQueue<org.apache.hadoop.fs.Path> |
getLogQueue() |
long |
getStartPosition() |
ReplicationSourceShipper.WorkerState |
getWorkerState() |
protected boolean |
isActive() |
boolean |
isFinished() |
void |
run() |
void |
setWALReader(ReplicationSourceWALReader entryReader) |
void |
setWorkerState(ReplicationSourceShipper.WorkerState state) |
protected void |
shipEdits(ReplicationSourceWALReader.WALEntryBatch entryBatch)
Do the shipping logic
|
boolean |
sleepForRetries(String msg,
int sleepMultiplier)
Do the sleeping logic
|
void |
startup(Thread.UncaughtExceptionHandler handler) |
void |
stopWorker() |
protected void |
updateLogPosition(long lastReadPosition) |
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 final org.apache.hadoop.conf.Configuration conf
protected final String walGroupId
protected final PriorityBlockingQueue<org.apache.hadoop.fs.Path> queue
protected final ReplicationSourceInterface source
protected long lastLoggedPosition
protected volatile org.apache.hadoop.fs.Path currentPath
private ReplicationSourceShipper.WorkerState state
protected ReplicationSourceWALReader entryReader
protected final long sleepForRetries
protected final int maxRetriesMultiplier
public ReplicationSourceShipper(org.apache.hadoop.conf.Configuration conf, String walGroupId, PriorityBlockingQueue<org.apache.hadoop.fs.Path> queue, ReplicationSourceInterface source)
protected void shipEdits(ReplicationSourceWALReader.WALEntryBatch entryBatch)
private void cleanUpHFileRefs(WALEdit edit) throws IOException
IOException
protected void updateLogPosition(long lastReadPosition)
public void startup(Thread.UncaughtExceptionHandler handler)
public PriorityBlockingQueue<org.apache.hadoop.fs.Path> getLogQueue()
public org.apache.hadoop.fs.Path getCurrentPath()
public long getCurrentPosition()
public void setWALReader(ReplicationSourceWALReader entryReader)
public long getStartPosition()
protected boolean isActive()
public void setWorkerState(ReplicationSourceShipper.WorkerState state)
public ReplicationSourceShipper.WorkerState getWorkerState()
public void stopWorker()
public boolean isFinished()
public boolean sleepForRetries(String msg, int sleepMultiplier)
msg
- Why we sleepsleepMultiplier
- by how many times the default sleeping time is augmentedsleepMultiplier
is < maxRetriesMultiplier
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.