Class ReplicationSourceShipper
java.lang.Object
java.lang.Thread
org.apache.hadoop.hbase.replication.regionserver.ReplicationSourceShipper
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
RecoveredReplicationSourceShipper
This thread reads entries from a queue and ships them. Entries are placed onto the queue by
ReplicationSourceWALReaderThread
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Modifier and TypeFieldDescriptionprivate final org.apache.hadoop.conf.Configuration
private org.apache.hadoop.fs.Path
private long
private final int
(package private) final ReplicationSourceWALReader
private final int
private static final org.slf4j.Logger
private final int
private final int
private final long
private final ReplicationSource
(package private) final String
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorDescriptionReplicationSourceShipper
(org.apache.hadoop.conf.Configuration conf, String walGroupId, ReplicationSource source, ReplicationSourceWALReader walReader) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
cleanUpHFileRefs
(WALEdit edit) (package private) void
Attempts to properly updateReplicationSourceManager.totalBufferUser
, in case there were unprocessed entries batched by the reader to the shipper, but the shipper didn't manage to ship those because the replication source is being terminated.(package private) org.apache.hadoop.fs.Path
(package private) long
protected boolean
isActive()
boolean
private void
protected void
final void
run()
protected final void
private void
shipEdits
(WALEntryBatch entryBatch) Do the shipping logicvoid
startup
(Thread.UncaughtExceptionHandler handler) (package private) void
private boolean
updateLogPosition
(WALEntryBatch batch) Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Field Details
-
LOG
-
conf
-
walGroupId
-
source
-
currentPosition
-
currentPath
-
state
-
entryReader
-
sleepForRetries
-
maxRetriesMultiplier
-
DEFAULT_TIMEOUT
- See Also:
-
getEntriesTimeout
-
shipEditsTimeout
-
-
Constructor Details
-
ReplicationSourceShipper
public ReplicationSourceShipper(org.apache.hadoop.conf.Configuration conf, String walGroupId, ReplicationSource source, ReplicationSourceWALReader walReader)
-
-
Method Details
-
run
-
noMoreData
-
postFinish
-
shipEdits
Do the shipping logic -
cleanUpHFileRefs
- Throws:
IOException
-
updateLogPosition
-
startup
-
getCurrentPath
org.apache.hadoop.fs.Path getCurrentPath() -
getCurrentPosition
long getCurrentPosition() -
isActive
-
setWorkerState
-
stopWorker
void stopWorker() -
isFinished
-
clearWALEntryBatch
void clearWALEntryBatch()Attempts to properly updateReplicationSourceManager.totalBufferUser
, in case there were unprocessed entries batched by the reader to the shipper, but the shipper didn't manage to ship those because the replication source is being terminated. In that case, it iterates through the batched entries and decrease the pending entries size fromReplicationSourceManager.totalBufferUser
NOTES 1) This method should only be called upon replication source termination. It blocks waiting for both shipper and reader threads termination, to make sure no race conditions when updatingReplicationSourceManager.totalBufferUser
. 2) It does not attempt to terminate reader and shipper threads. Those must have been triggered interruption/termination prior to calling this method.
-