2019-04-11 15:39:29 +02:00
|
|
|
<workflow-app name="CollectionWorkflow" xmlns="uri:oozie:workflow:0.5">
|
2019-03-25 15:18:31 +01:00
|
|
|
<parameters>
|
|
|
|
<property>
|
|
|
|
<name>sequenceFilePath</name>
|
|
|
|
<description>the path to store the sequence file of the native metadata collected</description>
|
|
|
|
</property>
|
|
|
|
|
|
|
|
<property>
|
|
|
|
<name>mdStorePath</name>
|
|
|
|
<description>the path of the native mdstore</description>
|
|
|
|
</property>
|
|
|
|
|
|
|
|
<property>
|
|
|
|
<name>apiDescription</name>
|
|
|
|
<description>A json encoding of the API Description class</description>
|
|
|
|
</property>
|
|
|
|
|
|
|
|
<property>
|
|
|
|
<name>dataSourceInfo</name>
|
|
|
|
<description>A json encoding of the Datasource Info</description>
|
|
|
|
</property>
|
|
|
|
<property>
|
2019-04-11 15:39:29 +02:00
|
|
|
<name>identifierPath</name>
|
2019-03-25 15:18:31 +01:00
|
|
|
<description>An xpath to retrieve the metadata idnentifier for the generation of DNet Identifier </description>
|
|
|
|
</property>
|
|
|
|
|
|
|
|
<property>
|
|
|
|
<name>metadataEncoding</name>
|
|
|
|
<description> The type of the metadata XML/JSON</description>
|
|
|
|
</property>
|
|
|
|
|
|
|
|
<property>
|
|
|
|
<name>timestamp</name>
|
|
|
|
<description>The timestamp of the collection date</description>
|
|
|
|
</property>
|
2019-04-11 15:39:29 +02:00
|
|
|
|
|
|
|
<property>
|
|
|
|
<name>workflowId</name>
|
|
|
|
<description>The identifier of the workflow</description>
|
|
|
|
</property>
|
2019-03-25 15:18:31 +01:00
|
|
|
</parameters>
|
|
|
|
|
2019-03-18 10:44:35 +01:00
|
|
|
<start to="DeleteMDStoresNative"/>
|
|
|
|
<kill name="Kill">
|
|
|
|
<message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
|
|
|
|
</kill>
|
|
|
|
<action name="DeleteMDStoresNative">
|
|
|
|
<fs>
|
2019-04-11 15:39:29 +02:00
|
|
|
<mkdir path='${sequenceFilePath}'/>
|
|
|
|
<mkdir path='${mdStorePath}'/>
|
2019-03-25 15:18:31 +01:00
|
|
|
<delete path='${sequenceFilePath}'/>
|
|
|
|
<delete path='${mdStorePath}'/>
|
2019-03-18 10:44:35 +01:00
|
|
|
</fs>
|
|
|
|
<ok to="CollectionWorker"/>
|
|
|
|
<error to="Kill"/>
|
|
|
|
</action>
|
|
|
|
<action name="CollectionWorker">
|
|
|
|
<shell xmlns="uri:oozie:shell-action:0.1">
|
|
|
|
<job-tracker>${jobTracker}</job-tracker>
|
|
|
|
<name-node>${nameNode}</name-node>
|
|
|
|
<exec>lib/dhp-collector-worker-1.0.0.jar</exec>
|
2019-04-11 15:39:29 +02:00
|
|
|
<argument>-p</argument><argument>${sequenceFilePath}</argument>
|
|
|
|
<argument>-a</argument><argument>${apiDescription}</argument>
|
|
|
|
<argument>-n</argument><argument>${nameNode}</argument>
|
|
|
|
<argument>-rh</argument><argument>${rmq_host}</argument>
|
|
|
|
<argument>-ru</argument><argument>${rmq_user}</argument>
|
|
|
|
<argument>-rp</argument><argument>${rmq_pwd}</argument>
|
|
|
|
<argument>-rr</argument><argument>${rmq_report}</argument>
|
|
|
|
<argument>-ro</argument><argument>${rmq_ongoing}</argument>
|
|
|
|
<argument>-u</argument><argument>sandro.labruzzo</argument>
|
|
|
|
<argument>-w</argument><argument>${workflowId}</argument>
|
2019-03-18 10:44:35 +01:00
|
|
|
<capture-output/>
|
|
|
|
</shell>
|
2019-04-11 15:39:29 +02:00
|
|
|
<ok to="GenerateNativeStoreSparkJob"/>
|
2019-03-18 10:44:35 +01:00
|
|
|
<error to="Kill"/>
|
|
|
|
</action>
|
2019-04-11 15:39:29 +02:00
|
|
|
<action name="GenerateNativeStoreSparkJob">
|
2019-03-18 10:44:35 +01:00
|
|
|
<spark xmlns="uri:oozie:spark-action:0.2">
|
|
|
|
<job-tracker>${jobTracker}</job-tracker>
|
|
|
|
<name-node>${nameNode}</name-node>
|
|
|
|
<master>yarn</master>
|
|
|
|
<mode>cluster</mode>
|
2019-04-11 15:39:29 +02:00
|
|
|
<name>GenerateNativeStoreSparkJob</name>
|
2019-03-18 10:44:35 +01:00
|
|
|
<class>eu.dnetlib.dhp.collection.GenerateNativeStoreSparkJob</class>
|
|
|
|
<jar>dhp-aggregations-1.0.0-SNAPSHOT.jar</jar>
|
|
|
|
<spark-opts>--num-executors 50 --conf spark.yarn.jars="hdfs://hadoop-rm1.garr-pa1.d4science.org:8020/user/oozie/share/lib/lib_20180405103059/spark2"</spark-opts>
|
2019-03-25 15:18:31 +01:00
|
|
|
<arg>--encoding</arg> <arg>${metadataEncoding}</arg>
|
|
|
|
<arg>--dateOfCollection</arg> <arg>${timestamp}</arg>
|
|
|
|
<arg>--provenance</arg> <arg> ${dataSourceInfo}</arg>
|
|
|
|
<arg>--xpath</arg><arg>${identifierPath}</arg>
|
|
|
|
<arg>--input</arg><arg>${sequenceFilePath}</arg>
|
|
|
|
<arg>--output</arg><arg>${mdStorePath}</arg>
|
2019-04-11 15:39:29 +02:00
|
|
|
<arg>-rh</arg><arg>${rmq_host}</arg>
|
|
|
|
<arg>-ru</arg><arg>${rmq_user}</arg>
|
|
|
|
<arg>-rp</arg><arg>${rmq_pwd}</arg>
|
|
|
|
<arg>-rr</arg><arg>${rmq_report}</arg>
|
|
|
|
<arg>-ro</arg><arg>${rmq_ongoing}</arg>
|
|
|
|
<arg>-w</arg><arg>${workflowId}</arg>
|
2019-03-18 10:44:35 +01:00
|
|
|
</spark>
|
|
|
|
<ok to="End"/>
|
2019-04-11 15:39:29 +02:00
|
|
|
<error to="DropInvalidStore"/>
|
|
|
|
</action>
|
|
|
|
|
|
|
|
<action name="DropInvalidStore">
|
|
|
|
<fs>
|
|
|
|
<delete path='${mdStorePath}/../'/>
|
|
|
|
</fs>
|
|
|
|
<ok to="Kill"/>
|
2019-03-18 10:44:35 +01:00
|
|
|
<error to="Kill"/>
|
|
|
|
</action>
|
2019-04-11 15:39:29 +02:00
|
|
|
|
2019-03-18 10:44:35 +01:00
|
|
|
<end name="End"/>
|
|
|
|
</workflow-app>
|