@Test public void testIsRoleTypePresentInServiceWithSingleRole() { underTest = new CmTemplateProcessor(getBlueprintText("input/clouderamanager.bp")); boolean present = underTest.isRoleTypePresentInService("HDFS", List.of("NAMENODE")); assertTrue(present); }
public boolean isRoleTypePresentInService(String serviceType, List<String> roleTypes) { return getServiceByType(serviceType).filter(acts -> isAnyRoleTypePresent(acts, roleTypes)).isPresent(); }
CmTemplateProcessor implements BlueprintTextProcessor { public boolean isRoleTypePresentInService(String serviceType, List<String> roleTypes) { return getServiceByType(serviceType).filter(acts -> isAnyRoleTypePresent(acts, roleTypes)).isPresent(); } }
CmTemplateProcessor implements BlueprintTextProcessor { public boolean isRoleTypePresentInService(String serviceType, List<String> roleTypes) { return getServiceByType(serviceType).filter(acts -> isAnyRoleTypePresent(acts, roleTypes)).isPresent(); } CmTemplateProcessor(@Nonnull String cmTemplateText); }
CmTemplateProcessor implements BlueprintTextProcessor { public boolean isRoleTypePresentInService(String serviceType, List<String> roleTypes) { return getServiceByType(serviceType).filter(acts -> isAnyRoleTypePresent(acts, roleTypes)).isPresent(); } CmTemplateProcessor(@Nonnull String cmTemplateText); @Override ClusterManagerType getClusterManagerType(); @Override BlueprintTextProcessor replaceConfiguration(String s, String descriptor); @Override BlueprintTextProcessor addComponentToHostgroups(String component, Predicate<String> addToHostgroup); @Override boolean isComponentExistsInHostGroup(String component, String hostGroup); @Override BlueprintTextProcessor addComponentToHostgroups(String component, Collection<String> addToHostGroups); @Override Set<String> getHostGroupsWithComponent(String component); @Override String asText(); @Override BlueprintTextProcessor setSecurityType(String kerberos); @Override BlueprintTextProcessor extendBlueprintGlobalConfiguration(SiteConfigurations configs, boolean forced); @Override Set<String> getComponentsInHostGroup(String name); @Override Set<String> getImpalaCoordinatorsInHostGroup(String name); @Override BlueprintTextProcessor extendBlueprintHostGroupConfiguration(HostgroupConfigurations hostgroupConfigurations, boolean b); @Override Map<String, InstanceCount> getCardinalityByHostGroup(); Map<String, Set<ServiceComponent>> getServiceComponentsByHostGroup(); @Override String getHostGroupPropertyIdentifier(); @Override Optional<String> getVersion(); Optional<String> getCmVersion(); @Override Map<String, Set<String>> getNonGatewayComponentsByHostGroup(); @Override Map<String, Set<String>> getComponentsByHostGroup(); @Override GatewayRecommendation recommendGateway(); @Override AutoscaleRecommendation recommendAutoscale(); @Override ResizeRecommendation recommendResize(); @Override String getStackVersion(); @Override List<String> getHostTemplateNames(); Set<ServiceComponent> getAllComponents(); void addInstantiator(ClouderaManagerRepo clouderaManagerRepoDetails, TemplatePreparationObject templatePreparationObject, String sdxContextName); void addVariables(List<ApiClusterTemplateVariable> vars); void extendTemplateWithAdditionalServices(Map<String, ApiClusterTemplateService> hostGroupServices); void addServiceConfigs(String serviceType, List<String> roleTypes, List<ApiClusterTemplateConfig> configs); void mergeServiceConfigs(ApiClusterTemplateService service, List<ApiClusterTemplateConfig> newConfigs); Map<String, ApiClusterTemplateConfig> mapByName(Collection<ApiClusterTemplateConfig> configs); void addRoleConfigs(String serviceType, Map<String, List<ApiClusterTemplateConfig>> newConfigMap); void mergeRoleConfigs(ApiClusterTemplateRoleConfigGroup configGroup, List<ApiClusterTemplateConfig> newConfigs); boolean isRoleTypePresentInService(String serviceType, List<String> roleTypes); Optional<ApiClusterTemplateService> getServiceByType(String serviceType); ApiClusterTemplate getTemplate(); void addHosts(Map<String, List<Map<String, String>>> hostGroupMappings); void resetProducts(); void resetRepositories(); void addProduct(String product, String version); void addRepositoryItem(String repositoriesItem); void setCmVersion(String cmVersion); void setCdhVersion(String cdhVersion); void setDisplayName(String displayName); void setHostTemplates(List<ApiClusterTemplateHostTemplate> hostTemplates); void setServices(List<ApiClusterTemplateService> services); void addDiagnosticTags(TemplatePreparationObject templatePreparationObject, ClouderaManagerRepo clouderaManagerRepo); void removeDanglingVariableReferences(); boolean isCMComponentExistsInBlueprint(String component); Optional<ApiClusterTemplateConfig> getRoleConfig(String serviceType, String roleType, String configName); }
CmTemplateProcessor implements BlueprintTextProcessor { public boolean isRoleTypePresentInService(String serviceType, List<String> roleTypes) { return getServiceByType(serviceType).filter(acts -> isAnyRoleTypePresent(acts, roleTypes)).isPresent(); } CmTemplateProcessor(@Nonnull String cmTemplateText); @Override ClusterManagerType getClusterManagerType(); @Override BlueprintTextProcessor replaceConfiguration(String s, String descriptor); @Override BlueprintTextProcessor addComponentToHostgroups(String component, Predicate<String> addToHostgroup); @Override boolean isComponentExistsInHostGroup(String component, String hostGroup); @Override BlueprintTextProcessor addComponentToHostgroups(String component, Collection<String> addToHostGroups); @Override Set<String> getHostGroupsWithComponent(String component); @Override String asText(); @Override BlueprintTextProcessor setSecurityType(String kerberos); @Override BlueprintTextProcessor extendBlueprintGlobalConfiguration(SiteConfigurations configs, boolean forced); @Override Set<String> getComponentsInHostGroup(String name); @Override Set<String> getImpalaCoordinatorsInHostGroup(String name); @Override BlueprintTextProcessor extendBlueprintHostGroupConfiguration(HostgroupConfigurations hostgroupConfigurations, boolean b); @Override Map<String, InstanceCount> getCardinalityByHostGroup(); Map<String, Set<ServiceComponent>> getServiceComponentsByHostGroup(); @Override String getHostGroupPropertyIdentifier(); @Override Optional<String> getVersion(); Optional<String> getCmVersion(); @Override Map<String, Set<String>> getNonGatewayComponentsByHostGroup(); @Override Map<String, Set<String>> getComponentsByHostGroup(); @Override GatewayRecommendation recommendGateway(); @Override AutoscaleRecommendation recommendAutoscale(); @Override ResizeRecommendation recommendResize(); @Override String getStackVersion(); @Override List<String> getHostTemplateNames(); Set<ServiceComponent> getAllComponents(); void addInstantiator(ClouderaManagerRepo clouderaManagerRepoDetails, TemplatePreparationObject templatePreparationObject, String sdxContextName); void addVariables(List<ApiClusterTemplateVariable> vars); void extendTemplateWithAdditionalServices(Map<String, ApiClusterTemplateService> hostGroupServices); void addServiceConfigs(String serviceType, List<String> roleTypes, List<ApiClusterTemplateConfig> configs); void mergeServiceConfigs(ApiClusterTemplateService service, List<ApiClusterTemplateConfig> newConfigs); Map<String, ApiClusterTemplateConfig> mapByName(Collection<ApiClusterTemplateConfig> configs); void addRoleConfigs(String serviceType, Map<String, List<ApiClusterTemplateConfig>> newConfigMap); void mergeRoleConfigs(ApiClusterTemplateRoleConfigGroup configGroup, List<ApiClusterTemplateConfig> newConfigs); boolean isRoleTypePresentInService(String serviceType, List<String> roleTypes); Optional<ApiClusterTemplateService> getServiceByType(String serviceType); ApiClusterTemplate getTemplate(); void addHosts(Map<String, List<Map<String, String>>> hostGroupMappings); void resetProducts(); void resetRepositories(); void addProduct(String product, String version); void addRepositoryItem(String repositoriesItem); void setCmVersion(String cmVersion); void setCdhVersion(String cdhVersion); void setDisplayName(String displayName); void setHostTemplates(List<ApiClusterTemplateHostTemplate> hostTemplates); void setServices(List<ApiClusterTemplateService> services); void addDiagnosticTags(TemplatePreparationObject templatePreparationObject, ClouderaManagerRepo clouderaManagerRepo); void removeDanglingVariableReferences(); boolean isCMComponentExistsInBlueprint(String component); Optional<ApiClusterTemplateConfig> getRoleConfig(String serviceType, String roleType, String configName);  }