Search in sources :

Example 31 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.

the class SchemaRegistryServiceConfigProviderTest method testGetSchemaRegistryRoleConfigs710.

@Test
public void testGetSchemaRegistryRoleConfigs710() {
    String inputJson = loadBlueprint("7.1.0");
    CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
    TemplatePreparationObject preparationObject = getTemplatePreparationObject(cmTemplateProcessor);
    List<ApiClusterTemplateConfig> roleConfigs = underTest.getRoleConfigs(SchemaRegistryRoles.SCHEMA_REGISTRY_SERVER, preparationObject);
    assertThat(roleConfigs).hasSameElementsAs(List.of(config("schema.registry.storage.connector.connectURI", "jdbc:postgresql://testhost:5432/schema_registry"), config("schema.registry.storage.connector.user", "schema_registry_server"), config("schema.registry.storage.connector.password", "schema_registry_server_password")));
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.Test)

Example 32 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.

the class StreamsMessagingManagerServiceConfigProviderTest method testGetStreamsMessagingManagerServerConfigs.

@Test
public void testGetStreamsMessagingManagerServerConfigs() {
    String inputJson = getBlueprintText("input/cdp-streaming.bp").replace("__CDH_VERSION__", "7.2.0");
    CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
    TemplatePreparationObject preparationObject = getTemplatePreparationObject(null, false, cmTemplateProcessor);
    List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject);
    assertThat(serviceConfigs).hasSameElementsAs(List.of(config(DATABASE_TYPE, "postgresql"), config(DATABASE_NAME, "smm"), config(DATABASE_HOST, "testhost"), config(DATABASE_PORT, "5432"), config(DATABASE_USER, "smm_server"), config(DATABASE_PASSWORD, "smm_server_db_password")));
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.Test)

Example 33 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.

the class Spark3OnYarnRoleConfigProviderTest method validateClientConfig.

protected void validateClientConfig(String hmsExternalDirLocation, String clientConfigDirLocation) {
    TemplatePreparationObject preparationObject = getTemplatePreparationObject(hmsExternalDirLocation);
    String inputJson = getBlueprintText("input/clouderamanager-ds.bp");
    CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
    Map<String, List<ApiClusterTemplateConfig>> roleConfigs = underTest.getRoleConfigs(cmTemplateProcessor, preparationObject);
    List<ApiClusterTemplateConfig> sparkOnYarnConfigs = roleConfigs.get("spark3_on_yarn-GATEWAY-BASE");
    assertEquals(1, sparkOnYarnConfigs.size());
    assertEquals("spark3-conf/spark-defaults.conf_client_config_safety_valve", sparkOnYarnConfigs.get(0).getName());
    assertEquals("spark.kerberos.access.hadoopFileSystems=" + clientConfigDirLocation, sparkOnYarnConfigs.get(0).getValue());
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) ArrayList(java.util.ArrayList) List(java.util.List) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig)

Example 34 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.

the class ImpalaCloudStorageServiceConfigProviderTest method testImpalaCloudStorageServiceConfigs.

@Test
public void testImpalaCloudStorageServiceConfigs() {
    CmTemplateProcessor templateProcessor = new CmTemplateProcessor(getBlueprintText("input/clouderamanager-host-with-uppercase.bp"));
    TemplatePreparationObject templatePreparationObject = getTemplatePreparationObject(true);
    List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(templateProcessor, templatePreparationObject);
    assertEquals(1, serviceConfigs.size());
    assertEquals("impala_cmd_args_safety_valve", serviceConfigs.get(0).getName());
    assertEquals("--startup_filesystem_check_directories=" + "s3a://bucket/warehouse/tablespace/managed/hive," + "s3a://bucket/warehouse/tablespace/external/hive", serviceConfigs.get(0).getValue());
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.jupiter.api.Test)

Example 35 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig in project cloudbreak by hortonworks.

the class ImpalaCloudStorageServiceConfigProviderTest method testImpalaCloudStorageServiceConfigsWithLowerCdhVersion.

@Test
public void testImpalaCloudStorageServiceConfigsWithLowerCdhVersion() {
    CmTemplateProcessor templateProcessor = new CmTemplateProcessor(getBlueprintText("input/cdp-data-mart.bp"));
    TemplatePreparationObject templatePreparationObject = getTemplatePreparationObject(true);
    List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(templateProcessor, templatePreparationObject);
    assertEquals(0, serviceConfigs.size());
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.jupiter.api.Test)

Aggregations

ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)172 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)129 Test (org.junit.Test)78 CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)74 Test (org.junit.jupiter.api.Test)57 ArrayList (java.util.ArrayList)55 List (java.util.List)50 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)25 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)22 Builder (com.sequenceiq.cloudbreak.template.TemplatePreparationObject.Builder)21 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)18 GeneralClusterConfigs (com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)17 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)17 ApiClusterTemplateService (com.cloudera.api.swagger.model.ApiClusterTemplateService)13 AccountMappingView (com.sequenceiq.cloudbreak.template.views.AccountMappingView)13 ApiClusterTemplateRoleConfigGroup (com.cloudera.api.swagger.model.ApiClusterTemplateRoleConfigGroup)12 HashMap (java.util.HashMap)12 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)11 BaseFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView)9 BlueprintTextProcessor (com.sequenceiq.cloudbreak.template.processor.BlueprintTextProcessor)8