Project

General

Profile

1
<workflow-app xmlns="uri:oozie:workflow:0.2" name="test-transformers_metricsprimary">
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{document,
24
				eu.dnetlib.iis.transformers.metadatamerger.schemas.ExtractedDocumentMetadataMergedWithOriginal,
25
				eu/dnetlib/iis/transformers/metricsprimary/sampledataproducer/data/document.json}</arg>
26
            <arg>-C{citation,
27
				eu.dnetlib.iis.citationmatching.schemas.Citation,
28
				eu/dnetlib/iis/transformers/metricsprimary/sampledataproducer/data/citation.json}</arg>
29
            <arg>-C{person,
30
				eu.dnetlib.iis.importer.schemas.Person,
31
				eu/dnetlib/iis/transformers/metricsprimary/sampledataproducer/data/person.json}</arg>
32
			<!-- All input and output ports have to be bound to paths in HDFS, working 
33
				directory has to be specified as well -->
34
            <arg>-SworkingDir=${workingDir}/producer/working_dir</arg>
35
            <arg>-Odocument=${workingDir}/producer/document</arg>
36
            <arg>-Ocitation=${workingDir}/producer/citation</arg>
37
            <arg>-Operson=${workingDir}/producer/person</arg>
38
        </java>
39
        <ok to="transformer_metricsprimary"/>
40
        <error to="fail"/>
41
    </action>
42
    <action name="transformer_metricsprimary">
43
        <sub-workflow>
44
            <app-path>${wf:appPath()}/transformer_metricsprimary</app-path>
45
            <configuration>
46
                <property>
47
                    <name>jobTracker</name>
48
                    <value>${jobTracker}</value>
49
                </property>
50
                <property>
51
                    <name>nameNode</name>
52
                    <value>${nameNode}</value>
53
                </property>
54
                <property>
55
                    <name>queueName</name>
56
                    <value>${queueName}</value>
57
                </property>
58
                <!-- Working directory of the subworkflow -->
59
                <property>
60
                    <name>workingDir</name>
61
                    <value>${workingDir}/transformer_metricsprimary/working_dir</value>
62
                </property>
63
                <!-- Input ports. -->
64
                <property>
65
                    <name>input_document</name>
66
                    <value>${workingDir}/producer/document</value>
67
                </property>
68
                <property>
69
                    <name>input_citation</name>
70
                    <value>${workingDir}/producer/citation</value>
71
                </property>
72
                <property>
73
                    <name>input_person</name>
74
                    <value>${workingDir}/producer/person</value>
75
                </property>
76
                <!-- Output port bound to given path -->
77
                <property>
78
                    <name>output_document_authors_citations</name>
79
                    <value>${workingDir}/transformer_metricsprimary/document_authors_citations</value>
80
                </property>
81
                <property>
82
                    <name>output_person_id</name>
83
                    <value>${workingDir}/transformer_metricsprimary/person_id</value>
84
                </property>
85
            </configuration>
86
        </sub-workflow>
87
        <ok to="consumer"/>
88
        <error to="fail"/>
89
    </action>
90
    <action name="consumer">
91
		<java>
92
			<job-tracker>${jobTracker}</job-tracker>
93
			<name-node>${nameNode}</name-node>
94
			<configuration>
95
				<property>
96
					<name>mapred.job.queue.name</name>
97
					<value>${queueName}</value>
98
				</property>
99
			</configuration>
100
			<!-- This is simple wrapper for the Java code -->
101
			<main-class>eu.dnetlib.iis.core.java.ProcessWrapper</main-class>
102
			<!-- The business Java code that gets to be executed -->
103
			<arg>eu.dnetlib.iis.core.java.jsonworkflownodes.TestingConsumer</arg>
104
			<!-- Specification of the input ports -->
105
			<arg>-C{document_authors_citations,
106
				eu.dnetlib.iis.metrics.primary.schemas.DocumentWithAuthorsAndCitations,
107
				eu/dnetlib/iis/transformers/metricsprimary/sampledataproducer/data/document_authors_citations.json}</arg>
108
            <arg>-C{person_id,
109
				eu.dnetlib.iis.metrics.primary.schemas.PersonId,
110
				eu/dnetlib/iis/transformers/metricsprimary/sampledataproducer/data/person_id.json}</arg>
111
			<!-- All input and output ports have to be bound to paths in HDFS, working 
112
				directory has to be specified as well -->
113
			<arg>-SworkingDir=${workingDir}/consumer/working_dir</arg>
114
			<arg>-Idocument_authors_citations=${workingDir}/transformer_metricsprimary/document_authors_citations</arg>
115
            <arg>-Iperson_id=${workingDir}/transformer_metricsprimary/person_id</arg>
116
		</java>
117
		<ok to="end" />
118
		<error to="fail" />
119
	</action>
120
    <kill name="fail">
121
		<message>Unfortunately, the workflow failed -- error message:
122
			[${wf:errorMessage(wf:lastErrorNode())}]</message>
123
    </kill>
124
    <end name="end"/>
125
</workflow-app>
(2-2/2)