use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class CmHostGroupRoleConfigProviderProcessorTest method testGetRoleConfigsWithSingleRolesPerHostGroup.
@Test
public void testGetRoleConfigsWithSingleRolesPerHostGroup() {
HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.GATEWAY, 1);
HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, 2);
setup("input/clouderamanager.bp", Builder.builder().withHostgroupViews(Set.of(master, worker)));
underTest.process(templateProcessor, templatePreparator);
Map<String, List<ApiClusterTemplateConfig>> roleConfigs = mapRoleConfigs();
assertEquals(List.of(config("dfs_data_dir_list", "/hadoopfs/fs1/datanode,/hadoopfs/fs2/datanode")), roleConfigs.get("hdfs-DATANODE-BASE"));
assertEquals(List.of(config("dfs_name_dir_list", "/hadoopfs/fs1/namenode")), roleConfigs.get("hdfs-NAMENODE-BASE"));
assertEquals(List.of(config("fs_checkpoint_dir_list", "/hadoopfs/fs1/namesecondary")), roleConfigs.get("hdfs-SECONDARYNAMENODE-BASE"));
assertEquals(List.of(config("yarn_nodemanager_local_dirs", "/hadoopfs/fs1/nodemanager,/hadoopfs/fs2/nodemanager"), config("yarn_nodemanager_log_dirs", "/hadoopfs/fs1/nodemanager/log,/hadoopfs/fs2/nodemanager/log")), roleConfigs.get("yarn-NODEMANAGER-BASE"));
}
use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class HbaseVolumeConfigProviderTest method getRoleConfigsWithMultipleEphemeralVolumes.
@Test
void getRoleConfigsWithMultipleEphemeralVolumes() {
HostgroupView worker = hostGroupWithVolumeTemplatesAndTemporaryStorage(2, Sets.newHashSet(new VolumeTemplate()), TemporaryStorage.EPHEMERAL_VOLUMES, 3);
List<ApiClusterTemplateConfig> roleConfigs = underTest.getRoleConfigs(HbaseRoles.REGIONSERVER, worker, preparatorWithHostGroups(worker));
assertEquals(List.of(config("hbase_bucketcache_ioengine", "file:/hadoopfs/ephfs1/hbase_cache")), roleConfigs);
}
use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class HdfsRoleConfigProviderTest method nameNodeHA.
@Test
void nameNodeHA() {
HostgroupView gateway = new HostgroupView("gateway", 1, InstanceGroupType.GATEWAY, 1);
HostgroupView master = new HostgroupView("master", 0, InstanceGroupType.CORE, 2);
HostgroupView quorum = new HostgroupView("quorum", 0, InstanceGroupType.CORE, 3);
HostgroupView worker = new HostgroupView("worker", 0, InstanceGroupType.CORE, 3);
String inputJson = FileReaderUtils.readFileFromClasspathQuietly("input/namenode-ha.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
TemplatePreparationObject preparationObject = TemplatePreparationObject.Builder.builder().withHostgroupViews(Set.of(gateway, master, quorum, worker)).withBlueprintView(new BlueprintView(inputJson, "CDP", "1.0", cmTemplateProcessor)).build();
Map<String, List<ApiClusterTemplateConfig>> roleConfigs = subject.getRoleConfigs(cmTemplateProcessor, preparationObject);
List<ApiClusterTemplateConfig> namenodeConfigs = roleConfigs.get("hdfs-NAMENODE-BASE");
Map<String, ApiClusterTemplateConfig> configMap = cmTemplateProcessor.mapByName(namenodeConfigs);
assertEquals(NN_HA_PROPERTIES, configMap.keySet());
assertEquals("true", configMap.get("autofailover_enabled").getValue());
}
use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class HdfsVolumeConfigProviderTest method getRoleConfigsWithoutVolumes.
@Test
void getRoleConfigsWithoutVolumes() {
HostgroupView hostGroup = hostGroupWithVolumeCount(0);
assertEquals(List.of(config("dfs_data_dir_list", "/hadoopfs/root1/datanode")), subject.getRoleConfigs(HdfsRoles.DATANODE, hostGroup, preparatorWithHostGroups(hostGroup)));
assertEquals(List.of(config("dfs_name_dir_list", "/hadoopfs/root1/namenode")), subject.getRoleConfigs(HdfsRoles.NAMENODE, hostGroup, preparatorWithHostGroups(hostGroup)));
assertEquals(List.of(config("fs_checkpoint_dir_list", "/hadoopfs/root1/namesecondary")), subject.getRoleConfigs(HdfsRoles.SECONDARYNAMENODE, hostGroup, preparatorWithHostGroups(hostGroup)));
assertEquals(List.of(config("dfs_journalnode_edits_dir", "/hadoopfs/root1/journalnode")), subject.getRoleConfigs(HdfsRoles.JOURNALNODE, hostGroup, preparatorWithHostGroups(hostGroup)));
}
use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class HdfsVolumeConfigProviderTest method getRoleConfigsWithSingleVolume.
@Test
void getRoleConfigsWithSingleVolume() {
HostgroupView hostGroup = hostGroupWithVolumeCount(1);
assertEquals(List.of(config("dfs_data_dir_list", "/hadoopfs/fs1/datanode")), subject.getRoleConfigs(HdfsRoles.DATANODE, hostGroup, preparatorWithHostGroups(hostGroup)));
assertEquals(List.of(config("dfs_name_dir_list", "/hadoopfs/fs1/namenode")), subject.getRoleConfigs(HdfsRoles.NAMENODE, hostGroup, preparatorWithHostGroups(hostGroup)));
assertEquals(List.of(config("fs_checkpoint_dir_list", "/hadoopfs/fs1/namesecondary")), subject.getRoleConfigs(HdfsRoles.SECONDARYNAMENODE, hostGroup, preparatorWithHostGroups(hostGroup)));
assertEquals(List.of(config("dfs_journalnode_edits_dir", "/hadoopfs/fs1/journalnode")), subject.getRoleConfigs(HdfsRoles.JOURNALNODE, hostGroup, preparatorWithHostGroups(hostGroup)));
}
Aggregations