Class RedisDB
java.lang.Object
io.vertigo.stella.plugins.work.redis.RedisDB
- Author:
- pchretien, npiedeloup
-
Constructor Summary
ConstructorsConstructorDescriptionRedisDB(int timeoutSeconds, io.vertigo.commons.codec.CodecManager codecManager, io.vertigo.connectors.redis.RedisConnector redisConnector) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncheckDeadNodes(int maxRetry, Set<String> workTypes) Vérifie les noeuds morts, et si oui remets les workItems dans la pile.void<R> WorkResult<R> pollResult(String callerNodeId, Set<String> workTypes) <R,W> WorkItem <R, W> pollWorkItem(String nodeId, String workType) Polls a workitem from the todo list.<R> voidputResult(String callerNodeId, String nodeId, String workType, String workId, R result, Throwable error) Puts the result for a workitem identified by an id.void<R,W> void putWorkItem(WorkItem<R, W> workItem) Puts a workitem in the todo list.voidreset()
-
Constructor Details
-
RedisDB
public RedisDB(int timeoutSeconds, io.vertigo.commons.codec.CodecManager codecManager, io.vertigo.connectors.redis.RedisConnector redisConnector) Constructor.- Parameters:
codecManager- the codecManagerredisConnector- the redis connector
-
-
Method Details
-
reset
public void reset() -
putStart
- Parameters:
nodeId- Worker node idworkType- Work typeworkId- Work Id
-
putWorkItem
Puts a workitem in the todo list.- Parameters:
workItem- the workItem
-
pollWorkItem
Polls a workitem from the todo list.- Parameters:
workType- the type of workItem- Returns:
- null or a workitem
-
putResult
public <R> void putResult(String callerNodeId, String nodeId, String workType, String workId, R result, Throwable error) Puts the result for a workitem identified by an id.- Parameters:
workId- the id of the workitemresult- the resulterror- if an error occurred
-
pollResult
-
heartBeat
-
checkDeadNodes
public io.vertigo.core.lang.Tuple<Set<String>,Set<String>> checkDeadNodes(int maxRetry, Set<String> workTypes) Vérifie les noeuds morts, et si oui remets les workItems dans la pile. Could be executed concurrently by other Master.- Parameters:
maxRetry- number of retry before cancel work @TODOworkTypes- to checks- Returns:
- List of retried and canceled workId
-