use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.
the class SqlStreamBuilderAdminDatabaseConfigProviderTest method testProperDbConfig.
@Test
public void testProperDbConfig() {
CmTemplateProcessor cmTemplateProcessor = initTemplateProcessor("7.2.11");
TemplatePreparationObject preparationObject = initTemplatePreparationObject(cmTemplateProcessor);
List<ApiClusterTemplateConfig> roleConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject);
assertThat(roleConfigs).hasSameElementsAs(List.of(config("database_type", "postgresql"), config("database_host", "testhost"), config("database_port", "5432"), config("database_schema", "eventador_admin"), config("database_user", "ssb_test_user"), config("database_password", "ssb_test_pw")));
}
use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.
the class TezRoleConfigProviderTest method testGetTezClientRoleConfigsWhenNoStorageConfigured.
@Test
public void testGetTezClientRoleConfigsWhenNoStorageConfigured() {
TemplatePreparationObject preparationObject = getTemplatePreparationObject();
String inputJson = getBlueprintText("input/clouderamanager-ds.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
Map<String, List<ApiClusterTemplateConfig>> roleConfigs = underTest.getRoleConfigs(cmTemplateProcessor, preparationObject);
List<ApiClusterTemplateConfig> tezConfigs = roleConfigs.get("tez-GATEWAY-BASE");
assertEquals(0, tezConfigs.size());
}
use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.
the class YarnResourceManagerRoleConfigProviderTest method testGetConfigsWhenRoleIsResourceManagerPlacementVersionPasses.
@Test
public void testGetConfigsWhenRoleIsResourceManagerPlacementVersionPasses() {
setupMocks(true, true, "7.2.11");
List<ApiClusterTemplateConfig> serviceConfigs = underTest.getRoleConfigs(YarnRoles.RESOURCEMANAGER, source);
assertEquals(3, serviceConfigs.size());
assertTrue(serviceConfigs.stream().anyMatch(sc -> StringUtils.equals(sc.getName(), "resourcemanager_capacity_scheduler_configuration")));
assertTrue(serviceConfigs.stream().anyMatch(sc -> StringUtils.equals(sc.getName(), "yarn_resourcemanager_scheduler_class")));
assertTrue(serviceConfigs.stream().anyMatch(sc -> StringUtils.equals(sc.getName(), "resourcemanager_config_safety_valve")));
// Note: This is explicitly not referring to the constants. If the constants change, make sure to rationalize
// changes with the YARN script which processes these.
ApiClusterTemplateConfig rmSafetyValve = serviceConfigs.stream().filter(sc -> StringUtils.equals(sc.getName(), "resourcemanager_config_safety_valve")).findFirst().get();
assertEquals("<property>" + "<name>yarn.resourcemanager.am.placement-preference-with-node-attributes</name>" + "<value>ORDER NODES IN NodeInstanceType WITH worker > compute</value></property><property>" + "<name>yarn.resourcemanager.non-am.placement-preference-with-node-attributes</name>" + "<value>ORDER NODES IN NodeInstanceType WITH compute > worker</value></property>", rmSafetyValve.getValue());
}
use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.
the class YarnVolumeConfigProviderTest method getRoleConfigsWithoutVolumes.
@Test
void getRoleConfigsWithoutVolumes() {
HostgroupView worker = hostGroupWithVolumeCount(0);
List<ApiClusterTemplateConfig> roleConfigs = subject.getRoleConfigs(YarnRoles.NODEMANAGER, worker, preparatorWithHostGroups(worker));
assertEquals(List.of(config("yarn_nodemanager_local_dirs", "/hadoopfs/root1/nodemanager"), config("yarn_nodemanager_log_dirs", "/hadoopfs/root1/nodemanager/log")), roleConfigs);
}
use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.
the class YarnVolumeConfigProviderTest method getRoleConfigsWithMultipleAttachedVolumes.
@Test
void getRoleConfigsWithMultipleAttachedVolumes() {
HostgroupView worker = hostGroupWithVolumeTemplatesAndTemporaryStorage(2, Sets.newHashSet(new VolumeTemplate()), TemporaryStorage.ATTACHED_VOLUMES, 0);
List<ApiClusterTemplateConfig> roleConfigs = subject.getRoleConfigs(YarnRoles.NODEMANAGER, worker, preparatorWithHostGroups(worker));
assertEquals(List.of(config("yarn_nodemanager_local_dirs", "/hadoopfs/fs1/nodemanager,/hadoopfs/fs2/nodemanager"), config("yarn_nodemanager_log_dirs", "/hadoopfs/fs1/nodemanager/log,/hadoopfs/fs2/nodemanager/log")), roleConfigs);
}
Aggregations