MasterWorkerAPIImplementation { public void bootstrapCommand(uk.ac.imperial.lsds.seep.comm.protocol.BootstrapCommand bc){ InetAddress bootIp = null; try { String ipStr = bc.getIp(); bootIp = InetAddress.getByName(ipStr); } catch (UnknownHostException e) { e.printStackTrace(); } int dataPort = bc.getDataPort(); int controlPort = bc.getControlPort(); int workerId = Utils.computeIdFromIpAndPort(bootIp, controlPort); LOG.info("New worker [id-> {}] node in {}:{}, dataPort: {}", workerId, bootIp.getHostAddress(), controlPort, dataPort); ExecutionUnit eu = inf.buildExecutionUnit(bootIp, controlPort, dataPort); inf.addExecutionUnit(eu); } MasterWorkerAPIImplementation(GenericQueryManager qm, InfrastructureManager inf); void bootstrapCommand(uk.ac.imperial.lsds.seep.comm.protocol.BootstrapCommand bc); void handleDeadWorker(DeadWorkerCommand dwc); void stageStatusCommand(StageStatusCommand ssc);  }
@Test public void testBootstrap() { InfrastructureManager inf = InfrastructureManagerFactory.createInfrastructureManager(0); Map<Integer, ControlEndPoint> mapOperatorToEndPoint = null; Comm cu = new IOComm(new JavaSerializer(), Executors.newCachedThreadPool()); LifecycleManager lifeManager = LifecycleManager.getInstance(); GenericQueryManager qm = GenericQueryManager.getInstance(inf, mapOperatorToEndPoint, cu, lifeManager, null); MasterWorkerAPIImplementation api = new MasterWorkerAPIImplementation(qm, inf); int avail = inf.executionUnitsAvailable(); assert(avail == 0); BootstrapCommand bc = new BootstrapCommand("10.0.0.1", 3500, 4500); api.bootstrapCommand(bc); avail = inf.executionUnitsAvailable(); assert(avail == 1); }