Revision 42201
Added by Claudio Atzori about 8 years ago
modules/dnet-actionmanager-service/trunk/src/main/java/eu/dnetlib/actionmanager/hbase/HBaseActionManagerCore.java | ||
---|---|---|
13 | 13 |
import eu.dnetlib.actionmanager.rmi.ActionManagerException; |
14 | 14 |
import eu.dnetlib.actionmanager.set.ActionManagerSet; |
15 | 15 |
import eu.dnetlib.actionmanager.set.RawSet; |
16 |
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpException; |
|
17 |
import eu.dnetlib.enabling.is.lookup.rmi.ISLookUpService; |
|
16 | 18 |
import eu.dnetlib.miscutils.datetime.DateUtils; |
17 | 19 |
import org.apache.hadoop.hbase.client.Delete; |
18 | 20 |
import org.apache.hadoop.hbase.client.Put; |
... | ... | |
103 | 105 |
hbaseClient.delete(deletes); |
104 | 106 |
} |
105 | 107 |
|
108 |
public String getBasePathHDFS() throws ISLookUpException { |
|
109 |
return informationServiceClient.getBasePathHDFS(); |
|
110 |
} |
|
111 |
|
|
106 | 112 |
public ActionFactory getActionFactory() { |
107 | 113 |
return actionFactory; |
108 | 114 |
} |
modules/dnet-actionmanager-service/trunk/src/main/java/eu/dnetlib/actionmanager/ActionManagerServiceImpl.java | ||
---|---|---|
35 | 35 |
@Override |
36 | 36 |
public String createSet(@WebParam(name = "set") final ActionManagerSet set) throws ActionManagerException { |
37 | 37 |
try { |
38 |
final String basePath = hadoopServiceCore.getBasePathHDFS();
|
|
38 |
final String basePath = core.getBasePathHDFS();
|
|
39 | 39 |
final Path actionSetPath = new Path(basePath + "/" + set.getId()); |
40 | 40 |
hadoopServiceCore.createHdfsDir(ClusterName.DM, actionSetPath.toString(), true); |
41 | 41 |
return core.getInformationServiceClient().registerSetProfile(set); |
... | ... | |
49 | 49 |
@Override |
50 | 50 |
public boolean deleteSet(@WebParam(name = "set") final String setId) throws ActionManagerException { |
51 | 51 |
try { |
52 |
final String basePath = hadoopServiceCore.getBasePathHDFS();
|
|
52 |
final String basePath = core.getBasePathHDFS();
|
|
53 | 53 |
final Path actionSetPath = new Path(basePath + "/" + setId); |
54 | 54 |
hadoopServiceCore.deleteFromHdfs(ClusterName.DM, actionSetPath.toString()); |
55 | 55 |
return core.getInformationServiceClient().deleteSetProfile(setId); |
modules/dnet-actionmanager-service/trunk/src/main/java/eu/dnetlib/actionmanager/is/ISClient.java | ||
---|---|---|
222 | 222 |
} |
223 | 223 |
} |
224 | 224 |
|
225 |
public String getBasePathHDFS() throws ISLookUpException { |
|
226 |
final String basePath = serviceLocator.getService(ISLookUpService.class).getResourceProfileByQuery( |
|
227 |
"/RESOURCE_PROFILE[./HEADER/RESOURCE_TYPE/@value='ActionManagerServiceResourceType']//SERVICE_PROPERTIES/PROPERTY[@key='basePath']/@value/string()"); |
|
228 |
return basePath; |
|
229 |
} |
|
230 |
|
|
225 | 231 |
public StringTemplate getActionManagerSetDsTemplate() { |
226 | 232 |
return actionManagerSetDsTemplate; |
227 | 233 |
} |
Also available in: Unified diff
introduced creation/deletion of ActionSet directory on HDFS