public class CoordCommandUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
ABSOLUTE |
static int |
CURRENT |
static int |
FUTURE |
static int |
LATEST |
static int |
OFFSET |
static String |
RESOLVED_UNRESOLVED_SEPARATOR |
static int |
UNEXPECTED |
static String |
UNRESOLVED_INSTANCES_TAG |
Constructor and Description |
---|
CoordCommandUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
checkIfBothSameType(String startInst,
String endInst) |
static Date |
computeNextNominalTime(CoordinatorJobBean coordJob,
CoordinatorActionBean coordAction)
Computes the nominal time of the next action.
|
static String |
createEarlyURIs(org.jdom.Element event,
String instances,
StringBuilder unresolvedInstances,
StringBuilder urisWithDoneFlag)
The function create a list of URIs separated by "," using the instances
time stamp and URI-template
|
static int |
getFuncType(String function) |
static int |
getInstanceNumber(String function,
StringBuilder restArg)
parse a function like coord:latest(n)/future() and return the 'n'.
|
static Date |
getNextValidActionTimeForCronFrequency(Date targetDate,
CoordinatorJobBean coordJob)
Get the next action time after a given time
|
static String |
getResolvedList(String missDepList,
StringBuilder resolved,
StringBuilder unresolved)
Get resolved string from missDepList
|
static void |
materializeInputDataEvents(List<org.jdom.Element> events,
SyncCoordAction appInst,
org.apache.hadoop.conf.Configuration conf,
CoordinatorActionBean actionBean,
boolean isInputLogicSpecified) |
static String |
materializeInstance(org.jdom.Element event,
String expr,
SyncCoordAction appInst,
org.apache.hadoop.conf.Configuration conf,
ELEvaluator evalInst)
Materialize one instance like current(-2)
|
static String |
materializeOneInstance(String jobId,
boolean dryrun,
org.jdom.Element eAction,
Date nominalTime,
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(String funcName) |
static String |
parseOneStringArg(String funcName) |
static boolean |
pathExists(String sPath,
org.apache.hadoop.conf.Configuration actionConf) |
static boolean |
pathExists(String sPath,
org.apache.hadoop.conf.Configuration actionConf,
String user) |
static void |
resolveInstanceRange(org.jdom.Element event,
StringBuilder instances,
SyncCoordAction appInst,
org.apache.hadoop.conf.Configuration conf,
ELEvaluator eval)
Resolve <start-instance> <end-insatnce> tag.
|
static void |
resolveInstances(org.jdom.Element event,
StringBuilder instances,
SyncCoordAction actionInst,
org.apache.hadoop.conf.Configuration conf,
ELEvaluator eval)
Resolve list of <instance> </instance> tags.
|
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 String RESOLVED_UNRESOLVED_SEPARATOR
public static final String UNRESOLVED_INSTANCES_TAG
public CoordCommandUtils()
public static int getInstanceNumber(String function, StringBuilder restArg) throws Exception
function
- restArg
- Exception
public static int parseOneArg(String funcName) throws Exception
Exception
public static String parseOneStringArg(String funcName) throws Exception
Exception
public static int getFuncType(String function)
function
- EL function namepublic static void checkIfBothSameType(String startInst, 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, StringBuilder instances, SyncCoordAction actionInst, org.apache.hadoop.conf.Configuration conf, ELEvaluator eval) throws Exception
event
- instances
- actionInst
- conf
- eval:
- ELEvalautorException
public static void resolveInstanceRange(org.jdom.Element event, StringBuilder instances, SyncCoordAction appInst, org.apache.hadoop.conf.Configuration conf, ELEvaluator eval) throws Exception
event
- instances
- appInst
- conf
- eval:
- ELEvalautorException
public static String materializeInstance(org.jdom.Element event, String expr, SyncCoordAction appInst, org.apache.hadoop.conf.Configuration conf, ELEvaluator evalInst) throws Exception
event
- : <data-in>expr
- : instance like current(-1)appInst
- : application specific infoconf
- evalInst
- :ELEvaluatorException
public static String createEarlyURIs(org.jdom.Element event, String instances, StringBuilder unresolvedInstances, StringBuilder urisWithDoneFlag) throws Exception
event
- : <data-in> eventinstances
- : List of time stamp separated by ","unresolvedInstances
- : list of instance with latest functionurisWithDoneFlag
- : list of URIs with the done flag appendedException
public static boolean materializeSLA(org.jdom.Element eAction, CoordinatorActionBean coordAction, org.apache.hadoop.conf.Configuration conf) throws CoordinatorJobException
eAction
- coordAction
- conf
- CoordinatorJobException
public static String materializeOneInstance(String jobId, boolean dryrun, org.jdom.Element eAction, Date nominalTime, Date actualTime, int instanceCount, org.apache.hadoop.conf.Configuration conf, CoordinatorActionBean actionBean) throws Exception
jobId
- coordinator job iddryrun
- true if it is dryruneAction
- frequency unexploded-jobnominalTime
- materialization timeactualTime
- action actual timeinstanceCount
- instance numbersconf
- job configurationactionBean
- CoordinatorActionBean to materializeException
public static void materializeInputDataEvents(List<org.jdom.Element> events, SyncCoordAction appInst, org.apache.hadoop.conf.Configuration conf, CoordinatorActionBean actionBean, boolean isInputLogicSpecified) throws Exception
Exception
public static String getResolvedList(String missDepList, StringBuilder resolved, StringBuilder unresolved)
missDepList
- resolved
- unresolved
- public static Date getNextValidActionTimeForCronFrequency(Date targetDate, CoordinatorJobBean coordJob) throws ParseException
targetDate
- coordJob
- ParseException
public static Date computeNextNominalTime(CoordinatorJobBean coordJob, CoordinatorActionBean coordAction) throws ParseException, org.jdom.JDOMException
coordJob
- The Coordinator JobcoordAction
- The Coordinator ActionParseException
org.jdom.JDOMException
public static boolean pathExists(String sPath, org.apache.hadoop.conf.Configuration actionConf, String user) throws IOException, URISyntaxException, URIHandlerException
public static boolean pathExists(String sPath, org.apache.hadoop.conf.Configuration actionConf) throws IOException, URISyntaxException, URIHandlerException
Copyright © 2016 Apache Software Foundation. All rights reserved.