Package org.nuxeo.ecm.core.work
Class WorkStateHelper
java.lang.Object
org.nuxeo.ecm.core.work.WorkStateHelper
Work state helper to handle, out-of-API, distributed, work states.
- Since:
- 10.2
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddGroupJoinWork(String group) protected static StringgetGroupKey(String group) protected static KeyValueStoreprotected static longgetLastOffset(String workId) Returns the last offset created for a given work id.protected static StringgetOffsetKey(String workId) protected static Work.Stateprotected static StringgetStateKey(String workId) protected static booleanisCanceled(String workId) protected static booleanremoveGroupJoinWork(String group) protected static voidsetCanceled(String workId) protected static voidsetLastOffset(String workId, Long offset, long ttl) protected static voidsetState(String workId, Work.State state, long ttl)
-
Field Details
-
KV_NAME
- See Also:
-
STATE_SUFFIX
- See Also:
-
OFFSET_SUFFIX
- See Also:
-
GROUP_JOIN_COUNT_SUFFIX
- See Also:
-
GROUP_JOIN_COUNT_TTL_SECONDS
protected static final long GROUP_JOIN_COUNT_TTL_SECONDS- See Also:
-
CANCELED
- See Also:
-
-
Method Details
-
getKeyValueStore
-
getLastOffset
Returns the last offset created for a given work id.- Parameters:
workId- id of the work whose we want the last offset- Returns:
- the last offset or -1 for convenience
- Since:
- 10.3
-
getOffsetKey
-
getState
-
getStateKey
-
getGroupKey
-
isCanceled
-
setCanceled
-
setLastOffset
-
setState
-
addGroupJoinWork
-
removeGroupJoinWork
-