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;
}
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;
}
Aggregations