public class PingerThread
extends java.lang.Thread
| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
CONSUMER_LOG
Logger for the replication consumer
|
private java.util.Queue<ReplicationConsumer> |
consumers
The list of consumers we want to check
|
private long |
sleepTime
the time interval before this thread pings each replication provider.
|
private boolean |
stop
A flag to stop the pinger
|
| Constructor and Description |
|---|
PingerThread(int sleepSec)
Create a new instance of this thread.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConsumer(ReplicationConsumer consumer)
Add a new consumer to ping
|
void |
removeConsumer(ReplicationConsumer consumer)
Remove a consumer to ping
|
void |
run()
Starts the thread
|
void |
stopPinging()
Stops the ping for all the consumers
|
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, yieldprivate static final org.slf4j.Logger CONSUMER_LOG
private java.util.Queue<ReplicationConsumer> consumers
private boolean stop
private long sleepTime
public PingerThread(int sleepSec)
sleepSec - the number of seconds pinger thread should sleep before pinging the providerspublic void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void addConsumer(ReplicationConsumer consumer)
consumer - The consumer we want to pingpublic void removeConsumer(ReplicationConsumer consumer)
consumer - The consumer we want to removepublic void stopPinging()