@Test public void testMergeRoleCommandOrder() throws Exception { StackInfo stack = stackManager.getStack("HDP", "2.1.1"); Map<String, Object> roleCommandOrder = stack.getRoleCommandOrder().getContent(); assertTrue(roleCommandOrder.containsKey("optional_glusterfs")); assertTrue(roleCommandOrder.containsKey("general_deps")); assertTrue(roleCommandOrder.containsKey("optional_no_glusterfs")); assertTrue(roleCommandOrder.containsKey("namenode_optional_ha")); assertTrue(roleCommandOrder.containsKey("resourcemanager_optional_ha")); Map<String, Object> generalDeps = (Map<String, Object>) roleCommandOrder.get("general_deps"); assertTrue(generalDeps.containsKey("HBASE_MASTER-START")); assertTrue(generalDeps.containsKey("HBASE_REGIONSERVER-START")); Map<String, Object> optionalNoGlusterfs = (Map<String, Object>) roleCommandOrder.get("optional_no_glusterfs"); assertTrue(optionalNoGlusterfs.containsKey("SECONDARY_NAMENODE-START")); ArrayList<String> hbaseMasterStartValues = (ArrayList<String>) generalDeps.get("HBASE_MASTER-START"); assertTrue(hbaseMasterStartValues.get(0).equals("ZOOKEEPER_SERVER-START")); ServiceInfo service = stack.getService("PIG"); assertNotNull("PIG's roll command order is null", service.getRoleCommandOrder()); assertTrue(optionalNoGlusterfs.containsKey("NAMENODE-STOP")); ArrayList<String> nameNodeStopValues = (ArrayList<String>) optionalNoGlusterfs.get("NAMENODE-STOP"); assertTrue(nameNodeStopValues.contains("JOBTRACKER-STOP")); assertTrue(nameNodeStopValues.contains("CUSTOM_MASTER-STOP")); assertTrue(generalDeps.containsKey("CUSTOM_MASTER-START")); ArrayList<String> customMasterStartValues = (ArrayList<String>) generalDeps.get("CUSTOM_MASTER-START"); assertTrue(customMasterStartValues.contains("ZOOKEEPER_SERVER-START")); assertTrue(customMasterStartValues.contains("NAMENODE-START")); }
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; }