Oozie TimeZone handling for Daylight saving (CRON Expressions)

冷暖自知 提交于 2019-12-11 02:09:16

问题


I have a Oozie application that suppose to respect Daylight savings. However my schedules are complex so I can't represent them as Expression Language functions such as ${coord:days(2)}. Therefore I need to use CRON expressions.

One example of schedule is every week on weekdays at 13:30 PM (resulting cron expression for Oozie "30 13 * * 2-6" with no time zone adjustment) America/Los Angeles timezone. I want this schedule to works fine regardless of the DST changes.

If I schedule this workflow on some time between Nov 6th & March 13th time zone adjustment is 8 hours. However it's 7 hours outside this period. So if I schedule it with "30 21 * * 2-6" and set my coordinator application timezone to "America/Los Angeles" would my app running on correct schedule even with day light saving adjustments? or do I need to adjust it so 7 hours? Any solution to this problem really appreciated.

Note-1: Oozie processing time is UTC. Note-2: I have use cases where I need to do it for different time zones. So PST was just an example.

Sample Coordinator App definition below

<?xml version="1.0" encoding="UTF-8"?>
<coordinator-app xmlns="uri:oozie:coordinator:0.4" name="Once" frequency="30 21 * * 2-6" start="2016-05-06T00:06Z" end="2016-05-06T00:10Z" timezone="America/Los_Angeles">
   <controls>
      <concurrency>1</concurrency>
      <execution>FIFO</execution>
      <throttle>1</throttle>
   </controls>
   <action>
      <workflow>
         <app-path>hdfs://localhost:8020/user/hdfs/oozie/deployments/workflow/4/23/workflow.xml</app-path>
         <configuration>
            <property>
               <name>eventId</name>
               <value>06e6-4766-bcd6-6a221ad3aee3</value>
            </property>
         </configuration>
      </workflow>
   </action>
</coordinator-app>

来源:https://stackoverflow.com/questions/37149272/oozie-timezone-handling-for-daylight-saving-cron-expressions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!