Search in sources :

Example 61 with ApiClusterTemplateConfig

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

the class HiveKnoxConfigProviderTest method config.

private static ApiClusterTemplateConfig config(String name, String value) {
    ApiClusterTemplateConfig cfg = new ApiClusterTemplateConfig();
    cfg.setName(name);
    cfg.setValue(value);
    return cfg;
}
Also used : ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig)

Example 62 with ApiClusterTemplateConfig

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

the class HiveLLAPServiceConfigProviderTest method testGetHiveLlapServiceConfigsWhenNoStorageConfigured.

@Test
public void testGetHiveLlapServiceConfigsWhenNoStorageConfigured() {
    TemplatePreparationObject preparationObject = getTemplatePreparationObject(false);
    String inputJson = getBlueprintText("input/clouderamanager-ds.bp");
    CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
    List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject);
    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.Test)

Example 63 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig 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 64 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig 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 65 with ApiClusterTemplateConfig

use of com.cloudera.api.swagger.model.ApiClusterTemplateConfig 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)

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