1
|
<workflow-app xmlns="uri:oozie:workflow:0.4" name="mainworkflows_metadataextraction_cached">
|
2
|
|
3
|
<parameters>
|
4
|
<property>
|
5
|
<name>input</name>
|
6
|
<description>input document content directory</description>
|
7
|
</property>
|
8
|
<property>
|
9
|
<name>output_root</name>
|
10
|
<description>metadata extraction output directory</description>
|
11
|
</property>
|
12
|
<property>
|
13
|
<name>excluded_ids</name>
|
14
|
<value>$UNDEFINED$</value>
|
15
|
<description>list of content identifiers excluded from metadataextraction processing</description>
|
16
|
</property>
|
17
|
<property>
|
18
|
<name>max_file_size_mb</name>
|
19
|
<value>$UNDEFINED$</value>
|
20
|
<description>maximum allowed file size in Megabytes</description>
|
21
|
</property>
|
22
|
<property>
|
23
|
<name>content_connection_timeout</name>
|
24
|
<value>60000</value>
|
25
|
<description>streaming content connection timeout</description>
|
26
|
</property>
|
27
|
<property>
|
28
|
<name>content_read_timeout</name>
|
29
|
<value>60000</value>
|
30
|
<description>streaming content read timeout</description>
|
31
|
</property>
|
32
|
<property>
|
33
|
<name>zk_session_timeout</name>
|
34
|
<value>60000</value>
|
35
|
<description>zookeeper session timeout when handling locks</description>
|
36
|
</property>
|
37
|
<property>
|
38
|
<name>default_cache_location</name>
|
39
|
<value>/cache/metadataextraction</value>
|
40
|
<description>default cache location stored in HDFS</description>
|
41
|
</property>
|
42
|
<property>
|
43
|
<name>mapred_max_split_size</name>
|
44
|
<value>50000</value>
|
45
|
<description>maximum input data split size, required by streaming version reading DocumentContentUrl to split input data into more chunks</description>
|
46
|
</property>
|
47
|
<property>
|
48
|
<name>output_name_meta</name>
|
49
|
<value>meta</value>
|
50
|
<description>metadata output subdirectory name</description>
|
51
|
</property>
|
52
|
<property>
|
53
|
<name>output_name_plaintext</name>
|
54
|
<value>plaintext</value>
|
55
|
<description>plaintext output subdirectory name</description>
|
56
|
</property>
|
57
|
</parameters>
|
58
|
|
59
|
<global>
|
60
|
<job-tracker>${jobTracker}</job-tracker>
|
61
|
<name-node>${nameNode}</name-node>
|
62
|
<configuration>
|
63
|
<property>
|
64
|
<name>mapred.job.queue.name</name>
|
65
|
<value>${queueName}</value>
|
66
|
</property>
|
67
|
</configuration>
|
68
|
</global>
|
69
|
|
70
|
<start to="check_input_isempty" />
|
71
|
|
72
|
<action name='check_input_isempty'>
|
73
|
<java>
|
74
|
<main-class>eu.dnetlib.iis.core.java.ProcessWrapper</main-class>
|
75
|
<arg>eu.dnetlib.iis.common.utils.EmptyDatastoreVerifierProcess</arg>
|
76
|
<arg>-Iinput=${input}</arg>
|
77
|
<capture-output />
|
78
|
</java>
|
79
|
<ok to="decision_is_intput_empty" />
|
80
|
<error to="fail" />
|
81
|
</action>
|
82
|
|
83
|
<decision name="decision_is_intput_empty">
|
84
|
<switch>
|
85
|
<!-- skipping metadataextraction merging process -->
|
86
|
<case to="get-existing-cache-id">${wf:actionData('check_input_isempty')['isEmpty'] eq "false"}</case>
|
87
|
<default to="generate-empty-output"/>
|
88
|
</switch>
|
89
|
</decision>
|
90
|
|
91
|
<action name="generate-empty-output">
|
92
|
<java>
|
93
|
<prepare>
|
94
|
<!-- notice: directory have to aligned with skipped action output -->
|
95
|
<delete path="${nameNode}${output_root}" />
|
96
|
<mkdir path="${nameNode}${output_root}" />
|
97
|
</prepare>
|
98
|
<main-class>eu.dnetlib.iis.core.java.ProcessWrapper</main-class>
|
99
|
<arg>eu.dnetlib.iis.core.java.jsonworkflownodes.Producer</arg>
|
100
|
<arg>-C{meta,
|
101
|
eu.dnetlib.iis.metadataextraction.schemas.ExtractedDocumentMetadata,
|
102
|
eu/dnetlib/iis/mainworkflows/data/empty.json}</arg>
|
103
|
<arg>-C{plaintext,
|
104
|
eu.dnetlib.iis.metadataextraction.schemas.DocumentText,
|
105
|
eu/dnetlib/iis/mainworkflows/data/empty.json}</arg>
|
106
|
<arg>-Ometa=${output_root}/${output_name_meta}</arg>
|
107
|
<arg>-Oplaintext=${output_root}/${output_name_plaintext}</arg>
|
108
|
</java>
|
109
|
<ok to="end"/>
|
110
|
<error to="fail"/>
|
111
|
</action>
|
112
|
|
113
|
<action name='get-existing-cache-id'>
|
114
|
<java>
|
115
|
<main-class>eu.dnetlib.iis.core.java.ProcessWrapper</main-class>
|
116
|
<arg>eu.dnetlib.iis.common.cache.CacheMetadataManagingProcess</arg>
|
117
|
<arg>-Pdefault_cache_location=${default_cache_location}</arg>
|
118
|
<arg>-Pmode=read_current_id</arg>
|
119
|
<capture-output />
|
120
|
</java>
|
121
|
<ok to="decision-is-cache-empty" />
|
122
|
<error to="fail" />
|
123
|
</action>
|
124
|
|
125
|
<decision name="decision-is-cache-empty">
|
126
|
<switch>
|
127
|
<case to="metadata_extractor_on_full_input">${wf:actionData('get-existing-cache-id')['cache_id'] eq "$UNDEFINED$"}</case>
|
128
|
<default to="transformer_metadataextraction_skip_extracted"/>
|
129
|
</switch>
|
130
|
</decision>
|
131
|
|
132
|
<!-- end of cache based processing block, cache was provided as an input -->
|
133
|
<action name="transformer_metadataextraction_skip_extracted">
|
134
|
<sub-workflow>
|
135
|
<app-path>${wf:appPath()}/transformers_metadataextraction_skip_extracted</app-path>
|
136
|
<propagate-configuration/>
|
137
|
<configuration>
|
138
|
<property>
|
139
|
<name>workingDir</name>
|
140
|
<value>${workingDir}/transformers_metadataextraction_skip_extracted/working_dir</value>
|
141
|
</property>
|
142
|
<property>
|
143
|
<name>input_document_content</name>
|
144
|
<value>${input}</value>
|
145
|
</property>
|
146
|
<property>
|
147
|
<name>input_document_text</name>
|
148
|
<value>${default_cache_location}/${wf:actionData('get-existing-cache-id')['cache_id']}/plaintext</value>
|
149
|
</property>
|
150
|
<property>
|
151
|
<name>input_document_meta</name>
|
152
|
<value>${default_cache_location}/${wf:actionData('get-existing-cache-id')['cache_id']}/meta</value>
|
153
|
</property>
|
154
|
<property>
|
155
|
<name>output_document_content</name>
|
156
|
<value>${workingDir}/transformers_metadataextraction_skip_extracted/tobeprocessed_content</value>
|
157
|
</property>
|
158
|
<property>
|
159
|
<name>output_document_text</name>
|
160
|
<value>${workingDir}/transformers_metadataextraction_skip_extracted/tobereturned_text</value>
|
161
|
</property>
|
162
|
<property>
|
163
|
<name>output_document_meta</name>
|
164
|
<value>${workingDir}/transformers_metadataextraction_skip_extracted/tobereturned_meta</value>
|
165
|
</property>
|
166
|
|
167
|
</configuration>
|
168
|
</sub-workflow>
|
169
|
<ok to="metadata_extractor_on_filtered_input"/>
|
170
|
<error to="fail" />
|
171
|
</action>
|
172
|
|
173
|
<action name="metadata_extractor_on_filtered_input">
|
174
|
<sub-workflow>
|
175
|
<app-path>${wf:appPath()}/metadata_extractor</app-path>
|
176
|
<propagate-configuration/>
|
177
|
<configuration>
|
178
|
<property>
|
179
|
<name>processing_mode</name>
|
180
|
<value>StreamingMetadataExtractorMapper</value>
|
181
|
</property>
|
182
|
<property>
|
183
|
<name>inputport_classname</name>
|
184
|
<value>eu.dnetlib.iis.importer.auxiliary.schemas.DocumentContentUrl</value>
|
185
|
</property>
|
186
|
<property>
|
187
|
<name>workingDir</name>
|
188
|
<value>${workingDir}/metadata_extractor/working_dir</value>
|
189
|
</property>
|
190
|
<property>
|
191
|
<name>input</name>
|
192
|
<value>${workingDir}/transformers_metadataextraction_skip_extracted/tobeprocessed_content</value>
|
193
|
</property>
|
194
|
<property>
|
195
|
<name>excluded_ids</name>
|
196
|
<value>${excluded_ids}</value>
|
197
|
</property>
|
198
|
<property>
|
199
|
<name>max_file_size_mb</name>
|
200
|
<value>${max_file_size_mb}</value>
|
201
|
</property>
|
202
|
<property>
|
203
|
<name>content_connection_timeout</name>
|
204
|
<value>${content_connection_timeout}</value>
|
205
|
</property>
|
206
|
<property>
|
207
|
<name>content_read_timeout</name>
|
208
|
<value>${content_read_timeout}</value>
|
209
|
</property>
|
210
|
<property>
|
211
|
<name>mapred_max_split_size</name>
|
212
|
<value>${mapred_max_split_size}</value>
|
213
|
</property>
|
214
|
<property>
|
215
|
<name>output_name_meta</name>
|
216
|
<value>${output_name_meta}</value>
|
217
|
</property>
|
218
|
<property>
|
219
|
<name>output_name_plaintext</name>
|
220
|
<value>${output_name_plaintext}</value>
|
221
|
</property>
|
222
|
<property>
|
223
|
<name>output_root</name>
|
224
|
<value>${workingDir}/metadata_extractor/output_root</value>
|
225
|
</property>
|
226
|
</configuration>
|
227
|
</sub-workflow>
|
228
|
<ok to="merge_outputs"/>
|
229
|
<error to="fail" />
|
230
|
</action>
|
231
|
|
232
|
<fork name="merge_outputs">
|
233
|
<path start="transformers_common_union_plaintext_merge_outputs"/>
|
234
|
<path start="transformers_common_union_meta_merge_outputs"/>
|
235
|
</fork>
|
236
|
|
237
|
<action name="transformers_common_union_plaintext_merge_outputs">
|
238
|
<sub-workflow>
|
239
|
<app-path>${wf:appPath()}/transformers_common_union</app-path>
|
240
|
<propagate-configuration/>
|
241
|
<configuration>
|
242
|
<property>
|
243
|
<name>input_a</name>
|
244
|
<value>${workingDir}/transformers_metadataextraction_skip_extracted/tobereturned_text</value>
|
245
|
</property>
|
246
|
<property>
|
247
|
<name>input_b</name>
|
248
|
<value>${workingDir}/metadata_extractor/output_root/plaintext</value>
|
249
|
</property>
|
250
|
<property>
|
251
|
<name>output</name>
|
252
|
<value>${output_root}/plaintext</value>
|
253
|
</property>
|
254
|
<property>
|
255
|
<name>schema</name>
|
256
|
<value>eu.dnetlib.iis.metadataextraction.schemas.DocumentText</value>
|
257
|
</property>
|
258
|
</configuration>
|
259
|
</sub-workflow>
|
260
|
<ok to="merge_joining"/>
|
261
|
<error to="fail" />
|
262
|
</action>
|
263
|
|
264
|
<action name="transformers_common_union_meta_merge_outputs">
|
265
|
<sub-workflow>
|
266
|
<app-path>${wf:appPath()}/transformers_common_union</app-path>
|
267
|
<propagate-configuration/>
|
268
|
<configuration>
|
269
|
<property>
|
270
|
<name>input_a</name>
|
271
|
<value>${workingDir}/transformers_metadataextraction_skip_extracted/tobereturned_meta</value>
|
272
|
</property>
|
273
|
<property>
|
274
|
<name>input_b</name>
|
275
|
<value>${workingDir}/metadata_extractor/output_root/meta</value>
|
276
|
</property>
|
277
|
<property>
|
278
|
<name>output</name>
|
279
|
<value>${output_root}/meta</value>
|
280
|
</property>
|
281
|
<property>
|
282
|
<name>schema</name>
|
283
|
<value>eu.dnetlib.iis.metadataextraction.schemas.ExtractedDocumentMetadata</value>
|
284
|
</property>
|
285
|
</configuration>
|
286
|
</sub-workflow>
|
287
|
<ok to="merge_joining"/>
|
288
|
<error to="fail" />
|
289
|
</action>
|
290
|
|
291
|
<join name="merge_joining" to="check_metadataextraction_output_meta_isempty"/>
|
292
|
|
293
|
<action name='check_metadataextraction_output_meta_isempty'>
|
294
|
<java>
|
295
|
<main-class>eu.dnetlib.iis.core.java.ProcessWrapper</main-class>
|
296
|
<arg>eu.dnetlib.iis.common.utils.EmptyDatastoreVerifierProcess</arg>
|
297
|
<arg>-Iinput=${workingDir}/metadata_extractor/output_root/meta</arg>
|
298
|
<capture-output />
|
299
|
</java>
|
300
|
<ok to="check_metadataextraction_output_plaintext_isempty" />
|
301
|
<error to="fail" />
|
302
|
</action>
|
303
|
|
304
|
<action name='check_metadataextraction_output_plaintext_isempty'>
|
305
|
<java>
|
306
|
<main-class>eu.dnetlib.iis.core.java.ProcessWrapper</main-class>
|
307
|
<arg>eu.dnetlib.iis.common.utils.EmptyDatastoreVerifierProcess</arg>
|
308
|
<arg>-Iinput=${workingDir}/metadata_extractor/output_root/plaintext</arg>
|
309
|
<capture-output />
|
310
|
</java>
|
311
|
<ok to="decision-is-metadataextraction-output-empty" />
|
312
|
<error to="fail" />
|
313
|
</action>
|
314
|
|
315
|
<decision name="decision-is-metadataextraction-output-empty">
|
316
|
<switch>
|
317
|
<!-- skipping metadataextraction merging process -->
|
318
|
<case to="obtain-lock_for_merging">${wf:actionData('check_metadataextraction_output_plaintext_isempty')['isEmpty'] eq "false" or wf:actionData('check_metadataextraction_output_meta_isempty')['isEmpty'] eq "false"}</case>
|
319
|
<default to="end"/>
|
320
|
</switch>
|
321
|
</decision>
|
322
|
|
323
|
<action name="obtain-lock_for_merging">
|
324
|
<java>
|
325
|
<main-class>eu.dnetlib.iis.core.java.ProcessWrapper</main-class>
|
326
|
<arg>eu.dnetlib.iis.common.lock.LockManagingProcess</arg>
|
327
|
<arg>-Pzk_session_timeout=${zk_session_timeout}</arg>
|
328
|
<arg>-Pnode_id=${default_cache_location}</arg>
|
329
|
<arg>-Pmode=obtain</arg>
|
330
|
</java>
|
331
|
<ok to="get-new-cache-id_for_merging"/>
|
332
|
<error to="release-lock-and-fail"/>
|
333
|
</action>
|
334
|
|
335
|
<action name='get-new-cache-id_for_merging'>
|
336
|
<java>
|
337
|
<main-class>eu.dnetlib.iis.core.java.ProcessWrapper</main-class>
|
338
|
<arg>eu.dnetlib.iis.common.cache.CacheMetadataManagingProcess</arg>
|
339
|
<arg>-Pdefault_cache_location=${default_cache_location}</arg>
|
340
|
<arg>-Pmode=generate_new_id</arg>
|
341
|
<capture-output />
|
342
|
</java>
|
343
|
<ok to="prepare_cache_for_merging" />
|
344
|
<error to="release-lock-and-fail" />
|
345
|
</action>
|
346
|
|
347
|
<action name="prepare_cache_for_merging">
|
348
|
<fs>
|
349
|
<mkdir path="${nameNode}${default_cache_location}/${wf:actionData('get-new-cache-id_for_merging')['cache_id']}" />
|
350
|
</fs>
|
351
|
<ok to="merge_cache"/>
|
352
|
<error to="release-lock-and-fail"/>
|
353
|
</action>
|
354
|
|
355
|
<fork name="merge_cache">
|
356
|
<path start="transformers_common_union_plaintext_merge_cache"/>
|
357
|
<path start="transformers_common_union_meta_merge_cache"/>
|
358
|
</fork>
|
359
|
|
360
|
<action name="transformers_common_union_plaintext_merge_cache">
|
361
|
<sub-workflow>
|
362
|
<app-path>${wf:appPath()}/transformers_common_union</app-path>
|
363
|
<propagate-configuration/>
|
364
|
<configuration>
|
365
|
<property>
|
366
|
<name>input_a</name>
|
367
|
<value>${default_cache_location}/${wf:actionData('get-existing-cache-id')['cache_id']}/plaintext</value>
|
368
|
</property>
|
369
|
<property>
|
370
|
<name>input_b</name>
|
371
|
<value>${workingDir}/metadata_extractor/output_root/plaintext</value>
|
372
|
</property>
|
373
|
<property>
|
374
|
<name>output</name>
|
375
|
<value>${default_cache_location}/${wf:actionData('get-new-cache-id_for_merging')['cache_id']}/plaintext</value>
|
376
|
</property>
|
377
|
<property>
|
378
|
<name>schema</name>
|
379
|
<value>eu.dnetlib.iis.metadataextraction.schemas.DocumentText</value>
|
380
|
</property>
|
381
|
</configuration>
|
382
|
</sub-workflow>
|
383
|
<ok to="joining-merge_cache"/>
|
384
|
<error to="fail-merge_cache-temp_files_cleanup" />
|
385
|
</action>
|
386
|
|
387
|
<action name="transformers_common_union_meta_merge_cache">
|
388
|
<sub-workflow>
|
389
|
<app-path>${wf:appPath()}/transformers_common_union</app-path>
|
390
|
<propagate-configuration/>
|
391
|
<configuration>
|
392
|
<property>
|
393
|
<name>input_a</name>
|
394
|
<value>${default_cache_location}/${wf:actionData('get-existing-cache-id')['cache_id']}/meta</value>
|
395
|
</property>
|
396
|
<property>
|
397
|
<name>input_b</name>
|
398
|
<value>${workingDir}/metadata_extractor/output_root/meta</value>
|
399
|
</property>
|
400
|
<property>
|
401
|
<name>output</name>
|
402
|
<value>${default_cache_location}/${wf:actionData('get-new-cache-id_for_merging')['cache_id']}/meta</value>
|
403
|
</property>
|
404
|
<property>
|
405
|
<name>schema</name>
|
406
|
<value>eu.dnetlib.iis.metadataextraction.schemas.ExtractedDocumentMetadata</value>
|
407
|
</property>
|
408
|
</configuration>
|
409
|
</sub-workflow>
|
410
|
<ok to="joining-merge_cache"/>
|
411
|
<error to="fail-merge_cache-temp_files_cleanup" />
|
412
|
</action>
|
413
|
|
414
|
<action name="fail-merge_cache-temp_files_cleanup">
|
415
|
<fs>
|
416
|
<delete path="${nameNode}${default_cache_location}/${wf:actionData('get-new-cache-id_for_merging')['cache_id']}" />
|
417
|
</fs>
|
418
|
<ok to="release-lock-and-fail"/>
|
419
|
<error to="release-lock-and-fail"/>
|
420
|
</action>
|
421
|
|
422
|
<join name="joining-merge_cache" to="write-new-cache-id_for_merging"/>
|
423
|
|
424
|
<action name='write-new-cache-id_for_merging'>
|
425
|
<java>
|
426
|
<main-class>eu.dnetlib.iis.core.java.ProcessWrapper</main-class>
|
427
|
<arg>eu.dnetlib.iis.common.cache.CacheMetadataManagingProcess</arg>
|
428
|
<arg>-Pdefault_cache_location=${default_cache_location}</arg>
|
429
|
<arg>-Pmode=write_id</arg>
|
430
|
<arg>-Pid=${wf:actionData('get-new-cache-id_for_merging')['cache_id']}</arg>
|
431
|
<capture-output />
|
432
|
</java>
|
433
|
<ok to="release-lock-and-end" />
|
434
|
<error to="fail-merge_cache-temp_files_cleanup" />
|
435
|
</action>
|
436
|
|
437
|
<!-- end of cache based processing block, cache was provided as an input -->
|
438
|
|
439
|
<!-- full input processing block, no cache was provided as an input -->
|
440
|
<action name="metadata_extractor_on_full_input">
|
441
|
<sub-workflow>
|
442
|
<app-path>${wf:appPath()}/metadata_extractor</app-path>
|
443
|
<propagate-configuration/>
|
444
|
<configuration>
|
445
|
<property>
|
446
|
<name>processing_mode</name>
|
447
|
<value>StreamingMetadataExtractorMapper</value>
|
448
|
</property>
|
449
|
<property>
|
450
|
<name>inputport_classname</name>
|
451
|
<value>eu.dnetlib.iis.importer.auxiliary.schemas.DocumentContentUrl</value>
|
452
|
</property>
|
453
|
<property>
|
454
|
<name>workingDir</name>
|
455
|
<value>${workingDir}/metadata_extractor/working_dir</value>
|
456
|
</property>
|
457
|
<property>
|
458
|
<name>input</name>
|
459
|
<value>${input}</value>
|
460
|
</property>
|
461
|
<property>
|
462
|
<name>excluded_ids</name>
|
463
|
<value>${excluded_ids}</value>
|
464
|
</property>
|
465
|
<property>
|
466
|
<name>max_file_size_mb</name>
|
467
|
<value>${max_file_size_mb}</value>
|
468
|
</property>
|
469
|
<property>
|
470
|
<name>content_connection_timeout</name>
|
471
|
<value>${content_connection_timeout}</value>
|
472
|
</property>
|
473
|
<property>
|
474
|
<name>content_read_timeout</name>
|
475
|
<value>${content_read_timeout}</value>
|
476
|
</property>
|
477
|
<property>
|
478
|
<name>mapred_max_split_size</name>
|
479
|
<value>${mapred_max_split_size}</value>
|
480
|
</property>
|
481
|
<property>
|
482
|
<name>output_name_meta</name>
|
483
|
<value>${output_name_meta}</value>
|
484
|
</property>
|
485
|
<property>
|
486
|
<name>output_name_plaintext</name>
|
487
|
<value>${output_name_plaintext}</value>
|
488
|
</property>
|
489
|
<property>
|
490
|
<name>output_root</name>
|
491
|
<value>${output_root}</value>
|
492
|
</property>
|
493
|
</configuration>
|
494
|
</sub-workflow>
|
495
|
<ok to="obtain-lock_for_initializing"/>
|
496
|
<error to="fail" />
|
497
|
</action>
|
498
|
|
499
|
<action name="obtain-lock_for_initializing">
|
500
|
<java>
|
501
|
<main-class>eu.dnetlib.iis.core.java.ProcessWrapper</main-class>
|
502
|
<arg>eu.dnetlib.iis.common.lock.LockManagingProcess</arg>
|
503
|
<arg>-Pzk_session_timeout=${zk_session_timeout}</arg>
|
504
|
<arg>-Pnode_id=${default_cache_location}</arg>
|
505
|
<arg>-Pmode=obtain</arg>
|
506
|
</java>
|
507
|
<ok to="get-new-cache-id_for_initializing"/>
|
508
|
<error to="release-lock-and-fail"/>
|
509
|
</action>
|
510
|
|
511
|
<action name='get-new-cache-id_for_initializing'>
|
512
|
<java>
|
513
|
<main-class>eu.dnetlib.iis.core.java.ProcessWrapper</main-class>
|
514
|
<arg>eu.dnetlib.iis.common.cache.CacheMetadataManagingProcess</arg>
|
515
|
<arg>-Pdefault_cache_location=${default_cache_location}</arg>
|
516
|
<arg>-Pmode=generate_new_id</arg>
|
517
|
<capture-output />
|
518
|
</java>
|
519
|
<ok to="prepare_cache_for_initializing" />
|
520
|
<error to="release-lock-and-fail" />
|
521
|
</action>
|
522
|
|
523
|
<action name="prepare_cache_for_initializing">
|
524
|
<fs>
|
525
|
<mkdir path="${nameNode}${default_cache_location}/${wf:actionData('get-new-cache-id_for_initializing')['cache_id']}" />
|
526
|
</fs>
|
527
|
<ok to="initialize_cache"/>
|
528
|
<error to="release-lock-and-fail"/>
|
529
|
</action>
|
530
|
|
531
|
<fork name="initialize_cache">
|
532
|
<path start="initialize_plaintext_cache"/>
|
533
|
<path start="initialize_meta_cache"/>
|
534
|
</fork>
|
535
|
|
536
|
<action name="initialize_plaintext_cache">
|
537
|
<distcp xmlns="uri:oozie:distcp-action:0.1">
|
538
|
<job-tracker>${jobTracker}</job-tracker>
|
539
|
<name-node>${nameNode}</name-node>
|
540
|
<configuration>
|
541
|
<property>
|
542
|
<name>mapred.job.queue.name</name>
|
543
|
<value>${queueName}</value>
|
544
|
</property>
|
545
|
</configuration>
|
546
|
<arg>${nameNode}${output_root}/plaintext</arg>
|
547
|
<arg>${nameNode}${default_cache_location}/${wf:actionData('get-new-cache-id_for_initializing')['cache_id']}/plaintext</arg>
|
548
|
</distcp>
|
549
|
<ok to="joining-initialize_cache"/>
|
550
|
<error to="fail-initialize_cache-temp_files_cleanup"/>
|
551
|
</action>
|
552
|
|
553
|
<action name="initialize_meta_cache">
|
554
|
<distcp xmlns="uri:oozie:distcp-action:0.1">
|
555
|
<job-tracker>${jobTracker}</job-tracker>
|
556
|
<name-node>${nameNode}</name-node>
|
557
|
<configuration>
|
558
|
<property>
|
559
|
<name>mapred.job.queue.name</name>
|
560
|
<value>${queueName}</value>
|
561
|
</property>
|
562
|
</configuration>
|
563
|
<arg>${nameNode}${output_root}/meta</arg>
|
564
|
<arg>${nameNode}${default_cache_location}/${wf:actionData('get-new-cache-id_for_initializing')['cache_id']}/meta</arg>
|
565
|
</distcp>
|
566
|
<ok to="joining-initialize_cache"/>
|
567
|
<error to="fail-initialize_cache-temp_files_cleanup"/>
|
568
|
</action>
|
569
|
|
570
|
<action name="fail-initialize_cache-temp_files_cleanup">
|
571
|
<fs>
|
572
|
<delete path="${nameNode}${default_cache_location}/${wf:actionData('get-new-cache-id_for_initializing')['cache_id']}" />
|
573
|
</fs>
|
574
|
<ok to="release-lock-and-fail"/>
|
575
|
<error to="release-lock-and-fail"/>
|
576
|
</action>
|
577
|
|
578
|
<join name="joining-initialize_cache" to="write-new-cache-id_for_initializing"/>
|
579
|
|
580
|
<action name='write-new-cache-id_for_initializing'>
|
581
|
<java>
|
582
|
<main-class>eu.dnetlib.iis.core.java.ProcessWrapper</main-class>
|
583
|
<arg>eu.dnetlib.iis.common.cache.CacheMetadataManagingProcess</arg>
|
584
|
<arg>-Pdefault_cache_location=${default_cache_location}</arg>
|
585
|
<arg>-Pmode=write_id</arg>
|
586
|
<arg>-Pid=${wf:actionData('get-new-cache-id_for_initializing')['cache_id']}</arg>
|
587
|
<capture-output />
|
588
|
</java>
|
589
|
<ok to="release-lock-and-end" />
|
590
|
<error to="fail-initialize_cache-temp_files_cleanup" />
|
591
|
</action>
|
592
|
|
593
|
<!-- end of full input processing block, no cache was provided as an input -->
|
594
|
|
595
|
<!-- lock releasing actions -->
|
596
|
<action name="release-lock-and-fail">
|
597
|
<java>
|
598
|
<main-class>eu.dnetlib.iis.core.java.ProcessWrapper</main-class>
|
599
|
<arg>eu.dnetlib.iis.common.lock.LockManagingProcess</arg>
|
600
|
<arg>-Pzk_session_timeout=${zk_session_timeout}</arg>
|
601
|
<arg>-Pnode_id=${default_cache_location}</arg>
|
602
|
<arg>-Pmode=release</arg>
|
603
|
</java>
|
604
|
<ok to="fail"/>
|
605
|
<error to="fail"/>
|
606
|
</action>
|
607
|
|
608
|
<action name="release-lock-and-end">
|
609
|
<java>
|
610
|
<main-class>eu.dnetlib.iis.core.java.ProcessWrapper</main-class>
|
611
|
<arg>eu.dnetlib.iis.common.lock.LockManagingProcess</arg>
|
612
|
<arg>-Pzk_session_timeout=${zk_session_timeout}</arg>
|
613
|
<arg>-Pnode_id=${default_cache_location}</arg>
|
614
|
<arg>-Pmode=release</arg>
|
615
|
</java>
|
616
|
<ok to="end"/>
|
617
|
<error to="fail"/>
|
618
|
</action>
|
619
|
<!-- end of lock releasing actions -->
|
620
|
|
621
|
<kill name="fail">
|
622
|
<message>Unfortunately, the process failed -- error message:
|
623
|
[${wf:errorMessage(wf:lastErrorNode())}]</message>
|
624
|
</kill>
|
625
|
<end name="end" />
|
626
|
</workflow-app>
|