Search in sources :

Example 6 with RdsConfigWithoutCluster

use of com.sequenceiq.cloudbreak.domain.view.RdsConfigWithoutCluster in project cloudbreak by hortonworks.

the class ClusterHostServiceRunner method decoratePillarWithClouderaManagerDatabase.

private void decoratePillarWithClouderaManagerDatabase(Cluster cluster, Map<String, SaltPillarProperties> servicePillar) throws CloudbreakOrchestratorFailedException {
    RdsConfigWithoutCluster clouderaManagerRdsConfig = rdsConfigWithoutClusterService.findByClusterIdAndType(cluster.getId(), DatabaseType.CLOUDERA_MANAGER);
    if (clouderaManagerRdsConfig == null) {
        throw new CloudbreakOrchestratorFailedException("Cloudera Manager RDSConfig is missing for stack");
    }
    RdsView rdsView = new RdsView(clouderaManagerRdsConfig);
    servicePillar.put("cloudera-manager-database", new SaltPillarProperties("/cloudera-manager/database.sls", singletonMap("cloudera-manager", singletonMap("database", rdsView))));
}
Also used : CloudbreakOrchestratorFailedException(com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException) RdsView(com.sequenceiq.cloudbreak.template.views.RdsView) SaltPillarProperties(com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties) RdsConfigWithoutCluster(com.sequenceiq.cloudbreak.domain.view.RdsConfigWithoutCluster)

Example 7 with RdsConfigWithoutCluster

use of com.sequenceiq.cloudbreak.domain.view.RdsConfigWithoutCluster in project cloudbreak by hortonworks.

the class SharedServiceConfigProvider method configureCluster.

public Cluster configureCluster(@Nonnull Cluster requestedCluster, User user, Workspace workspace) {
    Objects.requireNonNull(requestedCluster);
    Stack stack = requestedCluster.getStack();
    if (!Strings.isNullOrEmpty(stack.getDatalakeCrn())) {
        Stack datalakeStack = stackService.getByCrn(stack.getDatalakeCrn());
        if (datalakeStack != null) {
            List<RdsConfigWithoutCluster> rdsConfigs = rdsConfigWithoutClusterService.findByClusterIdAndStatusInAndTypeIn(datalakeStack.getCluster().getId(), Set.of(ResourceStatus.USER_MANAGED, ResourceStatus.DEFAULT), Set.of(DatabaseType.HIVE));
            setupRds(requestedCluster, rdsConfigs);
            setupStoragePath(requestedCluster, datalakeStack);
        }
    }
    return requestedCluster;
}
Also used : Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) RdsConfigWithoutCluster(com.sequenceiq.cloudbreak.domain.view.RdsConfigWithoutCluster)

Aggregations

RdsConfigWithoutCluster (com.sequenceiq.cloudbreak.domain.view.RdsConfigWithoutCluster)7 ExposedService (com.sequenceiq.cloudbreak.api.service.ExposedService)2 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)2 ClusterPreCreationApi (com.sequenceiq.cloudbreak.cluster.api.ClusterPreCreationApi)2 ServiceLocationMap (com.sequenceiq.cloudbreak.cluster.model.ServiceLocationMap)2 InstanceGroup (com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup)2 GatewayConfig (com.sequenceiq.cloudbreak.orchestrator.model.GatewayConfig)2 Secret (com.sequenceiq.cloudbreak.service.secret.domain.Secret)2 HashSet (java.util.HashSet)2 Account (com.cloudera.thunderhead.service.usermanagement.UserManagementProto.Account)1 Joiner (com.google.common.base.Joiner)1 Lists (com.google.common.collect.Lists)1 InetAddresses (com.google.common.net.InetAddresses)1 DatabaseType (com.sequenceiq.cloudbreak.api.endpoint.v4.database.base.DatabaseType)1 SSOType (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.SSOType)1 ExposedServiceCollector (com.sequenceiq.cloudbreak.api.service.ExposedServiceCollector)1 CMLicenseParser (com.sequenceiq.cloudbreak.auth.CMLicenseParser)1 ThreadBasedUserCrnProvider (com.sequenceiq.cloudbreak.auth.ThreadBasedUserCrnProvider)1 EntitlementService (com.sequenceiq.cloudbreak.auth.altus.EntitlementService)1 GrpcUmsClient (com.sequenceiq.cloudbreak.auth.altus.GrpcUmsClient)1