public class WorkerInfoDAORedisImpl extends Object implements WorkerInfoDAO
| Constructor and Description |
|---|
WorkerInfoDAORedisImpl(Config config,
redis.clients.util.Pool<redis.clients.jedis.Jedis> jedisPool)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected WorkerInfo |
createWorker(String workerName,
redis.clients.jedis.Jedis jedis) |
long |
getActiveWorkerCount() |
List<WorkerInfo> |
getActiveWorkers() |
List<WorkerInfo> |
getAllWorkers() |
long |
getPausedWorkerCount() |
List<WorkerInfo> |
getPausedWorkers() |
WorkerInfo |
getWorker(String workerName) |
long |
getWorkerCount() |
Map<String,List<WorkerInfo>> |
getWorkerHostMap() |
protected boolean |
isWorkerInState(String workerName,
WorkerInfo.State requestedState,
redis.clients.jedis.Jedis jedis) |
void |
removeWorker(String workerName)
Removes the metadata about a worker.
|
public WorkerInfoDAORedisImpl(Config config, redis.clients.util.Pool<redis.clients.jedis.Jedis> jedisPool)
config - the Jesque configurationjedisPool - the pool of Jedis connectionspublic long getWorkerCount()
getWorkerCount in interface WorkerInfoDAOpublic long getActiveWorkerCount()
getActiveWorkerCount in interface WorkerInfoDAOpublic long getPausedWorkerCount()
getPausedWorkerCount in interface WorkerInfoDAOpublic List<WorkerInfo> getActiveWorkers()
getActiveWorkers in interface WorkerInfoDAOpublic List<WorkerInfo> getPausedWorkers()
getPausedWorkers in interface WorkerInfoDAOpublic List<WorkerInfo> getAllWorkers()
getAllWorkers in interface WorkerInfoDAOpublic WorkerInfo getWorker(String workerName)
getWorker in interface WorkerInfoDAOworkerName - the name of the workerpublic Map<String,List<WorkerInfo>> getWorkerHostMap()
getWorkerHostMap in interface WorkerInfoDAOprotected WorkerInfo createWorker(String workerName, redis.clients.jedis.Jedis jedis) throws ParseException, IOException
ParseExceptionIOExceptionpublic void removeWorker(String workerName)
removeWorker in interface WorkerInfoDAOworkerName - The worker name to removeprotected boolean isWorkerInState(String workerName, WorkerInfo.State requestedState, redis.clients.jedis.Jedis jedis) throws IOException
IOExceptionCopyright © 2011-2015. All Rights Reserved.