I have Spring Boot Hadoop and want to take advantage of the Spring HbaseTemplate. My issue is the documentation has only information about the \"xml\" way of the configurati
Even though a Java-based configuration for HBase is yet not formally available (as recently as Spring Hadoop 2.2.1), there is a clean workaround. Include the relevant ZooKeeper details as properties within a Java-based Spring Hadoop configuration. Then, the hbase-configuration XML tag need not include any configuration details. By convention, it will depend on the hadoopConfiguration bean defined by the Java-based HadoopConfigConfigurer.
@Configuration
@EnableHadoop
public class MapReduceConfiguration extends SpringHadoopConfigurerAdapter {
@Override
public void configure(HadoopConfigConfigurer config) throws Exception {
config
.fileSystemUri(myConfigManager.getHadoopFsUri())
.resourceManagerAddress(myConfigManager.getHadoopResourceManagerAddress())
.withProperties()
.property("hbase.zookeeper.quorum", myConfigManager.getZookeeperQuorum())
.property("hbase.zookeeper.property.clientPort", myConfigManager.getZookeeperPort())
.property("hbase.client.scanner.caching", "1");
}
}
The remaining XML configuration is agnostic to the deployment environment: