public class ZKUUIDService extends UUIDService
ZKUtils). The
sequence will be reset to 0, once max is reached.UUIDService.ApplicationType| Modifier and Type | Field and Description |
|---|---|
static String |
CONF_PREFIX |
static String |
CONF_SEQUENCE_MAX |
static ThreadLocal<SimpleDateFormat> |
dt |
static String |
LOCKS_NODE |
static long |
RESET_VALUE |
static int |
RETRY_COUNT |
static String |
ZK_SEQUENCE_PATH |
CONF_GENERATOR, MAX_ACTION_ID_LEN, MAX_OOZIE_JOB_ID_LEN, startTimeDEFAULT_LOCK_TIMEOUT, lockTimeout| Constructor and Description |
|---|
ZKUUIDService() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
createSequence()
Gets the unique id.
|
void |
destroy()
Destroy the UUID service.
|
String |
getPromotedLock() |
protected long |
getZKSequence() |
void |
init(Services services)
Initialize the UUID service.
|
appendTimeToSequence, generateChildId, generateId, getChildName, getCounter, getId, getInterface, longPadding, resetStartTimepublic static final String CONF_PREFIX
public static final String CONF_SEQUENCE_MAX
public static final String LOCKS_NODE
public static final String ZK_SEQUENCE_PATH
public static final long RESET_VALUE
public static final int RETRY_COUNT
public static final ThreadLocal<SimpleDateFormat> dt
public ZKUUIDService()
public void init(Services services) throws ServiceException
UUIDServiceinit in interface Serviceinit in class UUIDServiceservices - services instance.ServiceException - thrown if the UUID service could not be initialized.protected String createSequence()
createSequence in class UUIDServiceprotected long getZKSequence() throws Exception
Exceptionpublic void destroy()
UUIDServicedestroy in interface Servicedestroy in class UUIDServicepublic String getPromotedLock()
Copyright © 2018 Apache Software Foundation. All rights reserved.