Search in sources :

Example 46 with ApiClusterTemplateConfig

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

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

the class CmHostGroupRoleConfigProviderProcessorTest method testGenerateConfigsWhenHdfsJournalNodeNull.

@Test
public void testGenerateConfigsWhenHdfsJournalNodeNull() {
    HostgroupView master1 = new HostgroupView("master1", 1, InstanceGroupType.GATEWAY, 1);
    HostgroupView master2 = new HostgroupView("master2", 1, InstanceGroupType.GATEWAY, 1);
    HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, 2);
    HostgroupView compute = new HostgroupView("compute", 3, InstanceGroupType.CORE, 2);
    HostgroupView quorum = new HostgroupView("quorum", 3, InstanceGroupType.CORE, 2);
    setup("input/cb5660.bp", Builder.builder().withHostgroupViews(Set.of(master1, master2, worker, compute, quorum)));
    Map<String, Map<String, List<ApiClusterTemplateConfig>>> actual = underTest.generateConfigs(templateProcessor, templatePreparator);
    assertNotNull(actual.get("hdfs-JOURNALNODE-BASE"));
    assertNotNull(actual.get("zookeeper-SERVER-BASE"));
}
Also used : ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) Map(java.util.Map) Test(org.junit.jupiter.api.Test)

Example 48 with ApiClusterTemplateConfig

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

the class CmHostGroupRoleConfigProviderProcessorTest method testProcessWhenSharedConfigThenAddVolumeConfig.

@Test
public void testProcessWhenSharedConfigThenAddVolumeConfig() {
    HostgroupView master1 = new HostgroupView("master1", 1, InstanceGroupType.GATEWAY, 1);
    HostgroupView master2 = new HostgroupView("master2", 1, InstanceGroupType.GATEWAY, 1);
    HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, 2);
    HostgroupView compute = new HostgroupView("compute", 3, InstanceGroupType.CORE, 2);
    HostgroupView quorum = new HostgroupView("quorum", 3, InstanceGroupType.CORE, 2);
    setup("input/cb5660.bp", Builder.builder().withHostgroupViews(Set.of(master1, master2, worker, compute, quorum)));
    underTest.process(templateProcessor, templatePreparator);
    Map<String, List<ApiClusterTemplateConfig>> roleConfigs = mapRoleConfigs();
    List<ApiClusterTemplateConfig> journalNodeBase = roleConfigs.get("hdfs-JOURNALNODE-BASE");
    assertEquals(1, journalNodeBase.size());
    assertEquals("dfs_journalnode_edits_dir", journalNodeBase.get(0).getName());
    assertEquals("/hadoopfs/fs1/journalnode", journalNodeBase.get(0).getValue());
    List<ApiClusterTemplateConfig> zkServerBase = roleConfigs.get("zookeeper-SERVER-BASE");
    assertEquals("dataDir", zkServerBase.get(0).getName());
    assertEquals("/hadoopfs/fs1/zookeeper", zkServerBase.get(0).getValue());
    assertEquals("dataLogDir", zkServerBase.get(1).getName());
    assertEquals("/hadoopfs/fs1/zookeeper", zkServerBase.get(1).getValue());
}
Also used : ArrayList(java.util.ArrayList) List(java.util.List) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) Test(org.junit.jupiter.api.Test)

Example 49 with ApiClusterTemplateConfig

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

the class CmHostGroupRoleConfigProviderProcessorTest method testGetRoleConfigsWithAllHostGroupZeroAttachedVolumes.

@Test
public void testGetRoleConfigsWithAllHostGroupZeroAttachedVolumes() {
    HostgroupView master = new HostgroupView("master", 0, InstanceGroupType.GATEWAY, 1);
    HostgroupView worker = new HostgroupView("worker", 0, InstanceGroupType.CORE, 2);
    setup("input/clouderamanager.bp", Builder.builder().withHostgroupViews(Set.of(master, worker)));
    underTest.process(templateProcessor, templatePreparator);
    Map<String, List<ApiClusterTemplateConfig>> roleConfigs = mapRoleConfigs();
    List<ApiClusterTemplateConfig> masterNN = roleConfigs.get("hdfs-NAMENODE-BASE");
    List<ApiClusterTemplateConfig> masterSN = roleConfigs.get("hdfs-SECONDARYNAMENODE-BASE");
    List<ApiClusterTemplateConfig> workerDN = roleConfigs.get("hdfs-DATANODE-BASE");
    List<ApiClusterTemplateConfig> workerNM = roleConfigs.get("yarn-NODEMANAGER-BASE");
    assertEquals(1, masterNN.size());
    assertEquals(1, masterSN.size());
    assertEquals(1, workerDN.size());
    assertEquals("dfs_name_dir_list", masterNN.get(0).getName());
    assertEquals("/hadoopfs/root1/namenode", masterNN.get(0).getValue());
    assertEquals("fs_checkpoint_dir_list", masterSN.get(0).getName());
    assertEquals("/hadoopfs/root1/namesecondary", masterSN.get(0).getValue());
    assertEquals("dfs_data_dir_list", workerDN.get(0).getName());
    assertEquals("/hadoopfs/root1/datanode", workerDN.get(0).getValue());
    assertEquals("yarn_nodemanager_local_dirs", workerNM.get(0).getName());
    assertEquals("/hadoopfs/root1/nodemanager", workerNM.get(0).getValue());
    assertEquals("yarn_nodemanager_log_dirs", workerNM.get(1).getName());
    assertEquals("/hadoopfs/root1/nodemanager/log", workerNM.get(1).getValue());
}
Also used : ArrayList(java.util.ArrayList) List(java.util.List) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) Test(org.junit.jupiter.api.Test)

Example 50 with ApiClusterTemplateConfig

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

the class CmHostGroupRoleConfigProviderProcessorTest method testGetRoleConfigsWithDifferentDataNodeRoleForMultipleGroupsNoComputeDisks.

@Test
public void testGetRoleConfigsWithDifferentDataNodeRoleForMultipleGroupsNoComputeDisks() {
    HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.GATEWAY, 1);
    HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, 2);
    HostgroupView compute = new HostgroupView("compute", 0, InstanceGroupType.CORE, 2);
    setup("input/clouderamanager-3hg-different-DN-role.bp", Builder.builder().withHostgroupViews(Set.of(master, worker, compute)));
    underTest.process(templateProcessor, templatePreparator);
    Map<String, List<ApiClusterTemplateConfig>> roleConfigs = mapRoleConfigs();
    List<ApiClusterTemplateConfig> masterNN = roleConfigs.get("hdfs-NAMENODE-BASE");
    List<ApiClusterTemplateConfig> workerDN = roleConfigs.get("hdfs-DATANODE-BASE");
    List<ApiClusterTemplateConfig> computeDN = roleConfigs.get("hdfs-DATANODE-compute");
    assertEquals(1, workerDN.size());
    assertEquals("dfs_data_dir_list", workerDN.get(0).getName());
    assertEquals("/hadoopfs/fs1/datanode,/hadoopfs/fs2/datanode", workerDN.get(0).getValue());
    assertEquals(1, masterNN.size());
    assertEquals("dfs_name_dir_list", masterNN.get(0).getName());
    assertEquals(1, computeDN.size());
    assertEquals("dfs_data_dir_list", computeDN.get(0).getName());
    assertEquals("/hadoopfs/root1/datanode", computeDN.get(0).getValue());
}
Also used : ArrayList(java.util.ArrayList) List(java.util.List) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) Test(org.junit.jupiter.api.Test)

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