Package com.reve.balancemanager.lease
Class RedisCaller
java.lang.Object
java.lang.Thread
com.reve.balancemanager.lease.RedisCaller
- All Implemented Interfaces:
Runnable
This thread will call redis balance increase method whenever required. The reason behind calling this from different
thread rather than inside
LeaseDTO.getLease(double, LeaseResponse, boolean) method is to reduce the time
of returning lease to redis and calling publish method on empty lease. These two method can be called any time after
LeaseDTO.getLease(double, LeaseResponse, boolean) method is done.-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrun()Thread run methodvoidsavePendingCall(RedisCallDTO redisCallDTO) Save this redisCall in pending call list to be called whenever possible.voidshutDown()Shut down this thread.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
-
Constructor Details
-
RedisCaller
public RedisCaller()Protected constructor, only to be called fromBalanceManager
-
-
Method Details
-
run
public void run()Thread run method -
savePendingCall
Save this redisCall in pending call list to be called whenever possible.- Parameters:
redisCallDTO- Redis Call to be increased in redis.
-
shutDown
public void shutDown()Shut down this thread.
-