public class UUIDService extends java.lang.Object implements Service
CONF_GENERATOR specifies the ID generation type, 'random' or 'counter'.
For 'random' uses the JDK UUID.randomUUID() method.
For 'counter' uses a counter postfixed wit the system start up time.| Modifier and Type | Class and Description |
|---|---|
static class |
UUIDService.ApplicationType |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONF_GENERATOR |
static java.lang.String |
CONF_PREFIX |
static int |
MAX_ACTION_ID_LEN |
static int |
MAX_OOZIE_JOB_ID_LEN |
protected java.lang.String |
startTime |
DEFAULT_LOCK_TIMEOUT, lockTimeout| Constructor and Description |
|---|
UUIDService() |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
appendTimeToSequence(long id,
java.lang.String localStartTime) |
protected java.lang.String |
createSequence() |
void |
destroy()
Destroy the UUID service.
|
java.lang.String |
generateChildId(java.lang.String id,
java.lang.String childName)
Create a child ID.
|
java.lang.String |
generateId(UUIDService.ApplicationType type)
Create a unique ID.
|
java.lang.String |
getChildName(java.lang.String childId)
Return the child name from a child ID.
|
protected long |
getCounter() |
java.lang.String |
getId(java.lang.String childId)
Return the ID from a child ID.
|
java.lang.Class<? extends Service> |
getInterface()
Return the public interface for UUID service.
|
void |
init(Services services)
Initialize the UUID service.
|
protected java.lang.String |
longPadding(long number) |
protected void |
resetStartTime()
reset start time
|
public static final java.lang.String CONF_PREFIX
public static final java.lang.String CONF_GENERATOR
public static final int MAX_OOZIE_JOB_ID_LEN
public static final int MAX_ACTION_ID_LEN
protected java.lang.String startTime
public UUIDService()
public void init(Services services) throws ServiceException
init in interface Serviceservices - services instance.ServiceException - thrown if the UUID service could not be initialized.protected void resetStartTime()
public java.lang.Class<? extends Service> getInterface()
getInterface in interface ServiceUUIDService.protected java.lang.String longPadding(long number)
public java.lang.String generateId(UUIDService.ApplicationType type)
type: - Type of Id. Generally 'C' for Coordinator, 'W' for Workflow and 'B' for Bundle.#CONF_SYSTEM_ID configuration property.
Unique ID Example: 0007728-150515180312570-oozie-oozi-Wprotected java.lang.String createSequence()
protected long getCounter()
protected java.lang.String appendTimeToSequence(long id, java.lang.String localStartTime)
public java.lang.String generateChildId(java.lang.String id, java.lang.String childName)
id - unique ID.childName - child name.public java.lang.String getId(java.lang.String childId)
childId - child ID.public java.lang.String getChildName(java.lang.String childId)
childId - child ID.Copyright © 2018 Apache Software Foundation. All Rights Reserved.