Search in sources :

Example 91 with CmTemplateProcessor

use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.

the class SchemaRegistryServiceConfigProviderTest method testGetSchemaRegistryRoleConfigs720.

@Test
public void testGetSchemaRegistryRoleConfigs720() {
    String inputJson = loadBlueprint("7.2.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(RANGER_PLUGIN_SR_SERVICE_NAME, GENERATED_RANGER_SERVICE_NAME)));
}
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 92 with CmTemplateProcessor

use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.

the class SchemaRegistryServiceConfigProviderTest method testGetSchemaRegistryServiceConfigs710.

@Test
public void testGetSchemaRegistryServiceConfigs710() {
    String inputJson = loadBlueprint("7.1.0");
    CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
    TemplatePreparationObject preparationObject = getTemplatePreparationObject(cmTemplateProcessor);
    List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject);
    assertThat(serviceConfigs).isEmpty();
}
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 93 with CmTemplateProcessor

use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.

the class Spark3OnYarnRoleConfigProviderTest method testGetSpark3OnYarnRoleConfigsWhenNoStorageConfigured.

@Test
public void testGetSpark3OnYarnRoleConfigsWhenNoStorageConfigured() {
    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> sparkOnYarnConfigs = roleConfigs.get("spark3_on_yarn-GATEWAY-BASE");
    assertEquals(0, sparkOnYarnConfigs.size());
}
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) Test(org.junit.Test)

Example 94 with CmTemplateProcessor

use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.

the class SparkOnYarnRoleConfigProviderTest method testGetSparkOnYarnRoleConfigsWhenNoStorageConfigured.

@Test
public void testGetSparkOnYarnRoleConfigsWhenNoStorageConfigured() {
    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> sparkOnYarnConfigs = roleConfigs.get("spark_on_yarn-GATEWAY-BASE");
    assertEquals(0, sparkOnYarnConfigs.size());
}
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) Test(org.junit.Test)

Example 95 with CmTemplateProcessor

use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor in project cloudbreak by hortonworks.

the class SparkOnYarnRoleConfigProviderTest 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("spark_on_yarn-GATEWAY-BASE");
    assertEquals(1, sparkOnYarnConfigs.size());
    assertEquals("spark-conf/spark-defaults.conf_client_config_safety_valve", sparkOnYarnConfigs.get(0).getName());
    assertEquals("spark.yarn.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)

Aggregations

CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)149 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)115 Test (org.junit.Test)84 ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)75 List (java.util.List)46 ArrayList (java.util.ArrayList)33 Test (org.junit.jupiter.api.Test)19 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)18 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)15 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)13 HashSet (java.util.HashSet)12 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)10 Builder (com.sequenceiq.cloudbreak.template.TemplatePreparationObject.Builder)10 Set (java.util.Set)10 ApiClusterTemplateService (com.cloudera.api.swagger.model.ApiClusterTemplateService)9 RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)8 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)8 Map (java.util.Map)8 BaseFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView)7 Collectors (java.util.stream.Collectors)7