HadoopLaunchHandler { void startCluster() throws IOException, InterruptedException { String startCmd = configuration.get("calvalus.openstack.startcmd"); LOG.info(startCmd); Process process = Runtime.getRuntime().exec(startCmd, null, new File(configuration.get("calvalus.openstack.workdir"))); KeywordHandler keywordHandler = new ExternalIpHandler(startCmd, configuration); new ProcessObserver(process).setHandler(keywordHandler).start(); if (process.waitFor() != 0) { throw new IOException(startCmd + " failed"); } String[] outputFiles = keywordHandler.getOutputFiles(); if (outputFiles.length < 1) { throw new IOException("external IP of master not found"); } configuration.set("yarn.resourcemanager.hostname", outputFiles[0]); configuration.set("yarn.resourcemanager.address", outputFiles[0] + ":8032"); configuration.set("mapreduce.jobhistory.address", outputFiles[0] + ":10020"); configuration.set("mapreduce.jobhistory.webapp.address", outputFiles[0] + ":19888"); configuration.set("yarn.log.server.url", outputFiles[0] + ":19888/jobhistory/logs"); hadoopProcessingService.clearCache(); } HadoopLaunchHandler(Configuration configuration);  HadoopLaunchHandler(HadoopProcessingService hadoopProcessingService, Configuration configuration); void queueWorkflowItem(HadoopWorkflowItem workflowItem);  }
@Ignore @Test public void testStartCluster() throws IOException, InterruptedException { Configuration configuration = new Configuration(); configuration.set("calvalus.openstack.workdir", "/home/martin/tmp/dias-inst"); configuration.set("calvalus.openstack.startcmd", "./cdt.py mundi startup s2-c2rcc-test-request.json"); new HadoopLaunchHandler(configuration).startCluster(); assertEquals("launched master", "80.158.", configuration.get("calvalus.hadoop.yarn.resourcemanager.hostname").substring(0, "80.158.".length())); }