use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class NifiVolumeConfigProviderTest method testRoleConfigsWithFourVolumes.
@Test
void testRoleConfigsWithFourVolumes() {
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")), subject.getRoleConfigs(NifiRoles.NIFI_NODE, hostGroup, getTemplatePreparationObject(hostGroup)));
}
use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class NifiVolumeConfigProviderTest method testRoleConfigsWithFourVolumesAndStackVersion7211.
@Test
void testRoleConfigsWithFourVolumesAndStackVersion7211() {
when(cmTemplateProcessorMock.getStackVersion()).thenReturn("7.2.11");
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)));
}
use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class CmHostGroupRoleConfigProviderProcessorTest method clonesBaseRoleConfigForHostGroups.
@Test
public void clonesBaseRoleConfigForHostGroups() {
HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.GATEWAY, 1);
HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, 2);
HostgroupView compute = new HostgroupView("compute", 3, InstanceGroupType.CORE, 2);
setup("input/clouderamanager-3hg-same-DN-role.bp", Builder.builder().withHostgroupViews(Set.of(master, worker, compute)));
underTest.process(templateProcessor, templatePreparator);
Map<String, List<ApiClusterTemplateConfig>> roleConfigs = mapRoleConfigs();
assertNull(roleConfigs.get("hdfs-DATANODE-BASE"));
assertEquals(List.of(config("dfs_data_dir_list", "/hadoopfs/fs1/datanode,/hadoopfs/fs2/datanode")), roleConfigs.get("hdfs-DATANODE-worker"));
assertEquals(List.of(config("dfs_data_dir_list", "/hadoopfs/fs1/datanode,/hadoopfs/fs2/datanode,/hadoopfs/fs3/datanode")), roleConfigs.get("hdfs-DATANODE-compute"));
}
use of com.sequenceiq.cloudbreak.template.views.HostgroupView 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.sequenceiq.cloudbreak.template.views.HostgroupView 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());
}
Aggregations