Project

General

Profile

1
<workflow-app xmlns="uri:oozie:workflow:0.2" name="test-union_input_2">
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{metadata_orig,
24
				eu.dnetlib.iis.importer.schemas.DocumentMetadata,
25
				eu/dnetlib/iis/collapsers/union/data/metadata_orig.json}</arg>
26
            <arg>-C{metadata_cermine,
27
				eu.dnetlib.iis.importer.schemas.DocumentMetadata,
28
				eu/dnetlib/iis/collapsers/union/data/metadata_cermine.json}</arg>
29
			<!-- All input and output ports have to be bound to paths in HDFS -->
30
            <arg>-Ometadata_orig=${workingDir}/producer/metadata_orig</arg>
31
            <arg>-Ometadata_cermine=${workingDir}/producer/metadata_cermine</arg>
32
        </java>
33
        <ok to="union"/>
34
        <error to="fail"/>
35
    </action>
36
    <action name="union">
37
        <sub-workflow>
38
            <app-path>${wf:appPath()}/union</app-path>
39
            <configuration>
40
                <property>
41
                    <name>jobTracker</name>
42
                    <value>${jobTracker}</value>
43
                </property>
44
                <property>
45
                    <name>nameNode</name>
46
                    <value>${nameNode}</value>
47
                </property>
48
                <property>
49
                    <name>queueName</name>
50
                    <value>${queueName}</value>
51
                </property>
52
                <!-- Working directory of the subworkflow -->
53
                <property>
54
                    <name>workingDir</name>
55
                    <value>${workingDir}/union/working_dir</value>
56
                </property>
57
                <property>
58
                    <name>schema_input</name>
59
                    <value>eu.dnetlib.iis.importer.schemas.DocumentMetadata</value>
60
                </property>
61
                <property>
62
                    <name>schema_output</name>
63
                    <value>eu.dnetlib.iis.collapsers.schemas.DocumentMetadataEnvelope</value>
64
                </property>
65
                <property>
66
                    <name>origin_1</name>
67
                    <value>orig</value>
68
                </property>
69
                <property>
70
                    <name>origin_2</name>
71
                    <value>cermine</value>
72
                </property>
73
                <!-- Input ports. -->
74
                <property>
75
                    <name>input_1</name>
76
                    <value>${workingDir}/producer/metadata_orig</value>
77
                </property>
78
                <property>
79
                    <name>input_2</name>
80
                    <value>${workingDir}/producer/metadata_cermine</value>
81
                </property>
82
                <!-- Output port bound to given path -->
83
                <property>
84
                    <name>output</name>
85
                    <value>${workingDir}/collapser_union/output</value>
86
                </property>
87
            </configuration>
88
        </sub-workflow>
89
        <ok to="consumer"/>
90
        <error to="fail"/>
91
    </action>
92
    <action name="consumer">
93
		<java>
94
			<job-tracker>${jobTracker}</job-tracker>
95
			<name-node>${nameNode}</name-node>
96
			<configuration>
97
				<property>
98
					<name>mapred.job.queue.name</name>
99
					<value>${queueName}</value>
100
				</property>
101
			</configuration>
102
			<!-- This is simple wrapper for the Java code -->
103
			<main-class>eu.dnetlib.iis.core.java.ProcessWrapper</main-class>
104
			<!-- The business Java code that gets to be executed -->
105
			<arg>eu.dnetlib.iis.core.java.jsonworkflownodes.TestingConsumer</arg>
106
			<!-- Specification of the input ports -->
107
			<arg>-C{output,
108
				eu.dnetlib.iis.collapsers.schemas.DocumentMetadataEnvelope,
109
				eu/dnetlib/iis/collapsers/union/data/metadata_output_2.json}</arg>
110
    		<!-- All input and output ports have to be bound to paths in HDFS -->
111
			<arg>-Ioutput=${workingDir}/collapser_union/output</arg>
112
		</java>
113
		<ok to="end" />
114
		<error to="fail" />
115
	</action>
116
    <kill name="fail">
117
		<message>Unfortunately, the workflow failed -- error message:
118
			[${wf:errorMessage(wf:lastErrorNode())}]</message>
119
    </kill>
120
    <end name="end"/>
121
</workflow-app>
122
<!--property>
123
                    <name>origin_1</name>
124
                    <value>orig</value>
125
                </property>
126
                <property>
127
                    <name>origin_2</name>
128
                    <value>cermine</value>
129
                </property-->
130
                <!-- Input ports. -->
131
                <!--property>
132
                    <name>input_port_1</name>
133
                    <value>${workingDir}/producer/metadata_orig</value>
134
                </property>
135
                <property>
136
                    <name>input_port_2</name>
137
                    <value>${workingDir}/producer/metadata_cermine</value>
138
                </property-->
(2-2/2)