use of org.apache.whirr.ClusterController in project whirr by apache.
the class VoldemortServiceTest 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-voldemort-test.properties"));
clusterSpec = ClusterSpec.withTemporaryKeys(config);
controller = new ClusterController();
cluster = controller.launchCluster(clusterSpec);
waitForBootstrap();
}
use of org.apache.whirr.ClusterController in project whirr by apache.
the class MahoutServiceTest method setUp.
@BeforeClass
public static 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-mahout-test.properties"));
clusterSpec = ClusterSpec.withTemporaryKeys(config);
controller = new ClusterController();
controller.launchCluster(clusterSpec);
}
use of org.apache.whirr.ClusterController 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.whirr.ClusterController in project whirr by apache.
the class RunScriptCommand method run.
public int run(InputStream in, PrintStream out, PrintStream err, ClusterSpec clusterSpec, String[] instances, String[] roles, String fileName) throws Exception {
ClusterController controller = createClusterController(clusterSpec.getServiceName());
Predicate<NodeMetadata> condition = buildFilterPredicate(instances, roles, clusterSpec);
return handleScriptOutput(out, err, controller.runScriptOnNodesMatching(clusterSpec, condition, execFile(fileName)));
}
use of org.apache.whirr.ClusterController in project whirr by apache.
the class DestroyInstanceCommandTest method testDestroyInstanceById.
@Test
public void testDestroyInstanceById() throws Exception {
ClusterControllerFactory factory = mock(ClusterControllerFactory.class);
ClusterController controller = mock(ClusterController.class);
when(factory.create((String) any())).thenReturn(controller);
DestroyInstanceCommand command = new DestroyInstanceCommand(factory);
Map<String, File> keys = KeyPair.generateTemporaryFiles();
int rc = command.run(null, out, null, Lists.newArrayList("--instance-templates", "1 noop", "--instance-id", "region/instanceid", "--service-name", "test-service", "--cluster-name", "test-cluster", "--provider", "rackspace", "--identity", "myusername", "--credential", "mypassword", "--private-key-file", keys.get("private").getAbsolutePath(), "--version", "version-string"));
assertThat(rc, is(0));
verify(controller).destroyInstance((ClusterSpec) any(), eq("region/instanceid"));
}
Aggregations