Class FSHLog.SyncRunner
java.lang.Object
java.lang.Thread
org.apache.hadoop.hbase.regionserver.wal.FSHLog.SyncRunner
- All Implemented Interfaces:
Runnable
- Enclosing class:
- FSHLog
Thread to runs the hdfs sync call. This call takes a while to complete. This is the longest
pole adding edits to the WAL and this must complete to be sure all edits persisted. We run
multiple threads sync'ng rather than one that just syncs in series so we have better latencies;
otherwise, an edit that arrived just after a sync started, might have to wait almost the length
of two sync invocations before it is marked done.
When the sync completes, it marks all the passed in futures done. On the other end of the sync future is a blocked thread, usually a regionserver Handler. There may be more than one future passed in the case where a few threads arrive at about the same time and all invoke 'sync'. In this case we'll batch up the invocations and run one filesystem sync only for a batch of Handler sync invocations. Do not confuse these Handler SyncFutures with the futures an ExecutorService returns when you call submit. We have no use for these in this model. These SyncFutures are 'artificial', something to hold the Handler until the filesystem sync completes.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
completeExceptionallySyncRequests
(FSHLog.SyncRequest syncRequest, Exception exception) private void
completeSyncRequests
(FSHLog.SyncRequest syncRequest, long syncedSequenceId) (package private) boolean
offer
(FSHLog.SyncRequest syncRequest) void
run()
(package private) void
shutDown()
private FSHLog.SyncRequest
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
-
syncRequests
-
shutDown
-
-
Constructor Details
-
SyncRunner
SyncRunner(String name, int maxHandlersCount)
-
-
Method Details