Oozie协调员 - 定制EL功能

时间:2017-10-06 09:23:48

标签: hadoop oozie oozie-coordinator

我需要创建一个自定义EL函数并在uri-template中使用它(相当于YEAR,MONTH)。 有可能的?为oozie-site.xml这个协调员区域提供的关键配置是什么?

1 个答案:

答案 0 :(得分:0)

属性oozie.service.ELService.ext.functions.workflow是您必须将扩展EL函数的所有映射都包含在关联的类和方法中的属性。多个映射条目以逗号分隔。

<property>
<name>oozie.service.ELService.ext.functions.workflow</name>
<value>
yourELkey=fully_quallified_class_name#static_method_name
</value>
<description>
EL functions declarations, separated by commas, format is
[PREFIX:]NAME=CLASS#METHOD. This property is a convenience
property to add extensions to the built in executors without
having to include all the built in ones.
</description>
</property>

有关如何打包和部署的更多信息,请参阅this

编辑:由于您对类似于YEAR,MONTH的协调器的EL函数感兴趣,您可以查看下面的属性(在oozie-default.xml中记录,您需要将其添加到oozie-site.xml)因为前者只是文件) - oozie.service.ELService.functions.coord-job-submit-freqoozie.service.ELService.ext.functions.coord-job-submit-freq

<property>
        <name>oozie.service.ELService.functions.coord-job-submit-freq</name>
        <value>
            coord:days=org.apache.oozie.coord.CoordELFunctions#ph1_coord_days,
            coord:months=org.apache.oozie.coord.CoordELFunctions#ph1_coord_months,
            coord:hours=org.apache.oozie.coord.CoordELFunctions#ph1_coord_hours,
            coord:minutes=org.apache.oozie.coord.CoordELFunctions#ph1_coord_minutes,
            coord:endOfDays=org.apache.oozie.coord.CoordELFunctions#ph1_coord_endOfDays,
            coord:endOfMonths=org.apache.oozie.coord.CoordELFunctions#ph1_coord_endOfMonths,
            coord:conf=org.apache.oozie.coord.CoordELFunctions#coord_conf,
            coord:user=org.apache.oozie.coord.CoordELFunctions#coord_user,
            hadoop:conf=org.apache.oozie.action.hadoop.HadoopELFunctions#hadoop_conf
        </value>
        <description>
            EL functions declarations, separated by commas, format is [PREFIX:]NAME=CLASS#METHOD.
        </description>
    </property>

    <property>
        <name>oozie.service.ELService.ext.functions.coord-job-submit-freq</name>
        <value>
        </value>
        <description>
            EL functions declarations, separated by commas, format is [PREFIX:]NAME=CLASS#METHOD.
            This property is a convenience property to add extensions to the built in executors without having to
            include all the built in ones.
        </description>
    </property>