Search in sources :

Example 6 with SharedServiceConfigsView

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

the class DatalakeService method createSharedServiceConfigsView.

public SharedServiceConfigsView createSharedServiceConfigsView(Stack stack) {
    SharedServiceConfigsView sharedServiceConfigsView = new SharedServiceConfigsView();
    String password = stack.getCluster().getPassword();
    switch(stack.getType()) {
        case DATALAKE:
            setRangerAttributes(password, sharedServiceConfigsView);
            sharedServiceConfigsView.setDatalakeCluster(true);
            break;
        case WORKLOAD:
            sharedServiceConfigsView.setRangerAdminPort(DEFAULT_RANGER_PORT);
            sharedServiceConfigsView.setDatalakeCluster(false);
            sharedServiceConfigsView.setAttachedCluster(true);
            if (Strings.isNullOrEmpty(stack.getDatalakeCrn())) {
                break;
            }
            Stack datalakeStack = stackService.getByCrnOrElseNull(stack.getDatalakeCrn());
            if (datalakeStack == null) {
                break;
            }
            sharedServiceConfigsView.setDatalakeClusterManagerFqdn(getDatalakeClusterManagerFqdn(datalakeStack));
            sharedServiceConfigsView.setDatalakeClusterManagerIp(datalakeStack.getClusterManagerIp());
            break;
        default:
            setRangerAttributes(password, sharedServiceConfigsView);
            sharedServiceConfigsView.setDatalakeCluster(false);
            break;
    }
    return sharedServiceConfigsView;
}
Also used : SharedServiceConfigsView(com.sequenceiq.cloudbreak.template.views.SharedServiceConfigsView) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack)

Example 7 with SharedServiceConfigsView

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

the class AbstractHbaseConfigProviderTest method getTemplatePreparationObject.

protected TemplatePreparationObject getTemplatePreparationObject(boolean includeLocations, boolean datalakeCluster, String cdhVersion, Map<String, String> defaultTags, CloudPlatform cloudPlatform) {
    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 hbaseRootDir = new StorageLocation();
        hbaseRootDir.setProperty("hbase.rootdir");
        hbaseRootDir.setValue("s3a://bucket/cluster1/hbase");
        locations.add(new StorageLocationView(hbaseRootDir));
    }
    S3FileSystemConfigurationsView fileSystemConfigurationsView = new S3FileSystemConfigurationsView(new S3FileSystem(), locations, false);
    SharedServiceConfigsView sharedServicesConfigsView = new SharedServiceConfigsView();
    sharedServicesConfigsView.setDatalakeCluster(datalakeCluster);
    String inputJson = getBlueprintText("input/clouderamanager.bp");
    CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
    cmTemplateProcessor.setCdhVersion(cdhVersion);
    GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
    generalClusterConfigs.setAccountId(Optional.of("1234"));
    return TemplatePreparationObject.Builder.builder().withFileSystemConfigurationView(fileSystemConfigurationsView).withBlueprintView(new BlueprintView(inputJson, "", "", cmTemplateProcessor)).withSharedServiceConfigs(sharedServicesConfigsView).withHostgroupViews(Set.of(master, worker)).withGeneralClusterConfigs(generalClusterConfigs).withDefaultTags(defaultTags).withCloudPlatform(cloudPlatform).build();
}
Also used : StorageLocationView(com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView) GeneralClusterConfigs(com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs) BlueprintView(com.sequenceiq.cloudbreak.template.views.BlueprintView) ArrayList(java.util.ArrayList) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) StorageLocation(com.sequenceiq.cloudbreak.domain.StorageLocation) SharedServiceConfigsView(com.sequenceiq.cloudbreak.template.views.SharedServiceConfigsView) S3FileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView) S3FileSystem(com.sequenceiq.common.api.filesystem.S3FileSystem)

Aggregations

SharedServiceConfigsView (com.sequenceiq.cloudbreak.template.views.SharedServiceConfigsView)7 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)4 Test (org.junit.jupiter.api.Test)4 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)3 CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)1 StorageLocation (com.sequenceiq.cloudbreak.domain.StorageLocation)1 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)1 StorageLocationView (com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView)1 S3FileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView)1 GeneralClusterConfigs (com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)1 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)1 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)1 S3FileSystem (com.sequenceiq.common.api.filesystem.S3FileSystem)1 ArrayList (java.util.ArrayList)1