public class CoordCommandUtils extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
ABSOLUTE |
static int |
CURRENT |
static int |
FUTURE |
static int |
LATEST |
static int |
OFFSET |
static java.lang.String |
RESOLVED_UNRESOLVED_SEPARATOR |
static int |
UNEXPECTED |
static java.lang.String |
UNRESOLVED_INST_TAG |
| Constructor and Description |
|---|
CoordCommandUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkIfBothSameType(java.lang.String startInst,
java.lang.String endInst) |
static java.util.Date |
computeNextNominalTime(CoordinatorJobBean coordJob,
CoordinatorActionBean coordAction)
Computes the nominal time of the next action.
|
static java.lang.String |
createEarlyURIs(org.jdom.Element event,
java.lang.String instances,
java.lang.StringBuilder unresolvedInstances,
java.lang.StringBuilder urisWithDoneFlag)
The function create a list of URIs separated by "," using the instances
time stamp and URI-template
|
static int |
getFuncType(java.lang.String function) |
static int |
getInstanceNumber(java.lang.String function,
java.lang.StringBuilder restArg)
parse a function like coord:latest(n)/future() and return the 'n'.
|
static java.util.Date |
getNextValidActionTimeForCronFrequency(java.util.Date targetDate,
CoordinatorJobBean coordJob)
Get the next action time after a given time
|
static java.lang.String |
getResolvedList(java.lang.String missDepList,
java.lang.StringBuilder resolved,
java.lang.StringBuilder unresolved)
Get resolved string from missDepList
|
static java.util.Map<java.lang.String,java.lang.StringBuilder> |
materializeDataEvents(java.util.List<org.jdom.Element> events,
SyncCoordAction appInst,
org.apache.hadoop.conf.Configuration conf)
Materialize all
|
static java.lang.String |
materializeInstance(org.jdom.Element event,
java.lang.String expr,
SyncCoordAction appInst,
org.apache.hadoop.conf.Configuration conf,
ELEvaluator evalInst)
Materialize one instance like current(-2)
|
static java.lang.String |
materializeOneInstance(java.lang.String jobId,
boolean dryrun,
org.jdom.Element eAction,
java.util.Date nominalTime,
java.util.Date actualTime,
int instanceCount,
org.apache.hadoop.conf.Configuration conf,
CoordinatorActionBean actionBean)
Materialize one instance for specific nominal time.
|
static boolean |
materializeSLA(org.jdom.Element eAction,
CoordinatorActionBean coordAction,
org.apache.hadoop.conf.Configuration conf) |
static int |
parseOneArg(java.lang.String funcName) |
static java.lang.String |
parseOneStringArg(java.lang.String funcName) |
static void |
resolveInstanceRange(org.jdom.Element event,
java.lang.StringBuilder instances,
SyncCoordAction appInst,
org.apache.hadoop.conf.Configuration conf,
ELEvaluator eval)
Resolve
|
static void |
resolveInstances(org.jdom.Element event,
java.lang.StringBuilder instances,
SyncCoordAction actionInst,
org.apache.hadoop.conf.Configuration conf,
ELEvaluator eval)
Resolve list of
|
public static int CURRENT
public static int LATEST
public static int FUTURE
public static int OFFSET
public static int ABSOLUTE
public static int UNEXPECTED
public static final java.lang.String RESOLVED_UNRESOLVED_SEPARATOR
public static final java.lang.String UNRESOLVED_INST_TAG
public CoordCommandUtils()
public static int getInstanceNumber(java.lang.String function, java.lang.StringBuilder restArg) throws java.lang.Exception
function - restArg - java.lang.Exceptionpublic static int parseOneArg(java.lang.String funcName) throws java.lang.Exception
java.lang.Exceptionpublic static java.lang.String parseOneStringArg(java.lang.String funcName) throws java.lang.Exception
java.lang.Exceptionpublic static int getFuncType(java.lang.String function)
EL - function namepublic static void checkIfBothSameType(java.lang.String startInst, java.lang.String endInst) throws CommandException
startInst: - EL function nameendInst: - EL function nameCommandException - if both are not the same functionpublic static void resolveInstances(org.jdom.Element event, java.lang.StringBuilder instances, SyncCoordAction actionInst, org.apache.hadoop.conf.Configuration conf, ELEvaluator eval) throws java.lang.Exception
event - instances - actionInst - conf - eval: - ELEvalautorjava.lang.Exceptionpublic static void resolveInstanceRange(org.jdom.Element event, java.lang.StringBuilder instances, SyncCoordAction appInst, org.apache.hadoop.conf.Configuration conf, ELEvaluator eval) throws java.lang.Exception
event - instances - appInst - conf - eval: - ELEvalautorjava.lang.Exceptionpublic static java.lang.String materializeInstance(org.jdom.Element event, java.lang.String expr, SyncCoordAction appInst, org.apache.hadoop.conf.Configuration conf, ELEvaluator evalInst) throws java.lang.Exception
event - : expr - : instance like current(-1)appInst - : application specific infoconf - evalInst - :ELEvaluatorjava.lang.Exceptionpublic static java.lang.String createEarlyURIs(org.jdom.Element event, java.lang.String instances, java.lang.StringBuilder unresolvedInstances, java.lang.StringBuilder urisWithDoneFlag) throws java.lang.Exception
event - : instances - : List of time stamp separated by ","unresolvedInstances - : list of instance with latest functionurisWithDoneFlag - : list of URIs with the done flag appendedjava.lang.Exceptionpublic static boolean materializeSLA(org.jdom.Element eAction, CoordinatorActionBean coordAction, org.apache.hadoop.conf.Configuration conf) throws CoordinatorJobException
eAction - coordAction - conf - CoordinatorJobExceptionpublic static java.lang.String materializeOneInstance(java.lang.String jobId, boolean dryrun, org.jdom.Element eAction, java.util.Date nominalTime, java.util.Date actualTime, int instanceCount, org.apache.hadoop.conf.Configuration conf, CoordinatorActionBean actionBean) throws java.lang.Exception
jobId - coordinator job iddryrun - true if it is dryruneAction - frequency unexploded-jobnominalTime - materialization timeactualTime - action actual timeinstanceCount - instance numbersconf - job configurationactionBean - CoordinatorActionBean to materializejava.lang.Exceptionpublic static java.util.Map<java.lang.String,java.lang.StringBuilder> materializeDataEvents(java.util.List<org.jdom.Element> events, SyncCoordAction appInst, org.apache.hadoop.conf.Configuration conf) throws java.lang.Exception
events - appInst - conf - java.lang.Exceptionpublic static java.lang.String getResolvedList(java.lang.String missDepList, java.lang.StringBuilder resolved, java.lang.StringBuilder unresolved)
missDepList - resolved - unresolved - public static java.util.Date getNextValidActionTimeForCronFrequency(java.util.Date targetDate, CoordinatorJobBean coordJob) throws java.text.ParseException
targetDate - coordJob - java.text.ParseExceptionpublic static java.util.Date computeNextNominalTime(CoordinatorJobBean coordJob, CoordinatorActionBean coordAction) throws java.text.ParseException, org.jdom.JDOMException
coordJob - The Coordinator JobcoordAction - The Coordinator Actionjava.text.ParseExceptionorg.jdom.JDOMExceptionCopyright © 2018 Apache Software Foundation. All Rights Reserved.