hadoop - Oozie Workflow EL function timestamp() does not give seconds -
i have following oozie workflow:
<workflow-app name="${workflow_name}" xmlns="uri:oozie:workflow:0.4"> <global> <job-tracker>${jobtracker}</job-tracker> <name-node>${namenode}</name-node> <configuration> <property> <name>mapred.job.queue.name</name> <value>${launcherqueuename}</value> </property> <property> <name>mapred.queue.name</name> <value>${launcherqueuename}</value> </property> </configuration> </global> <start to="email-1" /> <action name="email-1"> <email xmlns="uri:oozie:email-action:0.1"> <to>${toemaillist}</to> <cc>${ccemaillist}</cc> <subject>ts</subject> <body> timestamp: ${timestamp()} </body> </email> <ok to="mail-2" /> <error to="kill-fail" /> </action> ... 4 more actions mail-2, mail-3 , mail-4 <kill name="kill-fail"> <message>${workflow_name} failed, error message[${wf:errormessage(wf:lasterrornode())}] </message> </kill> <end name="end" /> </workflow-app> the emails have timestamp values as
timestamp: 2016-01-27t16:19z accoring el definition, should in format: (yyyy-mm-ddthh:mm:ss.sz
why not getting seconds?
what trying do: trying figure out if these 4 function calls return same value or different values. need not change , if timestamp() doesnt work me, want consider coordinator's nominaltime / actualtime el functions.
if cant seconds in timestamp, there way pause each action allow them execute across time range of more 1 minute?
edit: summarizing answers below samson scharfrichter:
1) why there no seconds in timestamp() ?
previous versions had seconds version 4.2 not.
2) there function can give me seconds well?
afaik no
3) how use same time value in actions of workflow?
pass coord:nominaltime() property coordinator , use multiple times in actions.
4) how make action pause in workflow?
thre no simple way. use java action - jar simple class thread.sleep()
quoting oozie documentation v4.2
4.2.2 basic el functions
string timestamp()
it returns current datetime in iso8601 format, down minutes (yyyy-mm-ddthh:mmz), in oozie's processing timezone, i.e. 1997-07-16t19:20z
that seems pretty consistent get.
you can format coord:nominaltime() down second if wish, in coordinator -- therefore must stuff result <configuration> property forward workflow script.
and afaik coord:actualtime() refers non-deterministic time, in past, when coordinator started think next workflow instance. can't imagine can used for.
by way, don't "what [you] trying do" ; if want generate unique ids actions, have many ways without relying on fact oozie slow , not execute multiple actions in same second.
Comments
Post a Comment