Search in sources :

Example 11 with GeneralClusterConfigs

use of com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs in project cloudbreak by hortonworks.

the class GeneralClusterConfigsProvider method generalClusterConfigs.

public GeneralClusterConfigs generalClusterConfigs(Stack stack, Cluster cluster, IdentityUser identityUser) {
    boolean gatewayInstanceMetadataPresented = false;
    boolean instanceMetadataPresented = false;
    if (stack.getInstanceGroups() != null && !stack.getInstanceGroups().isEmpty()) {
        List<InstanceMetaData> gatewayInstanceMetadata = stack.getGatewayInstanceMetadata();
        gatewayInstanceMetadataPresented = gatewayInstanceMetadata.size() > 1;
        instanceMetadataPresented = true;
    }
    GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
    generalClusterConfigs.setIdentityUserEmail(identityUser.getUsername());
    generalClusterConfigs.setAmbariIp(cluster.getAmbariIp());
    generalClusterConfigs.setInstanceGroupsPresented(instanceMetadataPresented);
    generalClusterConfigs.setGatewayInstanceMetadataPresented(gatewayInstanceMetadataPresented);
    generalClusterConfigs.setClusterName(cluster.getName());
    generalClusterConfigs.setPassword(cluster.getPassword());
    generalClusterConfigs.setExecutorType(cluster.getExecutorType());
    generalClusterConfigs.setStackName(stack.getName());
    generalClusterConfigs.setUuid(stack.getUuid());
    generalClusterConfigs.setUserName(cluster.getUserName());
    generalClusterConfigs.setNodeCount(stack.getFullNodeCount());
    generalClusterConfigs.setPrimaryGatewayInstanceDiscoveryFQDN(Optional.ofNullable(stack.getPrimaryGatewayInstance().getDiscoveryFQDN()));
    return generalClusterConfigs;
}
Also used : InstanceMetaData(com.sequenceiq.cloudbreak.domain.InstanceMetaData) GeneralClusterConfigs(com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs)

Example 12 with GeneralClusterConfigs

use of com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs in project cloudbreak by hortonworks.

the class GeneralClusterConfigsProvider method generalClusterConfigs.

public GeneralClusterConfigs generalClusterConfigs(StackV2Request stack, IdentityUser identityUser) {
    boolean gatewayInstanceMetadataPresented = false;
    boolean instanceMetadataPresented = false;
    int nodeCount = 0;
    for (InstanceGroupV2Request instanceGroupV2Request : stack.getInstanceGroups()) {
        nodeCount += instanceGroupV2Request.getNodeCount();
    }
    GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
    generalClusterConfigs.setIdentityUserEmail(identityUser.getUsername());
    generalClusterConfigs.setAmbariIp("pendign...");
    generalClusterConfigs.setInstanceGroupsPresented(instanceMetadataPresented);
    generalClusterConfigs.setPassword(stack.getCluster().getAmbari().getPassword());
    generalClusterConfigs.setGatewayInstanceMetadataPresented(gatewayInstanceMetadataPresented);
    generalClusterConfigs.setClusterName(stack.getGeneral().getName());
    generalClusterConfigs.setExecutorType(stack.getCluster().getExecutorType());
    generalClusterConfigs.setStackName(stack.getGeneral().getName());
    generalClusterConfigs.setUuid("pending...");
    generalClusterConfigs.setUserName(stack.getCluster().getAmbari().getUserName());
    generalClusterConfigs.setNodeCount(nodeCount);
    generalClusterConfigs.setPrimaryGatewayInstanceDiscoveryFQDN(Optional.ofNullable("pending..."));
    return generalClusterConfigs;
}
Also used : InstanceGroupV2Request(com.sequenceiq.cloudbreak.api.model.v2.InstanceGroupV2Request) GeneralClusterConfigs(com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs)

Aggregations

GeneralClusterConfigs (com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs)12 BlueprintPreparationObject (com.sequenceiq.cloudbreak.blueprint.BlueprintPreparationObject)4 Cluster (com.sequenceiq.cloudbreak.domain.Cluster)4 Test (org.junit.Test)4 BlueprintView (com.sequenceiq.cloudbreak.blueprint.template.views.BlueprintView)3 BlueprintStackInfo (com.sequenceiq.cloudbreak.blueprint.templates.BlueprintStackInfo)3 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)3 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 BlueprintTextProcessor (com.sequenceiq.cloudbreak.blueprint.BlueprintTextProcessor)2 KerberosConfig (com.sequenceiq.cloudbreak.domain.KerberosConfig)2 Stack (com.sequenceiq.cloudbreak.domain.Stack)2 Json (com.sequenceiq.cloudbreak.domain.json.Json)2 HashMap (java.util.HashMap)2 InstanceGroupV2Request (com.sequenceiq.cloudbreak.api.model.v2.InstanceGroupV2Request)1 BlueprintProcessingException (com.sequenceiq.cloudbreak.blueprint.BlueprintProcessingException)1 HdfConfigs (com.sequenceiq.cloudbreak.blueprint.nifi.HdfConfigs)1 FileSystemConfigurationView (com.sequenceiq.cloudbreak.blueprint.template.views.FileSystemConfigurationView)1 HostgroupView (com.sequenceiq.cloudbreak.blueprint.template.views.HostgroupView)1 IdentityUser (com.sequenceiq.cloudbreak.common.model.user.IdentityUser)1 FlexSubscription (com.sequenceiq.cloudbreak.domain.FlexSubscription)1