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, 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.
|
void |
setMaxSequence(long sequence) |
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 UUIDServiceException - the exceptionprotected long getZKSequence() throws Exception
Exceptionpublic void destroy()
UUIDServicedestroy in interface Servicedestroy in class UUIDServicepublic String getPromotedLock()
public void setMaxSequence(long sequence)
Copyright © 2015 Apache Software Foundation. All Rights Reserved.