use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class CmHostGroupRoleConfigProviderProcessorTest method testGetRoleConfigsWithDifferentDataNodeRoleForMultipleGroups.
@Test
public void testGetRoleConfigsWithDifferentDataNodeRoleForMultipleGroups() {
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-different-DN-role.bp", Builder.builder().withHostgroupViews(Set.of(master, worker, compute)));
underTest.process(templateProcessor, templatePreparator);
Map<String, List<ApiClusterTemplateConfig>> roleConfigs = mapRoleConfigs();
assertEquals(List.of(config("dfs_name_dir_list", "/hadoopfs/fs1/namenode")), roleConfigs.get("hdfs-NAMENODE-BASE"));
assertEquals(List.of(config("dfs_data_dir_list", "/hadoopfs/fs1/datanode,/hadoopfs/fs2/datanode")), roleConfigs.get("hdfs-DATANODE-BASE"));
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 testGetRoleConfigsWithAttachedVolumes.
@Test
public void testGetRoleConfigsWithAttachedVolumes() {
HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.GATEWAY, Collections.<String>emptySet(), Sets.newHashSet(new VolumeTemplate()), TemporaryStorage.ATTACHED_VOLUMES, 0);
HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, Collections.<String>emptySet(), Sets.newHashSet(new VolumeTemplate()), TemporaryStorage.ATTACHED_VOLUMES, 0);
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("hbase_bucketcache_ioengine", "offheap")), roleConfigs.get("hbase-REGIONSERVER-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 CmHostGroupRoleConfigProviderProcessorTest method testGetRoleConfigsWithSingleRolesPerHostGroupWithCustomRefNames.
@Test
public void testGetRoleConfigsWithSingleRolesPerHostGroupWithCustomRefNames() {
HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.GATEWAY, 1);
HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, 2);
setup("input/clouderamanager-custom-ref.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("dn"));
assertEquals(List.of(config("dfs_name_dir_list", "/hadoopfs/fs1/namenode")), roleConfigs.get("nn"));
}
use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class HdfsConfigProviderTest method getTemplatePreparationObject.
private TemplatePreparationObject getTemplatePreparationObject(boolean useS3FileSystem, boolean fillDynamoTableName, boolean includeLocations) {
HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.GATEWAY, 1);
HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, 2);
List<StorageLocationView> locations = new ArrayList<>();
if (includeLocations) {
locations.add(new StorageLocationView(getStorageLocation("hive.metastore.warehouse.dir", "s3a://bucket/warehouse/managed")));
locations.add(new StorageLocationView(getStorageLocation("hive.metastore.warehouse.external.dir", "s3a://bucket/warehouse/external")));
}
BaseFileSystemConfigurationsView fileSystemConfigurationsView;
if (useS3FileSystem) {
S3FileSystem s3FileSystem = new S3FileSystem();
if (fillDynamoTableName) {
s3FileSystem.setS3GuardDynamoTableName("dynamoTable");
}
fileSystemConfigurationsView = new S3FileSystemConfigurationsView(s3FileSystem, locations, false);
} else {
fileSystemConfigurationsView = new AdlsFileSystemConfigurationsView(new AdlsFileSystem(), locations, false);
}
Gateway gateway = TestUtil.gatewayEnabledWithExposedKnoxServices(ExposedServiceUtil.exposedService("NAMENODE").getKnoxService());
PlacementView placementView = new PlacementView("region", "az");
return Builder.builder().withFileSystemConfigurationView(fileSystemConfigurationsView).withHostgroupViews(Set.of(master, worker)).withGateway(gateway, "/cb/secret/signkey", new HashSet<>()).withPlacementView(placementView).withDefaultTags(Map.of("apple", "apple1")).withProductDetails(new ClouderaManagerRepo().withVersion("7.1.0"), List.of()).withStackType(StackType.DATALAKE).build();
}
use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class HdfsRoleConfigProviderTest method nonHA.
@Test
void nonHA() {
HostgroupView master = new HostgroupView("master", 0, InstanceGroupType.CORE, 1);
HostgroupView worker = new HostgroupView("worker", 0, InstanceGroupType.CORE, 3);
String inputJson = FileReaderUtils.readFileFromClasspathQuietly("input/clouderamanager.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
TemplatePreparationObject preparationObject = TemplatePreparationObject.Builder.builder().withHostgroupViews(Set.of(master, worker)).withBlueprintView(new BlueprintView(inputJson, "CDP", "1.0", cmTemplateProcessor)).build();
Map<String, List<ApiClusterTemplateConfig>> roleConfigs = subject.getRoleConfigs(cmTemplateProcessor, preparationObject);
assertEquals(List.of(), roleConfigs.get("hdfs-NAMENODE-BASE"));
assertEquals(List.of(config("dfs_datanode_failed_volumes_tolerated", "0")), roleConfigs.get("hdfs-DATANODE-BASE"));
}
Aggregations