1
|
package eu.dnetlib.data.hadoop.action;
|
2
|
|
3
|
import eu.dnetlib.data.hadoop.HadoopServiceCore;
|
4
|
import eu.dnetlib.data.hadoop.config.ClusterName;
|
5
|
import eu.dnetlib.data.hadoop.rmi.HadoopServiceException;
|
6
|
import eu.dnetlib.enabling.tools.blackboard.BlackboardJob;
|
7
|
import eu.dnetlib.enabling.tools.blackboard.BlackboardServerHandler;
|
8
|
import org.apache.commons.logging.Log;
|
9
|
import org.apache.commons.logging.LogFactory;
|
10
|
import org.springframework.beans.factory.annotation.Autowired;
|
11
|
|
12
|
/**
|
13
|
* Delete a path on hdfs.
|
14
|
*
|
15
|
* Params - cluster: cluster name, path: the path to deleteFromHBase recursively
|
16
|
*
|
17
|
* @author claudio
|
18
|
*
|
19
|
*/
|
20
|
public class DeleteHdfsPathAction extends AbstractHadoopAction {
|
21
|
|
22
|
/**
|
23
|
* logger.
|
24
|
*/
|
25
|
private static final Log log = LogFactory.getLog(DeleteHdfsPathAction.class); // NOPMD by marko on 11/24/08 5:02 PM
|
26
|
|
27
|
/**
|
28
|
* The hadoop service core.
|
29
|
*/
|
30
|
@Autowired
|
31
|
private HadoopServiceCore hadoopServiceCore;
|
32
|
|
33
|
@Override
|
34
|
protected void executeAsync(final BlackboardServerHandler handler, final BlackboardJob job) throws HadoopServiceException {
|
35
|
final ClusterName clusterName = ClusterName.valueOf(job.getParameters().get("cluster"));
|
36
|
log.info("deleteFromHBase request on cluster: " + clusterName.toString());
|
37
|
|
38
|
final String path = job.getParameters().get("path");
|
39
|
hadoopServiceCore.deleteFromHdfs(clusterName, path);
|
40
|
|
41
|
handler.done(job);
|
42
|
}
|
43
|
|
44
|
}
|