Search in sources :

Example 31 with HostgroupView

use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.

the class ImpalaVolumeConfigProviderTest method testRoleConfigsWithAttachedVolumesGreaterThanMaxImapalaCacheVolumeSize.

@Test
void testRoleConfigsWithAttachedVolumesGreaterThanMaxImapalaCacheVolumeSize() {
    HostgroupView worker = hostGroupWithVolumeTemplates(3, getVolumeTemplates(1000));
    List<ApiClusterTemplateConfig> roleConfigs = subject.getRoleConfigs(ImpalaRoles.ROLE_IMPALAD, worker, preparatorWithHostGroups(worker));
    assertEquals(List.of(config("scratch_dirs", "/hadoopfs/fs1/impala/scratch,/hadoopfs/fs2/impala/scratch,/hadoopfs/fs3/impala/scratch"), config("datacache_enabled", "true"), config("datacache_capacity", "46170898432"), config("datacache_dirs", "/hadoopfs/fs1/impala/datacache,/hadoopfs/fs2/impala/datacache,/hadoopfs/fs3/impala/datacache")), roleConfigs);
}
Also used : ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) Test(org.junit.jupiter.api.Test)

Example 32 with HostgroupView

use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.

the class ImpalaVolumeConfigProviderTest method testRoleConfigsWithAttachedVolumeCountZero.

@Test
void testRoleConfigsWithAttachedVolumeCountZero() {
    HostgroupView worker = hostGroupWithVolumeTemplates(0, getVolumeTemplates(0));
    List<ApiClusterTemplateConfig> roleConfigs = subject.getRoleConfigs(ImpalaRoles.ROLE_IMPALAD, worker, preparatorWithHostGroups(worker));
    assertEquals(List.of(config("scratch_dirs", "/hadoopfs/root1/impala/scratch")), roleConfigs);
}
Also used : ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) Test(org.junit.jupiter.api.Test)

Example 33 with HostgroupView

use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.

the class ImpalaVolumeConfigProviderTest method testRoleConfigsWithAttachedVolumes200GB.

@Test
void testRoleConfigsWithAttachedVolumes200GB() {
    HostgroupView worker = hostGroupWithVolumeTemplates(3, getVolumeTemplates(200));
    List<ApiClusterTemplateConfig> roleConfigs = subject.getRoleConfigs(ImpalaRoles.ROLE_IMPALAD, worker, preparatorWithHostGroups(worker));
    assertEquals(List.of(config("scratch_dirs", "/hadoopfs/fs1/impala/scratch,/hadoopfs/fs2/impala/scratch,/hadoopfs/fs3/impala/scratch"), config("datacache_enabled", "true"), config("datacache_capacity", "46170898432"), config("datacache_dirs", "/hadoopfs/fs1/impala/datacache,/hadoopfs/fs2/impala/datacache,/hadoopfs/fs3/impala/datacache")), roleConfigs);
}
Also used : ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) Test(org.junit.jupiter.api.Test)

Example 34 with HostgroupView

use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.

the class KafkaConnectDataHubConfigProviderTest method testRoleConfigsReturnedWithValidParameters.

@ParameterizedTest
@MethodSource("validConfigurationParameters")
void testRoleConfigsReturnedWithValidParameters(String cdhVersion, String roleType) {
    cdpMainVersionIs(cdhVersion);
    HostgroupView hostGroup = new HostgroupView("test");
    assertEquals(expectedConfigWithConnectAndCdhAtLeast7214(), provider.getRoleConfigs(roleType, getTemplatePreparationObject(hostGroup)));
}
Also used : HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 35 with HostgroupView

use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.

the class KafkaVolumeConfigProviderTest method getKafkaVolumeConfigWithDatalakeStackType.

@Test
void getKafkaVolumeConfigWithDatalakeStackType() {
    HostgroupView hostgroupView = new HostgroupView("test", 3, InstanceGroupType.CORE, 2);
    assertEquals(List.of(config("log.dirs", "/hadoopfs/fs1/kafka,/hadoopfs/fs2/kafka,/hadoopfs/fs3/kafka")), provider.getRoleConfigs(KAFKA_BROKER, hostgroupView, source(5, 2, StackType.DATALAKE)));
}
Also used : HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) Test(org.junit.jupiter.api.Test)

Aggregations

HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)122 Test (org.junit.jupiter.api.Test)63 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)39 ArrayList (java.util.ArrayList)34 ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)26 ApiClusterTemplateService (com.cloudera.api.swagger.model.ApiClusterTemplateService)25 GeneralClusterConfigs (com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)23 List (java.util.List)23 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)23 CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)19 StorageLocationView (com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView)19 S3FileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView)18 S3FileSystem (com.sequenceiq.common.api.filesystem.S3FileSystem)18 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)16 DisplayName (org.junit.jupiter.api.DisplayName)16 MethodSource (org.junit.jupiter.params.provider.MethodSource)16 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)15 ApiClusterTemplateRoleConfigGroup (com.cloudera.api.swagger.model.ApiClusterTemplateRoleConfigGroup)8 Map (java.util.Map)8 RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)7