use of org.apache.commons.configuration.CompositeConfiguration in project whirr by apache.
the class BootstrapTemplateTest method buildClusterSpecWith.
private ClusterSpec buildClusterSpecWith(Map<String, String> overrides) throws Exception {
CompositeConfiguration config = new CompositeConfiguration();
config.setProperty("whirr.image-id", "us-east-1/ami-123");
for (String key : overrides.keySet()) {
config.setProperty(key, overrides.get(key));
}
return ClusterSpec.withTemporaryKeys(config);
}
use of org.apache.commons.configuration.CompositeConfiguration in project whirr by apache.
the class HBaseConfigurationBuilder method build.
private static Configuration build(ClusterSpec clusterSpec, Cluster cluster, Configuration defaults, String prefix) throws ConfigurationException {
CompositeConfiguration config = new CompositeConfiguration();
Configuration sub = clusterSpec.getConfigurationForKeysWithPrefix(prefix);
// remove prefix
config.addConfiguration(sub.subset(prefix));
config.addConfiguration(defaults.subset(prefix));
return config;
}
use of org.apache.commons.configuration.CompositeConfiguration in project whirr by apache.
the class HadoopServiceController method startup.
public synchronized void startup() throws Exception {
LOG.info("Starting up cluster...");
CompositeConfiguration config = new CompositeConfiguration();
if (System.getProperty("config") != null) {
config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
}
config.addConfiguration(configuration);
clusterSpec = ClusterSpec.withTemporaryKeys(config);
controller = new ClusterController();
cluster = controller.launchCluster(clusterSpec);
proxy = new HadoopProxy(clusterSpec, cluster);
proxy.start();
Configuration conf = getConfiguration();
JobConf job = new JobConf(conf, HadoopServiceTest.class);
JobClient client = new JobClient(job);
waitToExitSafeMode(client);
waitForTaskTrackers(client);
running = true;
}
use of org.apache.commons.configuration.CompositeConfiguration in project whirr by apache.
the class HBaseServiceController method startup.
public synchronized void startup() throws Exception {
LOG.info("Starting up cluster...");
CompositeConfiguration config = new CompositeConfiguration();
if (System.getProperty("config") != null) {
config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
}
config.addConfiguration(new PropertiesConfiguration(this.configResource));
clusterSpec = ClusterSpec.withTemporaryKeys(config);
controller = new ClusterController();
cluster = controller.launchCluster(clusterSpec);
proxy = new HadoopProxy(clusterSpec, cluster);
proxy.start();
waitForMaster();
running = true;
}
use of org.apache.commons.configuration.CompositeConfiguration in project whirr by apache.
the class ElasticSearchTest method setUp.
@Before
public void setUp() throws Exception {
CompositeConfiguration config = new CompositeConfiguration();
config.addConfiguration(new PropertiesConfiguration("whirr-elasticsearch-test.properties"));
if (System.getProperty("config") != null) {
config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
}
clusterSpec = ClusterSpec.withTemporaryKeys(config);
controller = new ClusterController();
cluster = controller.launchCluster(clusterSpec);
}
Aggregations