Search in sources :

Example 11 with HostgroupView

use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.

the class KuduVolumeConfigProviderTest method testRoleConfigsWithSingleVolume.

@Test
void testRoleConfigsWithSingleVolume() {
    HostgroupView hostGroup = hostGroupWithVolumeCount(1);
    assertEquals(List.of(config("fs_wal_dir", "/hadoopfs/fs1/kudu/master"), config("fs_data_dirs", "/hadoopfs/fs1/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/fs1/kudu/tserver")), subject.getRoleConfigs(KuduRoles.KUDU_TSERVER, hostGroup, getTemplatePreparationObject(hostGroup)));
}
Also used : HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) Test(org.junit.jupiter.api.Test)

Example 12 with HostgroupView

use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.

the class NifiRegistryVolumeConfigProviderTest method testRoleConfigsWithOneVolumeAndStackVersion7211.

@Test
void testRoleConfigsWithOneVolumeAndStackVersion7211() {
    when(cmTemplateProcessorMock.getStackVersion()).thenReturn("7.2.11");
    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)));
}
Also used : HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) Test(org.junit.jupiter.api.Test)

Example 13 with HostgroupView

use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.

the class NifiRegistryVolumeConfigProviderTest method testRoleConfigsWithOneVolume.

@Test
void testRoleConfigsWithOneVolume() {
    HostgroupView hostGroup = hostGroupWithVolumeCount(1);
    assertEquals(List.of(config("log_dir", "/hadoopfs/fs1/nifi-registry-log")), subject.getRoleConfigs(NifiRoles.NIFI_NODE, hostGroup, getTemplatePreparationObject(hostGroup)));
}
Also used : HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) Test(org.junit.jupiter.api.Test)

Example 14 with HostgroupView

use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.

the class OozieRoleConfigProviderTest method getTemplatePreparationObject.

static TemplatePreparationObject getTemplatePreparationObject(String inputJson, CmTemplateProcessor cmTemplateProcessor, int numMasters) {
    List<String> hosts = new ArrayList<>();
    for (int i = 0; i < numMasters; i++) {
        hosts.add("master" + i + ".blah.timbuk2.dev.cldr.");
    }
    HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.GATEWAY, hosts);
    HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, 2);
    RDSConfig rdsConfig = new RDSConfig();
    rdsConfig.setType(DatabaseType.OOZIE.toString());
    rdsConfig.setConnectionPassword("testpassword");
    rdsConfig.setConnectionUserName("testuser");
    rdsConfig.setConnectionURL("jdbc:postgresql://testhost:5432/ooziedb");
    return Builder.builder().withHostgroupViews(Set.of(master, worker)).withRdsConfigs(Set.of(rdsConfig)).withBlueprintView(new BlueprintView(inputJson, "CDP", "1.0", cmTemplateProcessor)).withCloudPlatform(CloudPlatform.GCP).build();
}
Also used : RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) BlueprintView(com.sequenceiq.cloudbreak.template.views.BlueprintView) ArrayList(java.util.ArrayList) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView)

Example 15 with HostgroupView

use of com.sequenceiq.cloudbreak.template.views.HostgroupView in project cloudbreak by hortonworks.

the class DataDiscoveryServiceCloudStorageRoleConfigProviderTest 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) {
        locations.add(new StorageLocationView(getDataDiscoveryServiceFileSystemUri()));
    }
    S3FileSystemConfigurationsView fileSystemConfigurationsView = new S3FileSystemConfigurationsView(new S3FileSystem(), locations, false);
    return Builder.builder().withFileSystemConfigurationView(fileSystemConfigurationsView).withHostgroupViews(Set.of(master, worker)).build();
}
Also used : StorageLocationView(com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView) ArrayList(java.util.ArrayList) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) S3FileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView) S3FileSystem(com.sequenceiq.common.api.filesystem.S3FileSystem)

Aggregations

HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)122 Test (org.junit.jupiter.api.Test)63 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)39 ArrayList (java.util.ArrayList)34 ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)26 ApiClusterTemplateService (com.cloudera.api.swagger.model.ApiClusterTemplateService)25 GeneralClusterConfigs (com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)23 List (java.util.List)23 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)23 CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)19 StorageLocationView (com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView)19 S3FileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView)18 S3FileSystem (com.sequenceiq.common.api.filesystem.S3FileSystem)18 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)16 DisplayName (org.junit.jupiter.api.DisplayName)16 MethodSource (org.junit.jupiter.params.provider.MethodSource)16 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)15 ApiClusterTemplateRoleConfigGroup (com.cloudera.api.swagger.model.ApiClusterTemplateRoleConfigGroup)8 Map (java.util.Map)8 RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)7