1
|
package eu.dnetlib.msro.workflows.nodes.hadoop;
|
2
|
|
3
|
import eu.dnetlib.enabling.tools.blackboard.BlackboardJob;
|
4
|
import eu.dnetlib.msro.workflows.nodes.BlackboardJobNode;
|
5
|
import eu.dnetlib.msro.workflows.procs.Env;
|
6
|
import eu.dnetlib.msro.workflows.procs.Token;
|
7
|
import eu.dnetlib.rmi.data.hadoop.HadoopBlackboardActions;
|
8
|
import eu.dnetlib.rmi.data.hadoop.HadoopService;
|
9
|
|
10
|
public class CreateHdfsDirectoryJobNode extends BlackboardJobNode {
|
11
|
|
12
|
private String cluster;
|
13
|
|
14
|
private boolean force = false;
|
15
|
|
16
|
private String path;
|
17
|
|
18
|
@Override
|
19
|
protected String obtainServiceId(final Env env) {
|
20
|
return getServiceLocator().getServiceId(HadoopService.class);
|
21
|
}
|
22
|
|
23
|
@Override
|
24
|
protected void prepareJob(final BlackboardJob job, final Token token) throws Exception {
|
25
|
|
26
|
job.setAction(HadoopBlackboardActions.CREATE_HDFS_DIR.toString());
|
27
|
job.getParameters().put("cluster", getCluster());
|
28
|
job.getParameters().put("force", String.valueOf(isForce()));
|
29
|
job.getParameters().put("path", getPath());
|
30
|
}
|
31
|
|
32
|
public String getCluster() {
|
33
|
return cluster;
|
34
|
}
|
35
|
|
36
|
public void setCluster(final String cluster) {
|
37
|
this.cluster = cluster;
|
38
|
}
|
39
|
|
40
|
public boolean isForce() {
|
41
|
return force;
|
42
|
}
|
43
|
|
44
|
public void setForce(boolean force) {
|
45
|
this.force = force;
|
46
|
}
|
47
|
|
48
|
public String getPath() {
|
49
|
return path;
|
50
|
}
|
51
|
|
52
|
public void setPath(final String path) {
|
53
|
this.path = path;
|
54
|
}
|
55
|
}
|