Search in sources :

Example 96 with TemplatePreparationObject

use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.

the class HiveLLAPServiceConfigProviderTest method testGetHiveLlapServiceConfigs.

@Test
public void testGetHiveLlapServiceConfigs() {
    TemplatePreparationObject preparationObject = getTemplatePreparationObject(true);
    String inputJson = getBlueprintText("input/clouderamanager-ds.bp");
    CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
    List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject);
    assertEquals(1, serviceConfigs.size());
    assertEquals("hive_hook_proto_base_directory", serviceConfigs.get(0).getName());
    assertEquals("s3a://bucket/hive/warehouse/external/sys.db/query_data", 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.Test)

Example 97 with TemplatePreparationObject

use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.

the class HiveMetastoreCloudStorageServiceConfigProviderTest method testIsConfigurationNeededShouldReturnTrueWhenHMSRoleProvided.

@Test
public void testIsConfigurationNeededShouldReturnTrueWhenHMSRoleProvided() {
    TemplatePreparationObject preparationObject = getTemplatePreparationObject(true);
    String inputJson = getBlueprintText("input/clouderamanager.bp");
    CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
    boolean configNeeded = underTest.isConfigurationNeeded(cmTemplateProcessor, preparationObject);
    assertTrue(configNeeded);
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) Test(org.junit.Test)

Example 98 with TemplatePreparationObject

use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.

the class HiveMetastoreCloudStorageServiceConfigProviderTest method testGetHMSStorageServiceConfigs.

@Test
public void testGetHMSStorageServiceConfigs() {
    TemplatePreparationObject preparationObject = getTemplatePreparationObject(true);
    String inputJson = getBlueprintText("input/clouderamanager.bp");
    CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
    List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject);
    assertEquals(3, serviceConfigs.size());
    assertEquals("hive_warehouse_directory", serviceConfigs.get(0).getName());
    assertEquals("s3a://bucket/hive/warehouse", serviceConfigs.get(0).getValue());
    assertEquals("hive_warehouse_external_directory", serviceConfigs.get(1).getName());
    assertEquals("s3a://bucket/hive/warehouse/external", serviceConfigs.get(1).getValue());
    assertEquals("hive_repl_replica_functions_root_dir", serviceConfigs.get(2).getName());
    assertEquals("s3a://bucket/hive/replica", serviceConfigs.get(2).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.Test)

Example 99 with TemplatePreparationObject

use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.

the class HiveMetastoreConfigProviderTest method getServiceConfigsTestDbOnlyWithSslAndTemplateWithHarmlessHmsServiceConfigsAndCustomHmsDbOverride.

@Test
void getServiceConfigsTestDbOnlyWithSslAndTemplateWithHarmlessHmsServiceConfigsAndCustomHmsDbOverride() {
    TemplatePreparationObject tpo = new TemplatePreparationObject.Builder().withRdsConfigs(Set.of(createRdsConfig(RdsSslMode.ENABLED))).withProductDetails(generateCmRepo(CMRepositoryVersionUtil.CLOUDERAMANAGER_VERSION_7_2_2), null).build();
    initHmsServiceConfigs(List.of(config("foo", "bar"), config(HIVE_METASTORE_DATABASE_HOST, "customhms.mydomain.com")));
    List<ApiClusterTemplateConfig> result = underTest.getServiceConfigs(templateProcessor, tpo);
    verifyDbOnlyMinimalResult(result);
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 100 with TemplatePreparationObject

use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.

the class HiveMetastoreConfigProviderTest method getServiceConfigsTestDatalakeAndNoLdap.

@Test
void getServiceConfigsTestDatalakeAndNoLdap() {
    TemplatePreparationObject tpo = new TemplatePreparationObject.Builder().withRdsConfigs(Set.of(createRdsConfig(null))).withProductDetails(generateCmRepo(CMRepositoryVersionUtil.CLOUDERAMANAGER_VERSION_7_2_2), null).withStackType(StackType.DATALAKE).build();
    List<ApiClusterTemplateConfig> result = underTest.getServiceConfigs(templateProcessor, tpo);
    verifyDbOnlyMinimalResult(result);
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)266 Test (org.junit.Test)133 ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)127 CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)116 Test (org.junit.jupiter.api.Test)87 GeneralClusterConfigs (com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)53 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)48 List (java.util.List)45 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)40 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)38 Builder (com.sequenceiq.cloudbreak.template.TemplatePreparationObject.Builder)36 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)35 ArrayList (java.util.ArrayList)34 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)32 ApiClusterTemplateService (com.cloudera.api.swagger.model.ApiClusterTemplateService)27 MethodSource (org.junit.jupiter.params.provider.MethodSource)23 BaseFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView)20 AccountMappingView (com.sequenceiq.cloudbreak.template.views.AccountMappingView)17 RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)16 DisplayName (org.junit.jupiter.api.DisplayName)16