public abstract class ReplicaOutputThreadBase extends StoppableThread
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
static Long |
EOF |
protected Exception |
exception
Thread exit exception.
|
protected boolean |
groupAcksEnabled |
static Long |
HEARTBEAT_ACK
One of two txn ID values that results in a heartbeat response when
encountered in the write queue.
|
static Long |
HEARTBEAT_ACK_TIMED
Another txn ID that results in a heartbeat response when encountered in
the write queue, and is used to mark a heartbeat response whose time
spent in the queue is being measured.
|
protected int |
heartbeatMs |
protected Logger |
logger |
protected long |
numGroupedAcks |
protected BlockingQueue<Long> |
outputQueue |
protected Protocol |
protocol |
protected int |
queueSize
The size of the write queue.
|
protected RepImpl |
repImpl |
protected DataChannel |
replicaFeederChannel |
static Long |
SHUTDOWN_ACK |
envImplMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
ReplicaOutputThreadBase(RepImpl repImpl,
BlockingQueue<Long> outputQueue,
Protocol protocol,
DataChannel replicaFeederChannel) |
| Modifier and Type | Method and Description |
|---|---|
Exception |
getException() |
protected Logger |
getLogger() |
long |
getNumGroupedAcks() |
long |
getOutputQueueSize()
For testing only.
|
protected boolean |
groupWriteAcks(long txnId)
Writes out the acks that are currently queued in the output queue
Returns true if it encountered an EOF or a request for a shutdown.
|
protected int |
initiateSoftShutdown()
Threads that use shutdownThread() must define this method.
|
void |
run() |
void |
setOutputHook(TestHook<Object> outputHook) |
abstract void |
writeHeartbeat(Long txnId) |
abstract void |
writeReauthentication() |
cleanup, getSavedShutdownException, getTotalCpuTime, getTotalUserTime, handleUncaughtException, isShutdown, saveShutdownException, shutdownDone, shutdownThreadactiveCount, 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, yieldprotected final int queueSize
protected final int heartbeatMs
protected volatile Exception exception
protected final RepImpl repImpl
protected final BlockingQueue<Long> outputQueue
protected final Protocol protocol
protected final DataChannel replicaFeederChannel
public static final Long EOF
public static final Long HEARTBEAT_ACK
public static final Long HEARTBEAT_ACK_TIMED
public static final Long SHUTDOWN_ACK
protected final boolean groupAcksEnabled
protected volatile long numGroupedAcks
protected final Logger logger
public ReplicaOutputThreadBase(RepImpl repImpl, BlockingQueue<Long> outputQueue, Protocol protocol, DataChannel replicaFeederChannel)
protected Logger getLogger()
getLogger in class StoppableThreadpublic Exception getException()
public long getNumGroupedAcks()
public long getOutputQueueSize()
public abstract void writeReauthentication()
throws IOException
IOExceptionpublic abstract void writeHeartbeat(Long txnId) throws IOException
IOExceptionprotected boolean groupWriteAcks(long txnId)
throws IOException
IOExceptionprotected int initiateSoftShutdown()
StoppableThreadinitiateSoftShutdown in class StoppableThreadCopyright © 2024. All rights reserved.