Revision 49795
Added by Claudio Atzori over 6 years ago
HBaseTestContextConfiguration.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.data.hadoop.hbase; |
2 | 2 |
|
3 |
import eu.dnetlib.data.hadoop.HadoopClientMap; |
|
4 |
import eu.dnetlib.data.hadoop.HadoopServiceCore; |
|
5 |
import eu.dnetlib.data.hadoop.config.ConfigurationEnumerator; |
|
6 |
import eu.dnetlib.data.hadoop.config.ConfigurationFactory; |
|
7 |
import eu.dnetlib.data.hadoop.mapred.JobClientFactory; |
|
8 |
import eu.dnetlib.data.hadoop.oozie.OozieClientFactory; |
|
3 | 9 |
import org.springframework.context.annotation.Bean; |
4 | 10 |
import org.springframework.context.annotation.Configuration; |
5 | 11 |
import org.springframework.context.annotation.Profile; |
6 | 12 |
import org.springframework.core.io.ClassPathResource; |
7 | 13 |
import org.springframework.core.io.Resource; |
8 | 14 |
|
9 |
import eu.dnetlib.data.hadoop.HadoopClientMap; |
|
10 |
import eu.dnetlib.data.hadoop.HadoopServiceCore; |
|
11 |
import eu.dnetlib.data.hadoop.config.ConfigurationEnumerator; |
|
12 |
import eu.dnetlib.data.hadoop.config.ConfigurationFactory; |
|
13 |
import eu.dnetlib.data.hadoop.oozie.OozieClientFactory; |
|
14 |
import eu.dnetlib.data.mapreduce.JobClientFactory; |
|
15 |
|
|
16 | 15 |
@Configuration |
17 | 16 |
@Profile(value = "test") |
18 | 17 |
public class HBaseTestContextConfiguration { |
... | ... | |
34 | 33 |
return core; |
35 | 34 |
} |
36 | 35 |
|
37 |
@Bean(initMethod = "init")
|
|
36 |
@Bean |
|
38 | 37 |
public HadoopClientMap hadoopClientMap() throws InterruptedException { |
39 | 38 |
final HadoopClientMap clientMap = new HadoopClientMap(); |
40 | 39 |
clientMap.setEnabledClients(ENABLED_CLIENTS); |
41 |
clientMap.setClientsInitTime(10); |
|
42 | 40 |
|
43 | 41 |
return clientMap; |
44 | 42 |
} |
Also available in: Unified diff
lazy init of hadoop clients allow to define the user for HBase admin and jtClient once. The user is available as service property