1
|
package eu.dnetlib.msro.openaireplus.workflows.nodes.hbase;
|
2
|
|
3
|
import java.util.Set;
|
4
|
|
5
|
import org.apache.commons.logging.Log;
|
6
|
import org.apache.commons.logging.LogFactory;
|
7
|
|
8
|
import com.googlecode.sarasvati.Arc;
|
9
|
import com.googlecode.sarasvati.NodeToken;
|
10
|
|
11
|
import eu.dnetlib.msro.openaireplus.workflows.hbase.HBaseTableUtils;
|
12
|
|
13
|
public class CreateHBaseTableJobNode extends AbstractHBaseAdminJobNode {
|
14
|
|
15
|
private static final Log log = LogFactory.getLog(CreateHBaseTableJobNode.class); // NOPMD by marko on 11/24/08 5:02 PM
|
16
|
|
17
|
private String xqueryForColumnsProperty;
|
18
|
|
19
|
@Override
|
20
|
protected String execute(final NodeToken token) throws Exception {
|
21
|
final Set<String> columns = HBaseTableUtils.listColumns();
|
22
|
final String tableName = tableName(token);
|
23
|
final String cluster = cluster(token);
|
24
|
|
25
|
log.debug("Ensuring table " + tableName + " on cluster: '" + cluster + "' - columns: " + columns);
|
26
|
|
27
|
hadoopServiceLocator.getService().createHbaseTable(cluster, tableName, columns);
|
28
|
|
29
|
return Arc.DEFAULT_ARC;
|
30
|
}
|
31
|
|
32
|
public String getXqueryForColumnsProperty() {
|
33
|
return xqueryForColumnsProperty;
|
34
|
}
|
35
|
|
36
|
public void setXqueryForColumnsProperty(final String xqueryForColumnsProperty) {
|
37
|
this.xqueryForColumnsProperty = xqueryForColumnsProperty;
|
38
|
}
|
39
|
|
40
|
}
|