1 |
57333
|
sandro.lab
|
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 |
60319
|
claudio.at
|
import org.apache.commons.logging.Log;
|
7 |
|
|
import org.apache.commons.logging.LogFactory;
|
8 |
60318
|
claudio.at
|
import org.springframework.beans.factory.annotation.Value;
|
9 |
57333
|
sandro.lab
|
|
10 |
|
|
public class PrepareEnvTransformHadoopJobNode extends SimpleJobNode {
|
11 |
|
|
|
12 |
|
|
private static final Log log = LogFactory.getLog(PrepareEnvTransformHadoopJobNode.class);
|
13 |
|
|
|
14 |
|
|
private String ruleId;
|
15 |
|
|
|
16 |
60316
|
claudio.at
|
private String mdstoreInput;
|
17 |
|
|
|
18 |
|
|
private String mdstoreOutput;
|
19 |
|
|
|
20 |
60318
|
claudio.at
|
@Value("${dnet.openaire.dhp.transformation.app.path}")
|
21 |
|
|
private String oozieWfPath;
|
22 |
|
|
|
23 |
57333
|
sandro.lab
|
@Override
|
24 |
|
|
protected String execute(final NodeToken token) throws Exception {
|
25 |
|
|
|
26 |
60318
|
claudio.at
|
token.getEnv().setAttribute("oozieWfPath", getOozieWfPath());
|
27 |
57333
|
sandro.lab
|
token.getEnv().setAttribute("timestamp", "" + System.currentTimeMillis());
|
28 |
|
|
token.getEnv().setAttribute("workflowId", token.getProcess().getEnv().getAttribute("system:processId"));
|
29 |
60316
|
claudio.at
|
token.getEnv().setAttribute("mdstoreInput", getMdstoreInput());
|
30 |
|
|
token.getEnv().setAttribute("mdstoreOutput", getMdstoreOutput());
|
31 |
60319
|
claudio.at
|
token.getEnv().setAttribute("transformationRule", getRuleId());
|
32 |
57333
|
sandro.lab
|
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 |
60316
|
claudio.at
|
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 |
60318
|
claudio.at
|
|
60 |
|
|
public String getOozieWfPath() {
|
61 |
|
|
return oozieWfPath;
|
62 |
|
|
}
|
63 |
|
|
|
64 |
|
|
public void setOozieWfPath(String oozieWfPath) {
|
65 |
|
|
this.oozieWfPath = oozieWfPath;
|
66 |
|
|
}
|
67 |
57333
|
sandro.lab
|
}
|