use of org.apache.commons.configuration.CompositeConfiguration in project whirr by apache.
the class HamaServiceController 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(HamaServiceController.class.getResource("/whirr-hama-test.properties")));
clusterSpec = ClusterSpec.withTemporaryKeys(config);
controller = new ClusterController();
cluster = controller.launchCluster(clusterSpec);
proxy = new HadoopProxy(clusterSpec, cluster);
proxy.start();
HamaConfiguration conf = getConfiguration();
BSPJobClient client = new BSPJobClient(conf);
waitForGroomServers(client);
running = true;
}
use of org.apache.commons.configuration.CompositeConfiguration in project whirr by apache.
the class ClusterSpecTest method testApplySubroleAliases.
@Test
public void testApplySubroleAliases() throws ConfigurationException {
CompositeConfiguration c = new CompositeConfiguration();
Configuration config = new PropertiesConfiguration();
config.addProperty("whirr.instance-templates", "1 puppet:somepup::pet+something-else, 1 something-else-only");
c.addConfiguration(config);
InstanceTemplate template = InstanceTemplate.parse(c).get(0);
Set<String> expected = Sets.newLinkedHashSet(Arrays.asList(new String[] { "puppet:somepup::pet", "something-else" }));
assertThat(template.getRoles(), is(expected));
InstanceTemplate template2 = InstanceTemplate.parse(c).get(1);
Set<String> expected2 = Sets.newLinkedHashSet(Arrays.asList(new String[] { "something-else-only" }));
assertThat(template2.getRoles(), is(expected2));
}
use of org.apache.commons.configuration.CompositeConfiguration in project whirr by apache.
the class ClusterActionHandlerSupport method getConfiguration.
/**
* Returns a composite configuration that is made up from the global
* configuration coming from the Whirr core with the service default
* properties.
*
* @param clusterSpec The cluster specification instance.
* @return The composite configuration.
*/
protected Configuration getConfiguration(ClusterSpec clusterSpec, Configuration defaults) {
CompositeConfiguration cc = new CompositeConfiguration();
cc.addConfiguration(clusterSpec.getConfiguration());
cc.addConfiguration(defaults);
return cc;
}
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, HadoopServiceController.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 PuppetServiceTest method setUp.
@Before
public void setUp() throws Exception {
CompositeConfiguration config = new CompositeConfiguration();
if (System.getProperty("config") != null) {
config.addConfiguration(new PropertiesConfiguration(System.getProperty("config")));
}
config.addConfiguration(new PropertiesConfiguration("whirr-puppet-test.properties"));
clusterSpec = ClusterSpec.withTemporaryKeys(config);
controller = new ClusterController();
cluster = controller.launchCluster(clusterSpec);
socketTester = retry(controller.getCompute().apply(clusterSpec).utils().injector().getInstance(InetSocketAddressConnect.class), 60, 1, TimeUnit.SECONDS);
}
Aggregations