基于 Oozie 触发器文件的协调器。触发器文件不是来自每小时文件夹
Oozie trigger-file based coordinator. trigger file is not from hourly folders
我正在尝试使用依赖文件 - 触发器文件创建协调器。
我的协调员的频率是 5 分钟。超时为 4 分钟。
我的目标是,只有在创建了指定的触发器文件时,协调器才应该执行工作流。如果未创建触发器文件,协调器应等到文件创建并在第 4 分钟结束时超时。一旦工作流被协调器触发,工作流就会删除触发文件。每当源数据更新时触发文件就会出现,因此我们必须再次 运行 工作流程。
触发器文件一天可能会出现多次,所以我将协调器频率设置为 5 分钟。我尝试使用以下代码:
<coordinator-app name="transform_data_if_exists_coord" frequency="${freqMin}" start="${startDate}" end="${endDate}" timezone="${timeZone}" xmlns="uri:oozie:coordinator:0.1">
<controls>
<timeout>${timeOutMin}</timeout>
<concurrency>${concurrencyCount}</concurrency>
</controls>
<datasets>
<dataset name="input1" frequency="${coord:minutes(${freqMin})}" initial-instance="${startDate}" timezone="${timeZone}">
<uri-template>maprfs:////idn/home/deploy/inputdata/file</uri-template>
<done-flag>trigger</done-flag>
</dataset>
</datasets>
<action>
<workflow>
<app-path>/idn/home/deploy/triggerEmail/triggerEmail_wf.xml</app-path>
</workflow>
</action>
</coordinator-app>
具有以下属性:
startDate=2016-01-26T18:20Z
endDate=2017-01-17T06:00Z
timeZone=UTC
freqMin=5
timeOutMin=4
concurrencyCount=1
您需要添加一个输入事件和属性 WaitForThisInputData 在行动
<input-events>
<data-in name="check_for_input" dataset="input1">
<instance>${startTime2}</instance>
</data-in>
</input-events>
<action>
<workflow>
<app-path>/idn/home/deploy/triggerEmail/triggerEmail_wf.xml</app-path>
<configuration>
<property><name>WaitForThisInputData</name><value>${coord:dataIn('check_for_input')}</value></property>
</configuration>
</workflow>
</action
>
虽然我的工作流程只有在触发器文件存在时才会启动。
有时双工作流会从同一个父协调器实例开始。
即假设如果协调器在第 25 个协调器实例处启动工作流,则工作流 ID 包含父级作为
0001212-xxxxxxx-oozie-mapr-C@25
但我看到两个工作流由同一个父协调器实例启动,这并不理想。这两项工作都在同一时间戳开始。
我错过了吗属性。我已经将协调器的并发设置为 1。
当触发文件在几个小时后出现时会出现此问题。
我正在尝试使用依赖文件 - 触发器文件创建协调器。 我的协调员的频率是 5 分钟。超时为 4 分钟。
我的目标是,只有在创建了指定的触发器文件时,协调器才应该执行工作流。如果未创建触发器文件,协调器应等到文件创建并在第 4 分钟结束时超时。一旦工作流被协调器触发,工作流就会删除触发文件。每当源数据更新时触发文件就会出现,因此我们必须再次 运行 工作流程。
触发器文件一天可能会出现多次,所以我将协调器频率设置为 5 分钟。我尝试使用以下代码:
<coordinator-app name="transform_data_if_exists_coord" frequency="${freqMin}" start="${startDate}" end="${endDate}" timezone="${timeZone}" xmlns="uri:oozie:coordinator:0.1">
<controls>
<timeout>${timeOutMin}</timeout>
<concurrency>${concurrencyCount}</concurrency>
</controls>
<datasets>
<dataset name="input1" frequency="${coord:minutes(${freqMin})}" initial-instance="${startDate}" timezone="${timeZone}">
<uri-template>maprfs:////idn/home/deploy/inputdata/file</uri-template>
<done-flag>trigger</done-flag>
</dataset>
</datasets>
<action>
<workflow>
<app-path>/idn/home/deploy/triggerEmail/triggerEmail_wf.xml</app-path>
</workflow>
</action>
</coordinator-app>
具有以下属性:
startDate=2016-01-26T18:20Z
endDate=2017-01-17T06:00Z
timeZone=UTC
freqMin=5
timeOutMin=4
concurrencyCount=1
您需要添加一个输入事件和属性 WaitForThisInputData 在行动
<input-events>
<data-in name="check_for_input" dataset="input1">
<instance>${startTime2}</instance>
</data-in>
</input-events>
<action>
<workflow>
<app-path>/idn/home/deploy/triggerEmail/triggerEmail_wf.xml</app-path>
<configuration>
<property><name>WaitForThisInputData</name><value>${coord:dataIn('check_for_input')}</value></property>
</configuration>
</workflow>
</action
>
虽然我的工作流程只有在触发器文件存在时才会启动。 有时双工作流会从同一个父协调器实例开始。 即假设如果协调器在第 25 个协调器实例处启动工作流,则工作流 ID 包含父级作为 0001212-xxxxxxx-oozie-mapr-C@25
但我看到两个工作流由同一个父协调器实例启动,这并不理想。这两项工作都在同一时间戳开始。 我错过了吗属性。我已经将协调器的并发设置为 1。 当触发文件在几个小时后出现时会出现此问题。