Project

General

Profile

« Previous | Next » 

Revision 55759

reintegrated branch solr75 -r53788:HEAD

View differences:

DefineHBaseOpenaireSchemaJobNode.java
5 5
import com.googlecode.sarasvati.Arc;
6 6
import com.googlecode.sarasvati.NodeToken;
7 7
import eu.dnetlib.openaire.hadoop.utils.HBaseTableUtils;
8
import org.apache.commons.lang3.StringUtils;
8 9
import org.apache.commons.logging.Log;
9 10
import org.apache.commons.logging.LogFactory;
10 11

  
......
12 13

  
13 14
	private static final Log log = LogFactory.getLog(DefineHBaseOpenaireSchemaJobNode.class); // NOPMD by marko on 11/24/08 5:02 PM
14 15

  
16
	private String schema;
17

  
15 18
	@Override
16 19
	protected String execute(final NodeToken token) throws Exception {
17 20

  
18
		final Set<String> columns = HBaseTableUtils.listAllColumns();
19
		log.info("table definition: " + columns);
20
		token.getEnv().setAttribute(getTableColumnsParamName(), asCSV(columns));
21
		final String schemaOverride = StringUtils.isNotBlank(getSchema()) ? getSchema() : asCSV(HBaseTableUtils.listAllColumns());
22
		log.info("table definition: " + schemaOverride);
23
		token.getEnv().setAttribute(getTableColumnsParamName(), schemaOverride);
21 24

  
22 25
		return Arc.DEFAULT_ARC;
23 26
	}
24 27

  
28
	public String getSchema() {
29
		return schema;
30
	}
31

  
32
	public void setSchema(final String schema) {
33
		this.schema = schema;
34
	}
25 35
}

Also available in: Unified diff