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);
}
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"));
}
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());
}
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());
}
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());
}
Aggregations