@Test public void testPopulateConfigTypes() throws Exception { StackInfo stack = stackManager.getStack("HDP", "2.0.7"); ServiceInfo hdfsService = stack.getService("HDFS"); Map<String, Map<String, Map<String, String>>> configTypes = hdfsService.getConfigTypeAttributes(); assertEquals(4, configTypes.size()); Map<String, Map<String, String>> configType = configTypes.get("global"); assertEquals(1, configType.size()); Map<String, String> supportsMap = configType.get("supports"); assertEquals(3, supportsMap.size()); assertEquals("true", supportsMap.get("final")); assertEquals("false", supportsMap.get("adding_forbidden")); assertEquals("false", supportsMap.get("do_not_extend")); configType = configTypes.get("hdfs-site"); assertEquals(1, configType.size()); supportsMap = configType.get("supports"); assertEquals(3, supportsMap.size()); assertEquals("false", supportsMap.get("final")); assertEquals("false", supportsMap.get("adding_forbidden")); assertEquals("false", supportsMap.get("do_not_extend")); configType = configTypes.get("core-site"); assertEquals(1, configType.size()); supportsMap = configType.get("supports"); assertEquals(3, supportsMap.size()); assertEquals("false", supportsMap.get("final")); assertEquals("false", supportsMap.get("adding_forbidden")); assertEquals("false", supportsMap.get("do_not_extend")); configType = configTypes.get("hadoop-policy"); assertEquals(1, configType.size()); supportsMap = configType.get("supports"); assertEquals(3, supportsMap.size()); assertEquals("false", supportsMap.get("final")); assertEquals("false", supportsMap.get("adding_forbidden")); assertEquals("false", supportsMap.get("do_not_extend")); ServiceInfo yarnService = stack.getService("YARN"); configTypes = yarnService.getConfigTypeAttributes(); assertEquals(4, configTypes.size()); assertTrue(configTypes.containsKey("yarn-site")); assertTrue(configTypes.containsKey("core-site")); assertTrue(configTypes.containsKey("global")); assertTrue(configTypes.containsKey("capacity-scheduler")); configType = configTypes.get("yarn-site"); supportsMap = configType.get("supports"); assertEquals(3, supportsMap.size()); assertEquals("false", supportsMap.get("final")); assertEquals("true", supportsMap.get("adding_forbidden")); assertEquals("true", supportsMap.get("do_not_extend")); ServiceInfo mrService = stack.getService("MAPREDUCE2"); configTypes = mrService.getConfigTypeAttributes(); assertEquals(3, configTypes.size()); assertTrue(configTypes.containsKey("mapred-site")); assertTrue(configTypes.containsKey("core-site")); assertTrue(configTypes.containsKey("mapred-queue-acls")); }
public StackInfo getStack(String name, String version) { return stackMap.get(name + StackManager.PATH_DELIMITER + version); }
StackManager { public StackInfo getStack(String name, String version) { return stackMap.get(name + StackManager.PATH_DELIMITER + version); } }
StackManager { public StackInfo getStack(String name, String version) { return stackMap.get(name + StackManager.PATH_DELIMITER + version); } @AssistedInject  StackManager(@Assisted("stackRoot") File stackRoot,
      @Assisted("commonServicesRoot") @Nullable File commonServicesRoot,
      @Assisted("extensionRoot") @Nullable File extensionRoot,
      @Assisted OsFamily osFamily, @Assisted boolean validate,
      MetainfoDAO metaInfoDAO, ActionMetadata actionMetadata, StackDAO stackDao,
      ExtensionDAO extensionDao, ExtensionLinkDAO linkDao); }
StackManager { public StackInfo getStack(String name, String version) { return stackMap.get(name + StackManager.PATH_DELIMITER + version); } @AssistedInject  StackManager(@Assisted("stackRoot") File stackRoot,
      @Assisted("commonServicesRoot") @Nullable File commonServicesRoot,
      @Assisted("extensionRoot") @Nullable File extensionRoot,
      @Assisted OsFamily osFamily, @Assisted boolean validate,
      MetainfoDAO metaInfoDAO, ActionMetadata actionMetadata, StackDAO stackDao,
      ExtensionDAO extensionDao, ExtensionLinkDAO linkDao); StackInfo getStack(String name, String version); Collection<StackInfo> getStacks(String name); Collection<StackInfo> getStacks(); ExtensionInfo getExtension(String name, String version); Collection<ExtensionInfo> getExtensions(String name); Collection<ExtensionInfo> getExtensions(); boolean haveAllRepoUrlsBeenResolved(); static Validator getPropertySchemaValidator(); static void validateAllPropertyXmlsInFolderRecursively(File stackRoot, Validator validator); void linkStackToExtension(StackInfo stack, ExtensionInfo extension); void unlinkStackAndExtension(StackInfo stack, ExtensionInfo extension); }
StackManager { public StackInfo getStack(String name, String version) { return stackMap.get(name + StackManager.PATH_DELIMITER + version); } @AssistedInject  StackManager(@Assisted("stackRoot") File stackRoot,
      @Assisted("commonServicesRoot") @Nullable File commonServicesRoot,
      @Assisted("extensionRoot") @Nullable File extensionRoot,
      @Assisted OsFamily osFamily, @Assisted boolean validate,
      MetainfoDAO metaInfoDAO, ActionMetadata actionMetadata, StackDAO stackDao,
      ExtensionDAO extensionDao, ExtensionLinkDAO linkDao); StackInfo getStack(String name, String version); Collection<StackInfo> getStacks(String name); Collection<StackInfo> getStacks(); ExtensionInfo getExtension(String name, String version); Collection<ExtensionInfo> getExtensions(String name); Collection<ExtensionInfo> getExtensions(); boolean haveAllRepoUrlsBeenResolved(); static Validator getPropertySchemaValidator(); static void validateAllPropertyXmlsInFolderRecursively(File stackRoot, Validator validator); void linkStackToExtension(StackInfo stack, ExtensionInfo extension); void unlinkStackAndExtension(StackInfo stack, ExtensionInfo extension); static final String PROPERTY_SCHEMA_PATH; static String PATH_DELIMITER; static final String COMMON_SERVICES; static final String EXTENSIONS; static final String METAINFO_FILE_NAME; }