1
|
<workflow-app xmlns="uri:oozie:workflow:0.2" name="test-transformers_documentsclassification_sampledataproducer">
|
2
|
<start to="producer"/>
|
3
|
<action name="producer">
|
4
|
<java>
|
5
|
<job-tracker>${jobTracker}</job-tracker>
|
6
|
<name-node>${nameNode}</name-node>
|
7
|
<!-- The data generated by this node is deleted in this section -->
|
8
|
<prepare>
|
9
|
<delete path="${nameNode}${workingDir}/producer" />
|
10
|
<mkdir path="${nameNode}${workingDir}/producer" />
|
11
|
</prepare>
|
12
|
<configuration>
|
13
|
<property>
|
14
|
<name>mapred.job.queue.name</name>
|
15
|
<value>${queueName}</value>
|
16
|
</property>
|
17
|
</configuration>
|
18
|
<!-- This is simple wrapper for the Java code -->
|
19
|
<main-class>eu.dnetlib.iis.core.java.ProcessWrapper</main-class>
|
20
|
<!-- The business Java code that gets to be executed -->
|
21
|
<arg>eu.dnetlib.iis.core.java.jsonworkflownodes.Producer</arg>
|
22
|
<!-- Specification of the output ports -->
|
23
|
<arg>-C{merged_metadata,
|
24
|
eu.dnetlib.iis.transformers.metadatamerger.schemas.ExtractedDocumentMetadataMergedWithOriginal,
|
25
|
eu/dnetlib/iis/transformers/documentsclassification/sampledataproducer/data/merged_metadata.json}</arg>
|
26
|
<!-- All input and output ports have to be bound to paths in HDFS -->
|
27
|
<arg>-Omerged_metadata=${workingDir}/producer/merged_metadata</arg>
|
28
|
</java>
|
29
|
<ok to="transformer_documentsclassification"/>
|
30
|
<error to="fail"/>
|
31
|
</action>
|
32
|
<action name="transformer_documentsclassification">
|
33
|
<sub-workflow>
|
34
|
<app-path>${wf:appPath()}/transformer_documentsclassification</app-path>
|
35
|
<configuration>
|
36
|
<property>
|
37
|
<name>jobTracker</name>
|
38
|
<value>${jobTracker}</value>
|
39
|
</property>
|
40
|
<property>
|
41
|
<name>nameNode</name>
|
42
|
<value>${nameNode}</value>
|
43
|
</property>
|
44
|
<property>
|
45
|
<name>queueName</name>
|
46
|
<value>${queueName}</value>
|
47
|
</property>
|
48
|
<!-- Working directory of the subworkflow -->
|
49
|
<property>
|
50
|
<name>workingDir</name>
|
51
|
<value>${workingDir}/transformer_documentsclassification/working_dir</value>
|
52
|
</property>
|
53
|
<!-- Input ports. -->
|
54
|
<property>
|
55
|
<name>input_merged_metadata</name>
|
56
|
<value>${workingDir}/producer/merged_metadata</value>
|
57
|
</property>
|
58
|
<!-- Output port bound to given path -->
|
59
|
<property>
|
60
|
<name>output_document_metadata</name>
|
61
|
<value>${workingDir}/transformer_documentsclassification/document_metadata</value>
|
62
|
</property>
|
63
|
</configuration>
|
64
|
</sub-workflow>
|
65
|
<ok to="consumer"/>
|
66
|
<error to="fail"/>
|
67
|
</action>
|
68
|
<action name="consumer">
|
69
|
<java>
|
70
|
<job-tracker>${jobTracker}</job-tracker>
|
71
|
<name-node>${nameNode}</name-node>
|
72
|
<configuration>
|
73
|
<property>
|
74
|
<name>mapred.job.queue.name</name>
|
75
|
<value>${queueName}</value>
|
76
|
</property>
|
77
|
</configuration>
|
78
|
<!-- This is simple wrapper for the Java code -->
|
79
|
<main-class>eu.dnetlib.iis.core.java.ProcessWrapper</main-class>
|
80
|
<!-- The business Java code that gets to be executed -->
|
81
|
<arg>eu.dnetlib.iis.core.java.jsonworkflownodes.TestingConsumer</arg>
|
82
|
<!-- Specification of the input ports -->
|
83
|
<arg>-C{document_metadata,
|
84
|
eu.dnetlib.iis.documentsclassification.schemas.DocumentMetadata,
|
85
|
eu/dnetlib/iis/transformers/documentsclassification/sampledataproducer/data/abstract_metadata.json}</arg>
|
86
|
<!-- All input and output ports have to be bound to paths in HDFS -->
|
87
|
<arg>-Idocument_metadata=${workingDir}/transformer_documentsclassification/document_metadata</arg>
|
88
|
</java>
|
89
|
<ok to="end" />
|
90
|
<error to="fail" />
|
91
|
</action>
|
92
|
<kill name="fail">
|
93
|
<message>Unfortunately, the workflow failed -- error message:
|
94
|
[${wf:errorMessage(wf:lastErrorNode())}]</message>
|
95
|
</kill>
|
96
|
<end name="end"/>
|
97
|
</workflow-app>
|