use of org.apache.oozie.util.ELEvaluator in project oozie by apache.
the class CoordELFunctions method getJobTZ.
/**
* @return TimeZone for the application or job.
*/
private static TimeZone getJobTZ() {
ELEvaluator eval = ELEvaluator.getCurrent();
SyncCoordAction coordAction = (SyncCoordAction) eval.getVariable(COORD_ACTION);
if (coordAction == null) {
throw new RuntimeException("Associated Application instance should be defined with key " + COORD_ACTION);
}
return coordAction.getTimeZone();
}
use of org.apache.oozie.util.ELEvaluator in project oozie by apache.
the class CoordELFunctions method ph2_coord_actionId.
/**
* Return Action Id.
*
* @return coordinator action Id
*/
public static String ph2_coord_actionId() throws Exception {
ELEvaluator eval = ELEvaluator.getCurrent();
SyncCoordAction action = ParamChecker.notNull((SyncCoordAction) eval.getVariable(COORD_ACTION), "Coordinator Action");
return action.getActionId();
}
use of org.apache.oozie.util.ELEvaluator in project oozie by apache.
the class CoordELFunctions method ph1_coord_dataOut_echo.
public static String ph1_coord_dataOut_echo(String n) {
ELEvaluator eval = ELEvaluator.getCurrent();
String val = (String) eval.getVariable("oozie.dataname." + n);
if (val == null || val.equals("data-out") == false) {
XLog.getLog(CoordELFunctions.class).error("data_out_name " + n + " is not valid");
throw new RuntimeException("data_out_name " + n + " is not valid");
}
return echoUnResolved("dataOut", "'" + n + "'");
}
use of org.apache.oozie.util.ELEvaluator in project oozie by apache.
the class CoordELFunctions method ph1_coord_days.
/**
* Used in defining the frequency in 'day' unit. <p> domain: <code> val > 0</code> and should be integer.
*
* @param val frequency in number of days.
* @return number of days and also set the frequency timeunit to "day"
*/
public static int ph1_coord_days(int val) {
val = ParamChecker.checkGTZero(val, "n");
ELEvaluator eval = ELEvaluator.getCurrent();
eval.setVariable("timeunit", TimeUnit.DAY);
eval.setVariable("endOfDuration", TimeUnit.NONE);
return val;
}
use of org.apache.oozie.util.ELEvaluator in project oozie by apache.
the class CoordELFunctions method ph1_coord_minutes.
/**
* Used in defining the frequency in 'minute' unit. <p> domain: <code> val > 0</code> and should be integer.
*
* @param val frequency in number of minutes.
* @return number of minutes and also set the frequency timeunit to "minute"
*/
public static int ph1_coord_minutes(int val) {
val = ParamChecker.checkGTZero(val, "n");
ELEvaluator eval = ELEvaluator.getCurrent();
eval.setVariable("timeunit", TimeUnit.MINUTE);
eval.setVariable("endOfDuration", TimeUnit.NONE);
return val;
}
Aggregations