All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lordofthejars.nosqlunit.hbase.ManagedHBaseConfigurationBuilder Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package com.lordofthejars.nosqlunit.hbase;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.coprocessor.CoprocessorHost;

public class ManagedHBaseConfigurationBuilder {

	private final HBaseConfiguration hBaseConfiguration;
	
	private ManagedHBaseConfigurationBuilder() {
		super();
		this.hBaseConfiguration = new HBaseConfiguration();

		Configuration configuration = org.apache.hadoop.hbase.HBaseConfiguration.create();
		configuration.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY,
				"org.apache.hadoop.hbase.coprocessor.AggregateImplementation");
		this.hBaseConfiguration.setConfiguration(configuration);
	}
	
	public static ManagedHBaseConfigurationBuilder newManagedHBaseConfiguration() {
		return new ManagedHBaseConfigurationBuilder();
	}
	
	public ManagedHBaseConfigurationBuilder connectionIdentifier(String connectionIdentifier) {
		this.hBaseConfiguration.setConnectionIdentifier(connectionIdentifier);
		return this;
	}
	
	public ManagedHBaseConfigurationBuilder setProperty(String name, String value) {
		this.hBaseConfiguration.getConfiguration().set(name, value);
		return this;
	}
	
	public HBaseConfiguration build() {
		return this.hBaseConfiguration;
	}
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy