@Test public void testAgentMaster() throws Exception { AgentMaster master = AgentMaster.getAgentMaster(); while (master.getMasterActor() == null) { } String instId = "instance-0"; Object answer = master.askMaster(AgentToMaster.RegisterNewAgent.getInstance(instId)); assertTrue(answer instanceof MasterToAgent.AgentRegistered); MasterToAgent.AgentRegistered registered = (MasterToAgent.AgentRegistered) answer; assertEquals(instId, registered.getAgentId().getId()); }
private AgentMaster(SmartConf conf) throws IOException { String[] addresses = AgentUtils.getMasterAddress(conf); if (addresses == null) { throw new IOException("AgentMaster address not configured!"); } String address = addresses[0]; LOG.info("Agent master: " + address); Config config = AgentUtils.overrideRemoteAddress( ConfigFactory.load(AgentConstants.AKKA_CONF_FILE), address); CmdletDispatcherHelper.init(); this.agentManager = new AgentManager(); Props props = Props.create(MasterActor.class, null, agentManager); ActorSystemLauncher launcher = new ActorSystemLauncher(config, props); launcher.start(); }
AgentMaster { private AgentMaster(SmartConf conf) throws IOException { String[] addresses = AgentUtils.getMasterAddress(conf); if (addresses == null) { throw new IOException("AgentMaster address not configured!"); } String address = addresses[0]; LOG.info("Agent master: " + address); Config config = AgentUtils.overrideRemoteAddress( ConfigFactory.load(AgentConstants.AKKA_CONF_FILE), address); CmdletDispatcherHelper.init(); this.agentManager = new AgentManager(); Props props = Props.create(MasterActor.class, null, agentManager); ActorSystemLauncher launcher = new ActorSystemLauncher(config, props); launcher.start(); } }
AgentMaster { private AgentMaster(SmartConf conf) throws IOException { String[] addresses = AgentUtils.getMasterAddress(conf); if (addresses == null) { throw new IOException("AgentMaster address not configured!"); } String address = addresses[0]; LOG.info("Agent master: " + address); Config config = AgentUtils.overrideRemoteAddress( ConfigFactory.load(AgentConstants.AKKA_CONF_FILE), address); CmdletDispatcherHelper.init(); this.agentManager = new AgentManager(); Props props = Props.create(MasterActor.class, null, agentManager); ActorSystemLauncher launcher = new ActorSystemLauncher(config, props); launcher.start(); } private  AgentMaster(SmartConf conf); }
AgentMaster { private AgentMaster(SmartConf conf) throws IOException { String[] addresses = AgentUtils.getMasterAddress(conf); if (addresses == null) { throw new IOException("AgentMaster address not configured!"); } String address = addresses[0]; LOG.info("Agent master: " + address); Config config = AgentUtils.overrideRemoteAddress( ConfigFactory.load(AgentConstants.AKKA_CONF_FILE), address); CmdletDispatcherHelper.init(); this.agentManager = new AgentManager(); Props props = Props.create(MasterActor.class, null, agentManager); ActorSystemLauncher launcher = new ActorSystemLauncher(config, props); launcher.start(); } private  AgentMaster(SmartConf conf); static AgentMaster getAgentMaster(); static AgentMaster getAgentMaster(SmartConf conf); static void setCmdletManager(CmdletManager statusUpdater); boolean canAcceptMore(); String launchCmdlet(LaunchCmdlet launch); void stopCmdlet(long cmdletId); void shutdown(); List<AgentInfo> getAgentInfos(); int getNumAgents(); }
AgentMaster { private AgentMaster(SmartConf conf) throws IOException { String[] addresses = AgentUtils.getMasterAddress(conf); if (addresses == null) { throw new IOException("AgentMaster address not configured!"); } String address = addresses[0]; LOG.info("Agent master: " + address); Config config = AgentUtils.overrideRemoteAddress( ConfigFactory.load(AgentConstants.AKKA_CONF_FILE), address); CmdletDispatcherHelper.init(); this.agentManager = new AgentManager(); Props props = Props.create(MasterActor.class, null, agentManager); ActorSystemLauncher launcher = new ActorSystemLauncher(config, props); launcher.start(); } private  AgentMaster(SmartConf conf); static AgentMaster getAgentMaster(); static AgentMaster getAgentMaster(SmartConf conf); static void setCmdletManager(CmdletManager statusUpdater); boolean canAcceptMore(); String launchCmdlet(LaunchCmdlet launch); void stopCmdlet(long cmdletId); void shutdown(); List<AgentInfo> getAgentInfos(); int getNumAgents(); static final Timeout TIMEOUT; }