use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class HiveOnTezServiceConfigProviderTest method getTemplatePreparationObject.
private TemplatePreparationObject getTemplatePreparationObject(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) {
StorageLocation hmsExternalWarehouseDir = new StorageLocation();
hmsExternalWarehouseDir.setProperty("hive.metastore.warehouse.external.dir");
hmsExternalWarehouseDir.setValue("s3a://bucket/hive/warehouse/external");
locations.add(new StorageLocationView(hmsExternalWarehouseDir));
}
S3FileSystemConfigurationsView fileSystemConfigurationsView = new S3FileSystemConfigurationsView(new S3FileSystem(), locations, false);
return Builder.builder().withFileSystemConfigurationView(fileSystemConfigurationsView).withHostgroupViews(Set.of(master, worker)).build();
}
use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class KnoxGatewayConfigProviderTest method testGetAdditionalServicesWhenKnoxRequestedAndBlueprintDoesNoContainKnoxWithMultiGateway.
@Test
public void testGetAdditionalServicesWhenKnoxRequestedAndBlueprintDoesNoContainKnoxWithMultiGateway() {
HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.GATEWAY, 1);
HostgroupView master2 = new HostgroupView("master2", 1, InstanceGroupType.GATEWAY, 1);
HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, 2);
Gateway gateway = new Gateway();
TemplatePreparationObject preparationObject = Builder.builder().withHostgroupViews(Set.of(master, master2, worker)).withGateway(gateway, "key", new HashSet<>()).build();
String inputJson = getBlueprintText("input/clouderamanager.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
Map<String, ApiClusterTemplateService> additionalServices = underTest.getAdditionalServices(cmTemplateProcessor, preparationObject);
ApiClusterTemplateService knox1 = additionalServices.get("master");
ApiClusterTemplateService knox2 = additionalServices.get("master2");
assertEquals(2, additionalServices.size());
assertNotNull(knox1);
assertNotNull(knox2);
assertEquals("KNOX", knox1.getServiceType());
assertEquals("KNOX", knox2.getServiceType());
assertEquals("knox", knox1.getRefName());
assertEquals("knox", knox2.getRefName());
ApiClusterTemplateRoleConfigGroup roleConfigGroup1 = knox1.getRoleConfigGroups().get(0);
ApiClusterTemplateRoleConfigGroup roleConfigGroup2 = knox1.getRoleConfigGroups().get(0);
assertEquals("KNOX_GATEWAY", roleConfigGroup1.getRoleType());
assertTrue(roleConfigGroup1.getBase());
assertEquals("KNOX_GATEWAY", roleConfigGroup2.getRoleType());
assertTrue(roleConfigGroup2.getBase());
}
use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class KuduVolumeConfigProviderTest method testRoleConfigsWithMultipleVolumes.
@Test
void testRoleConfigsWithMultipleVolumes() {
HostgroupView hostGroup = hostGroupWithVolumeCount(3);
assertEquals(List.of(config("fs_wal_dir", "/hadoopfs/fs1/kudu/master"), config("fs_data_dirs", "/hadoopfs/fs2/kudu/master,/hadoopfs/fs3/kudu/master")), subject.getRoleConfigs(KuduRoles.KUDU_MASTER, hostGroup, getTemplatePreparationObject(hostGroup)));
assertEquals(List.of(config("fs_wal_dir", "/hadoopfs/fs1/kudu/tserver"), config("fs_data_dirs", "/hadoopfs/fs2/kudu/tserver,/hadoopfs/fs3/kudu/tserver")), subject.getRoleConfigs(KuduRoles.KUDU_TSERVER, hostGroup, getTemplatePreparationObject(hostGroup)));
}
use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class NifiRegistryRoleConfigProviderTest method getTemplatePreparationObject.
private TemplatePreparationObject getTemplatePreparationObject(CmTemplateProcessor cmTemplateProcessor) {
HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.GATEWAY, 1);
HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, 3);
BlueprintView blueprintView = new BlueprintView(null, null, null, cmTemplateProcessor);
RDSConfig rdsConfig = new RDSConfig();
rdsConfig.setType(DatabaseType.NIFIREGISTRY.toString());
rdsConfig.setDatabaseEngine(DatabaseVendor.POSTGRES);
rdsConfig.setConnectionDriver(DatabaseVendor.POSTGRES.connectionDriver());
rdsConfig.setConnectionURL("jdbc:postgresql://testhost:5432/nifi_registry");
rdsConfig.setConnectionUserName("nifi_registry_server_user");
rdsConfig.setConnectionPassword("nifi_registry_server_password");
return TemplatePreparationObject.Builder.builder().withBlueprintView(blueprintView).withHostgroupViews(Set.of(master, worker)).withRdsConfigs(Set.of(rdsConfig)).build();
}
use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.
the class NifiRegistryVolumeConfigProviderTest method testRoleConfigsWithOneVolumeAndStackVersion7210.
@Test
void testRoleConfigsWithOneVolumeAndStackVersion7210() {
when(cmTemplateProcessorMock.getStackVersion()).thenReturn("7.2.10");
HostgroupView hostGroup = hostGroupWithVolumeCount(1);
assertEquals(List.of(config("log_dir", "/hadoopfs/fs1/nifi-registry-log"), config("nifi.registry.working.directory", "/hadoopfs/fs1/working-dir")), subject.getRoleConfigs(NifiRoles.NIFI_NODE, hostGroup, getTemplatePreparationObject(hostGroup)));
}
Aggregations