Search in sources :

Example 41 with HostgroupView

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

the class YarnVolumeConfigProviderTest method getRoleConfigsWithMultipleEphemeralVolumes.

@Test
void getRoleConfigsWithMultipleEphemeralVolumes() {
    HostgroupView worker = hostGroupWithVolumeTemplatesAndTemporaryStorage(2, Sets.newHashSet(new VolumeTemplate()), TemporaryStorage.EPHEMERAL_VOLUMES, 3);
    List<ApiClusterTemplateConfig> roleConfigs = subject.getRoleConfigs(YarnRoles.NODEMANAGER, worker, preparatorWithHostGroups(worker));
    assertEquals(List.of(config("yarn_nodemanager_local_dirs", "/hadoopfs/ephfs1/nodemanager,/hadoopfs/ephfs2/nodemanager,/hadoopfs/ephfs3/nodemanager"), config("yarn_nodemanager_log_dirs", "/hadoopfs/ephfs1/nodemanager/log,/hadoopfs/ephfs2/nodemanager/log," + "/hadoopfs/ephfs3/nodemanager/log")), roleConfigs);
}
Also used : VolumeTemplate(com.sequenceiq.cloudbreak.domain.VolumeTemplate) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) Test(org.junit.jupiter.api.Test)

Example 42 with HostgroupView

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

the class NifiVolumeConfigProviderTest method testRoleConfigsWithThreeVolumesAndStackVersion7210.

@Test
void testRoleConfigsWithThreeVolumesAndStackVersion7210() {
    when(cmTemplateProcessorMock.getStackVersion()).thenReturn("7.2.10");
    HostgroupView hostGroup = hostGroupWithVolumeCount(3);
    assertEquals(List.of(config("nifi.flowfile.repository.directory", "/hadoopfs/fs1/flowfile-repo"), config("nifi.content.repository.directory.default", "/hadoopfs/fs3/content-repo"), config("nifi.provenance.repository.directory.default", "/hadoopfs/fs2/provenance-repo"), config("log_dir", "/hadoopfs/fs3/nifi-log"), config("nifi.database.directory", "/hadoopfs/fs1/database-dir"), config("nifi.working.directory", "/hadoopfs/fs3/working-dir")), subject.getRoleConfigs(NifiRoles.NIFI_NODE, hostGroup, getTemplatePreparationObject(hostGroup)));
}
Also used : HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) Test(org.junit.jupiter.api.Test)

Example 43 with HostgroupView

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

the class NifiVolumeConfigProviderTest method testRoleConfigsWithTwoVolumesAndStackVersion7210.

@Test
void testRoleConfigsWithTwoVolumesAndStackVersion7210() {
    when(cmTemplateProcessorMock.getStackVersion()).thenReturn("7.2.10");
    HostgroupView hostGroup = hostGroupWithVolumeCount(2);
    assertEquals(List.of(config("nifi.flowfile.repository.directory", "/hadoopfs/fs1/flowfile-repo"), config("nifi.content.repository.directory.default", "/hadoopfs/fs2/content-repo"), config("nifi.provenance.repository.directory.default", "/hadoopfs/fs1/provenance-repo"), config("log_dir", "/hadoopfs/fs2/nifi-log"), config("nifi.database.directory", "/hadoopfs/fs1/database-dir"), config("nifi.working.directory", "/hadoopfs/fs2/working-dir")), subject.getRoleConfigs(NifiRoles.NIFI_NODE, hostGroup, getTemplatePreparationObject(hostGroup)));
}
Also used : HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) Test(org.junit.jupiter.api.Test)

Example 44 with HostgroupView

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

the class NifiVolumeConfigProviderTest method testRoleConfigsWithThreeVolumes.

@Test
void testRoleConfigsWithThreeVolumes() {
    HostgroupView hostGroup = hostGroupWithVolumeCount(3);
    assertEquals(List.of(config("nifi.flowfile.repository.directory", "/hadoopfs/fs1/flowfile-repo"), config("nifi.content.repository.directory.default", "/hadoopfs/fs3/content-repo"), config("nifi.provenance.repository.directory.default", "/hadoopfs/fs2/provenance-repo"), config("log_dir", "/hadoopfs/fs3/nifi-log"), config("nifi.database.directory", "/hadoopfs/fs1/database-dir")), subject.getRoleConfigs(NifiRoles.NIFI_NODE, hostGroup, getTemplatePreparationObject(hostGroup)));
}
Also used : HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) Test(org.junit.jupiter.api.Test)

Example 45 with HostgroupView

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

the class NifiVolumeConfigProviderTest method testRoleConfigsWithFourVolumesAndStackVersion7210.

@Test
void testRoleConfigsWithFourVolumesAndStackVersion7210() {
    when(cmTemplateProcessorMock.getStackVersion()).thenReturn("7.2.10");
    HostgroupView hostGroup = hostGroupWithVolumeCount(4);
    assertEquals(List.of(config("nifi.flowfile.repository.directory", "/hadoopfs/fs1/flowfile-repo"), config("nifi.content.repository.directory.default", "/hadoopfs/fs2/content-repo"), config("nifi.provenance.repository.directory.default", "/hadoopfs/fs3/provenance-repo"), config("log_dir", "/hadoopfs/fs4/nifi-log"), config("nifi.database.directory", "/hadoopfs/fs4/database-dir"), config("nifi.working.directory", "/hadoopfs/fs4/working-dir")), subject.getRoleConfigs(NifiRoles.NIFI_NODE, hostGroup, getTemplatePreparationObject(hostGroup)));
}
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