Search in sources :

Example 36 with CmTemplateProcessor

use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor 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 37 with CmTemplateProcessor

use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor 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)

Example 38 with CmTemplateProcessor

use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor 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")));
}
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 39 with CmTemplateProcessor

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

the class SqlStreamBuilderSnapperDatabaseConfigProviderTest method testNoConfigNeeded.

@Test
public void testNoConfigNeeded() {
    CmTemplateProcessor cmTemplateProcessor = initTemplateProcessor("7.2.10");
    TemplatePreparationObject preparationObject = initTemplatePreparationObject(cmTemplateProcessor);
    assertFalse(underTest.isConfigurationNeeded(cmTemplateProcessor, preparationObject));
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) Test(org.junit.Test)

Example 40 with CmTemplateProcessor

use of com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor 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());
}
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)

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