1
|
package eu.dnetlib.msro.openaireplus.workflows.nodes.dhp;
|
2
|
|
3
|
import com.googlecode.sarasvati.Arc;
|
4
|
import com.googlecode.sarasvati.NodeToken;
|
5
|
import eu.dnetlib.msro.workflows.nodes.SimpleJobNode;
|
6
|
import org.apache.commons.logging.Log;
|
7
|
import org.apache.commons.logging.LogFactory;
|
8
|
import org.springframework.beans.factory.annotation.Value;
|
9
|
|
10
|
public class PrepareEnvTransformHadoopJobNode extends SimpleJobNode {
|
11
|
|
12
|
private static final Log log = LogFactory.getLog(PrepareEnvTransformHadoopJobNode.class);
|
13
|
|
14
|
private String ruleId;
|
15
|
|
16
|
private String mdstoreInput;
|
17
|
|
18
|
private String mdstoreOutput;
|
19
|
|
20
|
@Value("${dnet.openaire.dhp.transformation.app.path}")
|
21
|
private String oozieWfPath;
|
22
|
|
23
|
@Override
|
24
|
protected String execute(final NodeToken token) throws Exception {
|
25
|
|
26
|
token.getEnv().setAttribute("oozieWfPath", getOozieWfPath());
|
27
|
token.getEnv().setAttribute("timestamp", "" + System.currentTimeMillis());
|
28
|
token.getEnv().setAttribute("workflowId", token.getProcess().getEnv().getAttribute("system:processId"));
|
29
|
token.getEnv().setAttribute("mdstoreInput", getMdstoreInput());
|
30
|
token.getEnv().setAttribute("mdstoreOutput", getMdstoreOutput());
|
31
|
token.getEnv().setAttribute("transformationRule", getRuleId());
|
32
|
return Arc.DEFAULT_ARC;
|
33
|
|
34
|
}
|
35
|
|
36
|
public String getRuleId() {
|
37
|
return ruleId;
|
38
|
}
|
39
|
|
40
|
public void setRuleId(String ruleId) {
|
41
|
this.ruleId = ruleId;
|
42
|
}
|
43
|
|
44
|
public String getMdstoreInput() {
|
45
|
return mdstoreInput;
|
46
|
}
|
47
|
|
48
|
public void setMdstoreInput(String mdstoreInput) {
|
49
|
this.mdstoreInput = mdstoreInput;
|
50
|
}
|
51
|
|
52
|
public String getMdstoreOutput() {
|
53
|
return mdstoreOutput;
|
54
|
}
|
55
|
|
56
|
public void setMdstoreOutput(String mdstoreOutput) {
|
57
|
this.mdstoreOutput = mdstoreOutput;
|
58
|
}
|
59
|
|
60
|
public String getOozieWfPath() {
|
61
|
return oozieWfPath;
|
62
|
}
|
63
|
|
64
|
public void setOozieWfPath(String oozieWfPath) {
|
65
|
this.oozieWfPath = oozieWfPath;
|
66
|
}
|
67
|
}
|