Permalink
Browse files

Making the timezone offset a configured job property

  • Loading branch information...
1 parent 2015b85 commit a6ed33b3673fdb4298e8d1fb04545075ebebad84 Jon Natkins committed Sep 14, 2012
Showing with 7 additions and 6 deletions.
  1. +3 −5 oozie-workflows/coord-app.xml
  2. +4 −1 oozie-workflows/job.properties
@@ -19,7 +19,7 @@
<coordinator-app name="add-partition-coord" frequency="${coord:hours(1)}"
start="${jobStart}" end="${jobEnd}"
timezone="UTC"
- xmlns="uri:oozie:coordinator:0.1">
+ xmlns="uri:oozie:coordinator:0.1">
<datasets>
<dataset name="tweets" frequency="${coord:hours(1)}"
initial-instance="${initialDataset}" timezone="America/Los_Angeles">
@@ -29,13 +29,11 @@
</datasets>
<input-events>
<data-in name="input" dataset="tweets">
- <!-- The integer value here should be the offset of your time zone from GMT,
- so for PT, this value is -8 -->
<instance>${coord:current(coord:tzOffset() / 60)}</instance>
</data-in>
<data-in name="readyIndicator" dataset="tweets">
<!-- I've done something here that is a little bit of a hack. Since Flume
- doesn't have a good mechanism for notifying an application when its
+ doesn't have a good mechanism for notifying an application of when it has
rolled to a new directory, we can just use the next directory as an
input event, which instructs Oozie not to kick off a coordinator
action until the next dataset starts being available. -->
@@ -52,7 +50,7 @@
</property>
<property>
<name>dateHour</name>
- <value>${coord:formatTime(coord:dateOffset(coord:nominalTime(), -8, 'HOUR'), 'yyyyMMddHH')}</value>
+ <value>${coord:formatTime(coord:dateOffset(coord:nominalTime(), tzOffset, 'HOUR'), 'yyyyMMddHH')}</value>
</property>
</configuration>
</workflow>
@@ -21,12 +21,15 @@ workflowRoot=${nameNode}/user/${user.name}/oozie-workflows
# jobStart and jobEnd must be in UTC, because Oozie does not yet support
# custom timezones
-jobStart=2012-08-23T17:00Z
+jobStart=2012-09-10T22:00Z
jobEnd=2013-12-12T23:00Z
# This should be set to an hour boundary. In this case, it is set to 8 hours
# before the jobStart, since PST is GMT-8
initialDataset=2012-08-23T09:00Z
+# Timezone offset between UTC and the server timezone
+tzOffset=-8
+
oozie.use.system.libpath=true
oozie.coord.application.path=${nameNode}/user/${user.name}/oozie-workflows/coord-app.xml

0 comments on commit a6ed33b

Please sign in to comment.