Skip to content

Commit

Permalink
Making the timezone offset a configured job property
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Natkins committed Sep 14, 2012
1 parent 2015b85 commit a6ed33b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 3 additions & 5 deletions oozie-workflows/coord-app.xml
Expand Up @@ -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">
Expand All @@ -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. -->
Expand All @@ -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>
Expand Down
5 changes: 4 additions & 1 deletion oozie-workflows/job.properties
Expand Up @@ -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.