Project

General

Profile

« Previous | Next » 

Revision 60319

updated hadoop-specific aggregation workflows

View differences:

PrepareEnvTransformHadoopJobNode.java
1 1
package eu.dnetlib.msro.openaireplus.workflows.nodes.dhp;
2 2

  
3
import eu.dnetlib.dhp.utils.DHPUtils;
4
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService;
5
import eu.dnetlib.enabling.locators.UniqueServiceLocator;
6
import org.apache.commons.logging.Log;
7
import org.apache.commons.logging.LogFactory;
8

  
9 3
import com.googlecode.sarasvati.Arc;
10 4
import com.googlecode.sarasvati.NodeToken;
11

  
12 5
import eu.dnetlib.msro.workflows.nodes.SimpleJobNode;
13
import org.springframework.beans.factory.annotation.Autowired;
6
import org.apache.commons.logging.Log;
7
import org.apache.commons.logging.LogFactory;
14 8
import org.springframework.beans.factory.annotation.Value;
15 9

  
16 10
public class PrepareEnvTransformHadoopJobNode extends SimpleJobNode {
......
19 13

  
20 14
    private String ruleId;
21 15

  
22
    @Autowired
23
    private UniqueServiceLocator serviceLocator;
24

  
25 16
    private String mdstoreInput;
26 17

  
27 18
    private String mdstoreOutput;
......
32 23
    @Override
33 24
    protected String execute(final NodeToken token) throws Exception {
34 25

  
35
        final String trRule = serviceLocator.getService(ISLookUpService.class).getResourceProfile(getRuleId());
36

  
37 26
        token.getEnv().setAttribute("oozieWfPath", getOozieWfPath());
38 27
        token.getEnv().setAttribute("timestamp", "" + System.currentTimeMillis());
39 28
        token.getEnv().setAttribute("workflowId", token.getProcess().getEnv().getAttribute("system:processId"));
40 29
        token.getEnv().setAttribute("mdstoreInput", getMdstoreInput());
41 30
        token.getEnv().setAttribute("mdstoreOutput", getMdstoreOutput());
42
        token.getEnv().setAttribute("transformationRule", DHPUtils.compressString(trRule));
31
        token.getEnv().setAttribute("transformationRule", getRuleId());
43 32
        return Arc.DEFAULT_ARC;
44 33

  
45 34
    }
......
52 41
        this.ruleId = ruleId;
53 42
    }
54 43

  
55
    public UniqueServiceLocator getServiceLocator() {
56
        return serviceLocator;
57
    }
58

  
59
    public void setServiceLocator(UniqueServiceLocator serviceLocator) {
60
        this.serviceLocator = serviceLocator;
61
    }
62

  
63 44
    public String getMdstoreInput() {
64 45
        return mdstoreInput;
65 46
    }

Also available in: Unified diff