[ 
https://issues.apache.org/jira/browse/OOZIE-1336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13638176#comment-13638176
 ] 

Sergey commented on OOZIE-1336:
-------------------------------

Sorry, I didn't understand the whole power of oozie.

Here is the solution:

{code:xml}
<coordinator-app name="Url-rating-coordinator" frequency="60"
                 start="${urlRatingCoordinatorStart}" end="2113-01-01T00:02Z" 
timezone="${urlRatingCoordinatorTimeZone}"  xmlns="uri:oozie:coordinator:0.3">
    <controls>
        <timeout>2</timeout>
        <concurrency>1</concurrency>
    </controls>

    <datasets>
        <dataset name="urlRatingInputDataset" frequency="${coord:hours(1)}" 
initial-instance="${urlRatingInputDatasetInitialInstance}" 
timezone="${urlRatingInputDatasetTimeZone}">
            
<uri-template>${nameNode}/staging/landing/source/protei/http/${YEAR}/${MONTH}/${DAY}/${HOUR}</uri-template>
            <done-flag></done-flag>
        </dataset>
        <dataset name="urlRatingOutputDataset" frequency="${coord:hours(1)}" 
initial-instance="${urlRatingInputDatasetInitialInstance}" 
timezone="${urlRatingInputDatasetTimeZone}">
            
<uri-template>${nameNode}/masterdata/source/protei/http/archive/${YEAR}/${MONTH}/${DAY}/${HOUR}</uri-template>
            <done-flag></done-flag>
        </dataset>
    </datasets>

    <input-events>
        <data-in name="urlRatingInputEvent" dataset="urlRatingInputDataset">
            <instance>${coord:current(3)}</instance> <!-- We live in GMT+04:00, 
we need to process last full hour. That is why we need to add manually 3 hours. 
-->
        </data-in>
    </input-events>

    <output-events>
        <data-out name="urlRatingOutputEvent" dataset="urlRatingOutputDataset">
            <instance>${coord:current(3)}</instance>
        </data-out>
    </output-events>
{code}

The line:
{code:xml}
<instance>${coord:current(3)}</instance>
{code}

Does solve my problem. There is no problem to count time starting from some 
common baseline. Just adjust hours :)

Thanks, sorry to disturbing you.
                
> Can't force Oozie to work in local time
> ---------------------------------------
>
>                 Key: OOZIE-1336
>                 URL: https://issues.apache.org/jira/browse/OOZIE-1336
>             Project: Oozie
>          Issue Type: Bug
>          Components: coordinator
>    Affects Versions: 3.3.2
>            Reporter: Sergey
>              Labels: GMT, UTC
>
> Our servers do live in Europe/Moscow timezone.
> The problem is that oozie coordinator is always 4 hours before nominal time 
> of datasets.
> Here is the sample of coordinator workflow:
> {code:xml} 
> <coordinator-app name="Url-rating-coordinator" frequency="60"
>                  start="${httpCoordStartTime}" end="2113-01-01T00:02Z" 
> timezone="${httpCoordTimeZone}"  xmlns="uri:oozie:coordinator:0.3">
>     <controls>
>         <timeout>2</timeout>
>         <concurrency>1</concurrency>
>     </controls>
>     <datasets>
>         <dataset name="urlRatingInputDataset" frequency="${coord:hours(1)}" 
> initial-instance="${httpCoordStartTime}" timezone="${httpCoordTimeZone}">
>             
> <uri-template>${nameNode}/staging/landing/source/protei/http/${YEAR}/${MONTH}/${DAY}/${HOUR}</uri-template>
>             <done-flag></done-flag>
>         </dataset>
>         <dataset name="urlRatingOutputDataset" frequency="${coord:hours(1)}" 
> initial-instance="${httpCoordStartTime}" timezone="${httpCoordTimeZone}">
>             
> <uri-template>${nameNode}/masterdata/source/protei/http/archive/${YEAR}/${MONTH}/${DAY}/${HOUR}</uri-template>
>             <done-flag></done-flag>
>         </dataset>
>     </datasets>
> {code} 
> Here are the parameters:
> httpCoordStartTime=2013-04-21T16:02Z
> httpCoordTimeZone=GMT+04:00
> Imagine: Right now is 16-22 in Moscow.
> The input dataset folder is ready to be processed: 
> {code:xml} 
> /staging/landing/source/protei/http/${YEAR}/${MONTH}/${DAY}/16
> {code} 
> I do submit oozie coordinator with mentioned parameters.
> I do expect that Oozie will take input folder 
> {code:xml} 
> /staging/landing/source/protei/http/${YEAR}/${MONTH}/${DAY}/16 
> {code} 
> and process it. But it doesn't do it. It says:
> {code:xml} 
> 2013-04-21 16:22:45,868 INFO 
> org.apache.oozie.command.coord.CoordSubmitXCommand: USER[hdfs] GROUP[-] 
> TOKEN[] APP[Url-rating-coordinator] JOB[0000334-130410234028321-oozie-oozi-C] 
> ACTION[-] ENDED Coordinator Submit jobId=0000334-130410234028321-oozie-oozi-C
> 2013-04-21 16:22:45,972 WARN 
> org.apache.oozie.command.coord.CoordMaterializeTransitionXCommand: USER[hdfs] 
> GROUP[-] TOKEN[] APP[Url-rating-coordinator] 
> JOB[0000334-130410234028321-oozie-oozi-C] ACTION[-] E1100: Command 
> precondition does not hold before execution, 
> [CoordMaterializeTransitionXCommand for 
> jobId=0000334-130410234028321-oozie-oozi-C job's start time is not reached 
> yet - nothing to materialize], Error Code: E1100
> {code} 
> Ok, I try to change params to (roll start time 4 hours back): 
> httpCoordStartTime=2013-04-21T12:02Z
> httpCoordTimeZone=GMT+04:00
> Ooize happily starts to process input folder 
> {code:xml} 
> /staging/landing/source/protei/http/${YEAR}/${MONTH}/${DAY}/12
> {code} 
> The same situation, it always for hours before the time I want it to pocess 
> the data.
> Is it a bug?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to