public class CommitProcessor extends ZooKeeperCriticalThread implements RequestProcessor
Thread.State, Thread.UncaughtExceptionHandler
RequestProcessor.RequestProcessorException
Modifier and Type | Field and Description |
---|---|
protected LinkedBlockingQueue<Request> |
committedRequests
Requests that have been committed.
|
protected AtomicReference<Request> |
nextPending
Request for which we are currently awaiting a commit
|
protected AtomicInteger |
numRequestsProcessing
The number of requests currently being processed
|
protected LinkedBlockingQueue<Request> |
queuedRequests
Requests that we are holding until the commit comes in.
|
protected boolean |
stopped |
protected WorkerService |
workerPool |
static String |
ZOOKEEPER_COMMIT_PROC_NUM_WORKER_THREADS
Default: numCores
|
static String |
ZOOKEEPER_COMMIT_PROC_SHUTDOWN_TIMEOUT
Default worker pool shutdown timeout in ms: 5000 (5s)
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
CommitProcessor(RequestProcessor nextProcessor,
String id,
boolean matchSyncs,
ZooKeeperServerListener listener) |
Modifier and Type | Method and Description |
---|---|
void |
commit(Request request) |
protected boolean |
needCommit(Request request) |
protected void |
processCommitted() |
void |
processRequest(Request request) |
void |
run() |
void |
shutdown() |
void |
start() |
handleException
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, stop, stop, suspend, toString, yield
public static final String ZOOKEEPER_COMMIT_PROC_NUM_WORKER_THREADS
public static final String ZOOKEEPER_COMMIT_PROC_SHUTDOWN_TIMEOUT
protected final LinkedBlockingQueue<Request> queuedRequests
protected final LinkedBlockingQueue<Request> committedRequests
protected final AtomicReference<Request> nextPending
protected AtomicInteger numRequestsProcessing
protected volatile boolean stopped
protected WorkerService workerPool
public CommitProcessor(RequestProcessor nextProcessor, String id, boolean matchSyncs, ZooKeeperServerListener listener)
protected boolean needCommit(Request request)
protected void processCommitted()
public void commit(Request request)
public void processRequest(Request request)
processRequest
in interface RequestProcessor
public void shutdown()
shutdown
in interface RequestProcessor
Copyright © 2008–2019 The Apache Software Foundation. All rights reserved.