org.apache.oozie.service
Class ZKUUIDService
java.lang.Object
org.apache.oozie.service.UUIDService
org.apache.oozie.service.ZKUUIDService
- All Implemented Interfaces:
- Service
public class ZKUUIDService
- extends UUIDService
Service that provides distributed job id sequence via ZooKeeper. Requires that a ZooKeeper ensemble is available. The
sequence path will be located under a ZNode named "job_id_sequence" under the namespace (see ZKUtils). The
sequence will be reset to 0, once max is reached.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CONF_PREFIX
public static final String CONF_PREFIX
- See Also:
- Constant Field Values
CONF_SEQUENCE_MAX
public static final String CONF_SEQUENCE_MAX
- See Also:
- Constant Field Values
LOCKS_NODE
public static final String LOCKS_NODE
- See Also:
- Constant Field Values
ZK_SEQUENCE_PATH
public static final String ZK_SEQUENCE_PATH
- See Also:
- Constant Field Values
RESET_VALUE
public static final long RESET_VALUE
- See Also:
- Constant Field Values
RETRY_COUNT
public static final int RETRY_COUNT
- See Also:
- Constant Field Values
dt
public static final ThreadLocal<SimpleDateFormat> dt
ZKUUIDService
public ZKUUIDService()
init
public void init(Services services)
throws ServiceException
- Description copied from class:
UUIDService
- Initialize the UUID service.
- Specified by:
init in interface Service- Overrides:
init in class UUIDService
- Parameters:
services - services instance.
- Throws:
ServiceException - thrown if the UUID service could not be initialized.
createSequence
protected String createSequence()
- Gets the unique id.
- Overrides:
createSequence in class UUIDService
- Returns:
- the id
- Throws:
Exception - the exception
getZKSequence
protected long getZKSequence()
throws Exception
- Throws:
Exception
destroy
public void destroy()
- Description copied from class:
UUIDService
- Destroy the UUID service.
- Specified by:
destroy in interface Service- Overrides:
destroy in class UUIDService
getPromotedLock
public String getPromotedLock()
setMaxSequence
public void setMaxSequence(long sequence)
Copyright © 2015 Apache Software Foundation. All Rights Reserved.