test_class.file: smart-engine/src/test/java/org/smartdata/server/engine/cmdlet/agent/TestAgentMaster.java
test_class.identifier: TestAgentMaster
test_case.body: @Test
    public void testAgentMaster() throws Exception {
      AgentMaster master = AgentMaster.getAgentMaster();
  
      // Wait for master to start
      while (master.getMasterActor() == null) {
        // Do nothing
      }
  
      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());
    }
test_case.class_method_signature: TestAgentMaster.testAgentMaster()
test_case.full_signature: @Test public void testAgentMaster()
test_case.identifier: testAgentMaster
test_case.invocations: getAgentMaster getMasterActor askMaster getInstance assertTrue assertEquals getId getAgentId
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAgentMaster()
focal_class.declarator: LOG = LoggerFactory.getLogger(AgentMaster.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(AgentMaster.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: TIMEOUT =
        new Timeout(Duration.create(5, TimeUnit.SECONDS))
focal_class.modifier: public static final
focal_class.original_string: public static final Timeout TIMEOUT =
        new Timeout(Duration.create(5, TimeUnit.SECONDS));
focal_class.type: Timeout
focal_class.var_name: TIMEOUT
focal_class.declarator: system
focal_class.modifier: private
focal_class.original_string: private ActorSystem system;
focal_class.type: ActorSystem
focal_class.var_name: system
focal_class.declarator: master
focal_class.modifier: private
focal_class.original_string: private ActorRef master;
focal_class.type: ActorRef
focal_class.var_name: master
focal_class.declarator: agentManager
focal_class.modifier: private
focal_class.original_string: private AgentManager agentManager;
focal_class.type: AgentManager
focal_class.var_name: agentManager
focal_class.declarator: statusUpdater
focal_class.modifier: private static
focal_class.original_string: private static CmdletManager statusUpdater;
focal_class.type: CmdletManager
focal_class.var_name: statusUpdater
focal_class.declarator: agentMaster = null
focal_class.modifier: private static
focal_class.original_string: private static AgentMaster agentMaster = null;
focal_class.type: AgentMaster
focal_class.var_name: agentMaster
focal_class.file: smart-engine/src/main/java/org/smartdata/server/engine/cmdlet/agent/AgentMaster.java
focal_class.identifier: AgentMaster
focal_class.class_method_signature: AgentMaster.AgentMaster(SmartConf conf)
focal_class.full_signature: private  AgentMaster(SmartConf conf)
focal_class.identifier: AgentMaster
focal_class.modifiers: private
focal_class.parameters: (SmartConf conf)
focal_class.signature:  AgentMaster(SmartConf conf)
focal_class.class_method_signature: AgentMaster.getAgentMaster()
focal_class.full_signature: public static AgentMaster getAgentMaster()
focal_class.identifier: getAgentMaster
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: AgentMaster
focal_class.signature: AgentMaster getAgentMaster()
focal_class.class_method_signature: AgentMaster.getAgentMaster(SmartConf conf)
focal_class.full_signature: public static AgentMaster getAgentMaster(SmartConf conf)
focal_class.identifier: getAgentMaster
focal_class.modifiers: public static
focal_class.parameters: (SmartConf conf)
focal_class.return: AgentMaster
focal_class.signature: AgentMaster getAgentMaster(SmartConf conf)
focal_class.class_method_signature: AgentMaster.setCmdletManager(CmdletManager statusUpdater)
focal_class.full_signature: public static void setCmdletManager(CmdletManager statusUpdater)
focal_class.identifier: setCmdletManager
focal_class.modifiers: public static
focal_class.parameters: (CmdletManager statusUpdater)
focal_class.return: void
focal_class.signature: void setCmdletManager(CmdletManager statusUpdater)
focal_class.class_method_signature: AgentMaster.canAcceptMore()
focal_class.full_signature: public boolean canAcceptMore()
focal_class.identifier: canAcceptMore
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean canAcceptMore()
focal_class.class_method_signature: AgentMaster.launchCmdlet(LaunchCmdlet launch)
focal_class.full_signature: public String launchCmdlet(LaunchCmdlet launch)
focal_class.identifier: launchCmdlet
focal_class.modifiers: public
focal_class.parameters: (LaunchCmdlet launch)
focal_class.return: String
focal_class.signature: String launchCmdlet(LaunchCmdlet launch)
focal_class.class_method_signature: AgentMaster.stopCmdlet(long cmdletId)
focal_class.full_signature: public void stopCmdlet(long cmdletId)
focal_class.identifier: stopCmdlet
focal_class.modifiers: public
focal_class.parameters: (long cmdletId)
focal_class.return: void
focal_class.signature: void stopCmdlet(long cmdletId)
focal_class.class_method_signature: AgentMaster.shutdown()
focal_class.full_signature: public void shutdown()
focal_class.identifier: shutdown
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void shutdown()
focal_class.class_method_signature: AgentMaster.getAgentInfos()
focal_class.full_signature: public List<AgentInfo> getAgentInfos()
focal_class.identifier: getAgentInfos
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<AgentInfo>
focal_class.signature: List<AgentInfo> getAgentInfos()
focal_class.class_method_signature: AgentMaster.getNumAgents()
focal_class.full_signature: public int getNumAgents()
focal_class.identifier: getNumAgents
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getNumAgents()
focal_class.class_method_signature: AgentMaster.getMasterActor()
focal_class.full_signature: @VisibleForTesting ActorRef getMasterActor()
focal_class.identifier: getMasterActor
focal_class.modifiers: @VisibleForTesting
focal_class.parameters: ()
focal_class.return: ActorRef
focal_class.signature: ActorRef getMasterActor()
focal_class.class_method_signature: AgentMaster.askMaster(Object message)
focal_class.full_signature:  Object askMaster(Object message)
focal_class.identifier: askMaster
focal_class.parameters: (Object message)
focal_class.return: Object
focal_class.signature: Object askMaster(Object message)
focal_method.body: 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();
    }
focal_method.class_method_signature: AgentMaster.AgentMaster(SmartConf conf)
focal_method.full_signature: private  AgentMaster(SmartConf conf)
focal_method.identifier: AgentMaster
focal_method.modifiers: private
focal_method.parameters: (SmartConf conf)
focal_method.signature:  AgentMaster(SmartConf conf)