use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo in project cloudbreak by hortonworks.
the class DefaultClouderaManagerRepoServiceTest method testDefaultRepoWithCDHWhichExists.
@Test
public void testDefaultRepoWithCDHWhichExists() throws Exception {
ClouderaManagerRepo repo = defaultClouderaManagerRepoService.getDefault("redhat7", CDH, "6.1.0", null);
assertEquals("6.1.0", repo.getVersion());
assertEquals("http://redhat7-base/6.1.0", repo.getBaseUrl());
assertEquals("http://redhat7-gpg/6.1.0", repo.getGpgKeyUrl());
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo in project cloudbreak by hortonworks.
the class DefaultClouderaManagerRepoServiceTest method testDefaultRepoWithStackTypeWhichDoesNotExists.
@Test
public void testDefaultRepoWithStackTypeWhichDoesNotExists() throws Exception {
ClouderaManagerRepo repo = defaultClouderaManagerRepoService.getDefault("redhat7", "NA", "6.1.0", null);
assertNull(repo);
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo in project cloudbreak by hortonworks.
the class DefaultClouderaManagerRepoServiceTest method testDefaultRepoWithCDHWhichDoesNotExists.
@Test
public void testDefaultRepoWithCDHWhichDoesNotExists() throws Exception {
ClouderaManagerRepo repo = defaultClouderaManagerRepoService.getDefault("redhat7", CDH, "2.6", null);
assertNull(repo);
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo in project cloudbreak by hortonworks.
the class CmTemplateProcessorTest method testAddInstantiatorWithBaseRoles.
@Test
public void testAddInstantiatorWithBaseRoles() {
underTest = new CmTemplateProcessor(getBlueprintText("input/clouderamanager.bp"));
ClouderaManagerRepo clouderaManagerRepoDetails = new ClouderaManagerRepo();
clouderaManagerRepoDetails.setVersion(CMRepositoryVersionUtil.CLOUDERAMANAGER_VERSION_6_3_0.getVersion());
GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
generalClusterConfigs.setClusterName("cluster");
TemplatePreparationObject.Builder tpoBuilder = new TemplatePreparationObject.Builder().withGeneralClusterConfigs(generalClusterConfigs);
TemplatePreparationObject templatePreparationObject = tpoBuilder.build();
underTest.addInstantiator(clouderaManagerRepoDetails, templatePreparationObject, "dszabo-sdx");
ApiClusterTemplateInstantiator instantiator = underTest.getTemplate().getInstantiator();
List<ApiClusterTemplateRoleConfigGroupInfo> roleConfigGroups = instantiator.getRoleConfigGroups();
List<String> refNames = roleConfigGroups.stream().map(ApiClusterTemplateRoleConfigGroupInfo::getRcgRefName).collect(Collectors.toList());
assertEquals(2, refNames.size());
assertTrue(refNames.containsAll(List.of("yarn-NODEMANAGER-BASE", "hdfs-DATANODE-BASE")));
assertEquals("cluster", instantiator.getClusterName());
}
use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo in project cloudbreak by hortonworks.
the class CmTemplateProcessor method addInstantiator.
public void addInstantiator(ClouderaManagerRepo clouderaManagerRepoDetails, TemplatePreparationObject templatePreparationObject, String sdxContextName) {
ApiClusterTemplateInstantiator instantiator = ofNullable(cmTemplate.getInstantiator()).orElseGet(ApiClusterTemplateInstantiator::new);
if (instantiator.getClusterName() == null) {
instantiator.setClusterName(templatePreparationObject.getGeneralClusterConfigs().getClusterName());
}
addCmVersionDependantConfigs(clouderaManagerRepoDetails, templatePreparationObject, instantiator);
for (ApiClusterTemplateService service : ofNullable(cmTemplate.getServices()).orElse(List.of())) {
List<String> nonBaseRefs = ofNullable(service.getRoleConfigGroups()).orElse(List.of()).stream().filter(rcg -> rcg.getBase() == null || !rcg.getBase()).map(ApiClusterTemplateRoleConfigGroup::getRefName).collect(Collectors.toList());
for (String nonBaseRef : nonBaseRefs) {
instantiator.addRoleConfigGroupsItem(new ApiClusterTemplateRoleConfigGroupInfo().rcgRefName(nonBaseRef));
}
}
ofNullable(sdxContextName).map(name -> List.of(new ApiDataContextRef().name(name))).map(apiDataContextRefs -> new ApiClusterTemplateClusterSpec().dataContextRefs(apiDataContextRefs)).ifPresent(instantiator::clusterSpec);
cmTemplate.setInstantiator(instantiator);
}
Aggregations