2 |
2 |
|
3 |
3 |
import java.util.List;
|
4 |
4 |
|
|
5 |
import javax.annotation.Resource;
|
5 |
6 |
import javax.jws.WebParam;
|
6 |
7 |
|
|
8 |
import eu.dnetlib.data.hadoop.HadoopServiceCore;
|
|
9 |
import eu.dnetlib.data.hadoop.config.ClusterName;
|
|
10 |
import eu.dnetlib.data.hadoop.rmi.HadoopServiceException;
|
|
11 |
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException;
|
|
12 |
import org.apache.hadoop.fs.Path;
|
7 |
13 |
import org.springframework.beans.factory.annotation.Required;
|
8 |
14 |
|
9 |
15 |
import eu.dnetlib.actionmanager.actions.XsltInfoPackageAction;
|
... | ... | |
23 |
29 |
|
24 |
30 |
private NotificationHandler notificationHandler;
|
25 |
31 |
|
|
32 |
@Resource
|
|
33 |
private HadoopServiceCore hadoopServiceCore;
|
|
34 |
|
26 |
35 |
@Override
|
27 |
36 |
public String createSet(@WebParam(name = "set") final ActionManagerSet set) throws ActionManagerException {
|
28 |
|
return core.getInformationServiceClient().registerSetProfile(set);
|
|
37 |
try {
|
|
38 |
final String basePath = hadoopServiceCore.getBasePathHDFS();
|
|
39 |
final Path actionSetPath = new Path(basePath + "/" + set.getId());
|
|
40 |
hadoopServiceCore.createHdfsDir(ClusterName.DM, actionSetPath.toString(), true);
|
|
41 |
return core.getInformationServiceClient().registerSetProfile(set);
|
|
42 |
} catch (HadoopServiceException e) {
|
|
43 |
throw new ActionManagerException(e);
|
|
44 |
} catch (ISLookUpException e) {
|
|
45 |
throw new ActionManagerException(e);
|
|
46 |
}
|
29 |
47 |
}
|
30 |
48 |
|
31 |
49 |
@Override
|
32 |
50 |
public boolean deleteSet(@WebParam(name = "set") final String setId) throws ActionManagerException {
|
33 |
|
return core.getInformationServiceClient().deleteSetProfile(setId);
|
|
51 |
try {
|
|
52 |
final String basePath = hadoopServiceCore.getBasePathHDFS();
|
|
53 |
final Path actionSetPath = new Path(basePath + "/" + setId);
|
|
54 |
hadoopServiceCore.deleteFromHdfs(ClusterName.DM, actionSetPath.toString());
|
|
55 |
return core.getInformationServiceClient().deleteSetProfile(setId);
|
|
56 |
} catch (HadoopServiceException e) {
|
|
57 |
throw new ActionManagerException(e);
|
|
58 |
} catch (ISLookUpException e) {
|
|
59 |
throw new ActionManagerException(e);
|
|
60 |
}
|
34 |
61 |
}
|
35 |
62 |
|
36 |
63 |
@Override
|
introduced creation/deletion of ActionSet directory on HDFS