@Test public void testParameterParsing() throws IOException { AgentProviderService aps = createAgentProviderService(new Configuration()); AggregateConf aggConf = new AggregateConf(); ConfTreeOperations treeOps = aggConf.getAppConfOperations(); treeOps.getGlobalOptions().put(AgentKeys.SYSTEM_CONFIGS, "core-site,yarn-site, core-site "); List<String> configs = aps.getSystemConfigurationsRequested(treeOps); Assert.assertEquals(2, configs.size()); Assert.assertTrue(configs.contains("core-site")); Assert.assertFalse(configs.contains("bore-site")); }
@VisibleForTesting protected List<String> getSystemConfigurationsRequested(ConfTreeOperations appConf) { List<String> configList = new ArrayList<String>(); String configTypes = appConf.get(AgentKeys.SYSTEM_CONFIGS); if (configTypes != null && configTypes.length() > 0) { String[] configs = configTypes.split(","); for (String config : configs) { configList.add(config.trim()); } } return new ArrayList<String>(new HashSet<String>(configList)); }
AgentProviderService extends AbstractProviderService implements
    ProviderCore,
    AgentKeys,
    SliderKeys, AgentRestOperations { @VisibleForTesting protected List<String> getSystemConfigurationsRequested(ConfTreeOperations appConf) { List<String> configList = new ArrayList<String>(); String configTypes = appConf.get(AgentKeys.SYSTEM_CONFIGS); if (configTypes != null && configTypes.length() > 0) { String[] configs = configTypes.split(","); for (String config : configs) { configList.add(config.trim()); } } return new ArrayList<String>(new HashSet<String>(configList)); } }
AgentProviderService extends AbstractProviderService implements
    ProviderCore,
    AgentKeys,
    SliderKeys, AgentRestOperations { @VisibleForTesting protected List<String> getSystemConfigurationsRequested(ConfTreeOperations appConf) { List<String> configList = new ArrayList<String>(); String configTypes = appConf.get(AgentKeys.SYSTEM_CONFIGS); if (configTypes != null && configTypes.length() > 0) { String[] configs = configTypes.split(","); for (String config : configs) { configList.add(config.trim()); } } return new ArrayList<String>(new HashSet<String>(configList)); } AgentProviderService(); }
AgentProviderService extends AbstractProviderService implements
    ProviderCore,
    AgentKeys,
    SliderKeys, AgentRestOperations { @VisibleForTesting protected List<String> getSystemConfigurationsRequested(ConfTreeOperations appConf) { List<String> configList = new ArrayList<String>(); String configTypes = appConf.get(AgentKeys.SYSTEM_CONFIGS); if (configTypes != null && configTypes.length() > 0) { String[] configs = configTypes.split(","); for (String config : configs) { configList.add(config.trim()); } } return new ArrayList<String>(new HashSet<String>(configList)); } AgentProviderService(); @Override String getHumanName(); @Override List<ProviderRole> getRoles(); @Override Configuration loadProviderConfigurationInformation(File confDir); @Override void validateInstanceDefinition(AggregateConf instanceDefinition); @Override void initializeApplicationConfiguration(
      AggregateConf instanceDefinition, SliderFileSystem fileSystem,
      String roleGroup); @Override void buildContainerLaunchContext(ContainerLauncher launcher,
                                          AggregateConf instanceDefinition,
                                          Container container,
                                          ProviderRole providerRole,
                                          SliderFileSystem fileSystem,
                                          Path generatedConfPath,
                                          MapOperations resourceComponent,
                                          MapOperations appComponent,
                                          Path containerTmpDirPath); @Override void rebuildContainerDetails(List<Container> liveContainers,
                                      String applicationId, Map<Integer, ProviderRole> providerRoleMap); @Override boolean isSupportedRole(String role); @Override RegistrationResponse handleRegistration(Register registration); @Override HeartBeatResponse handleHeartBeat(HeartBeat heartBeat); @Override Map<String, MonitorDetail> buildMonitorDetails(ClusterDescription clusterDesc); @Override void applyInitialRegistryDefinitions(URL amWebURI,
      URL agentOpsURI,
      URL agentStatusURI,
      ServiceRecord serviceRecord); @Override void notifyContainerCompleted(ContainerId containerId); void setInUpgradeMode(boolean inUpgradeMode); void addUpgradeContainers(Set<String> upgradeContainers); void setAppStopInitiated(boolean appStopInitiated); Map<String, String> buildProviderStatus(); }
AgentProviderService extends AbstractProviderService implements
    ProviderCore,
    AgentKeys,
    SliderKeys, AgentRestOperations { @VisibleForTesting protected List<String> getSystemConfigurationsRequested(ConfTreeOperations appConf) { List<String> configList = new ArrayList<String>(); String configTypes = appConf.get(AgentKeys.SYSTEM_CONFIGS); if (configTypes != null && configTypes.length() > 0) { String[] configs = configTypes.split(","); for (String config : configs) { configList.add(config.trim()); } } return new ArrayList<String>(new HashSet<String>(configList)); } AgentProviderService(); @Override String getHumanName(); @Override List<ProviderRole> getRoles(); @Override Configuration loadProviderConfigurationInformation(File confDir); @Override void validateInstanceDefinition(AggregateConf instanceDefinition); @Override void initializeApplicationConfiguration(
      AggregateConf instanceDefinition, SliderFileSystem fileSystem,
      String roleGroup); @Override void buildContainerLaunchContext(ContainerLauncher launcher,
                                          AggregateConf instanceDefinition,
                                          Container container,
                                          ProviderRole providerRole,
                                          SliderFileSystem fileSystem,
                                          Path generatedConfPath,
                                          MapOperations resourceComponent,
                                          MapOperations appComponent,
                                          Path containerTmpDirPath); @Override void rebuildContainerDetails(List<Container> liveContainers,
                                      String applicationId, Map<Integer, ProviderRole> providerRoleMap); @Override boolean isSupportedRole(String role); @Override RegistrationResponse handleRegistration(Register registration); @Override HeartBeatResponse handleHeartBeat(HeartBeat heartBeat); @Override Map<String, MonitorDetail> buildMonitorDetails(ClusterDescription clusterDesc); @Override void applyInitialRegistryDefinitions(URL amWebURI,
      URL agentOpsURI,
      URL agentStatusURI,
      ServiceRecord serviceRecord); @Override void notifyContainerCompleted(ContainerId containerId); void setInUpgradeMode(boolean inUpgradeMode); void addUpgradeContainers(Set<String> upgradeContainers); void setAppStopInitiated(boolean appStopInitiated); Map<String, String> buildProviderStatus();  }