Search in sources :

Example 26 with Cluster

use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.

the class ClusterRequestToClusterConverterTest method testConvertWithFileSystemDetails.

@Test
public void testConvertWithFileSystemDetails() {
    // GIVEN
    given(conversionService.convert(any(KerberosRequest.class), eq(KerberosConfig.class))).willReturn(new KerberosConfig());
    given(conversionService.convert(any(FileSystemRequest.class), eq(FileSystem.class))).willReturn(new FileSystem());
    // WHEN
    Cluster result = underTest.convert(getRequest("stack/cluster-with-file-system.json"));
    // THEN
    assertAllFieldsNotNull(result, Arrays.asList("stack", "blueprint", "creationStarted", "creationFinished", "upSince", "statusReason", "ambariIp", "ambariStackDetails", "certDir", "rdsConfigs", "ldapConfig", "attributes", "blueprintCustomProperties", "uptime", "ambariSecurityMasterKey", "proxyConfig", "extendedBlueprintText"));
}
Also used : FileSystemRequest(com.sequenceiq.cloudbreak.api.model.FileSystemRequest) KerberosConfig(com.sequenceiq.cloudbreak.domain.KerberosConfig) FileSystem(com.sequenceiq.cloudbreak.domain.FileSystem) KerberosRequest(com.sequenceiq.cloudbreak.api.model.KerberosRequest) Cluster(com.sequenceiq.cloudbreak.domain.Cluster) Test(org.junit.Test)

Example 27 with Cluster

use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.

the class ClusterRequestToClusterConverterTest method testConvert.

@Test
public void testConvert() {
    // GIVEN
    // WHEN
    Cluster result = underTest.convert(getRequest("stack/cluster.json"));
    // THEN
    assertAllFieldsNotNull(result, Arrays.asList("stack", "blueprint", "creationStarted", "creationFinished", "upSince", "statusReason", "ambariIp", "ambariStackDetails", "fileSystem", "certDir", "rdsConfigs", "ldapConfig", "attributes", "blueprintCustomProperties", "uptime", "kerberosConfig", "ambariSecurityMasterKey", "proxyConfig", "extendedBlueprintText"));
}
Also used : Cluster(com.sequenceiq.cloudbreak.domain.Cluster) Test(org.junit.Test)

Example 28 with Cluster

use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.

the class ClusterToClusterResponseConverterTest method createSource.

@Override
public Cluster createSource() {
    Stack stack = TestUtil.stack();
    Blueprint blueprint = TestUtil.blueprint();
    Cluster cluster = TestUtil.cluster(blueprint, stack, 1L);
    ProxyConfig proxyConfig = new ProxyConfig();
    proxyConfig.setName("test");
    cluster.setProxyConfig(proxyConfig);
    stack.setCluster(cluster);
    return cluster;
}
Also used : Blueprint(com.sequenceiq.cloudbreak.domain.Blueprint) Cluster(com.sequenceiq.cloudbreak.domain.Cluster) ProxyConfig(com.sequenceiq.cloudbreak.domain.ProxyConfig) Stack(com.sequenceiq.cloudbreak.domain.Stack)

Example 29 with Cluster

use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.

the class StackCreatorService method createClusterIfNeed.

private void createClusterIfNeed(IdentityUser user, StackRequest stackRequest, Stack stack, String stackName, Blueprint blueprint) throws Exception {
    if (stackRequest.getClusterRequest() != null) {
        try {
            long start = System.currentTimeMillis();
            Cluster cluster = clusterCreationService.prepare(stackRequest.getClusterRequest(), stack, blueprint, user);
            LOGGER.info("Cluster object and its dependencies has been created in {} ms for stack {}", System.currentTimeMillis() - start, stackName);
            stack.setCluster(cluster);
        } catch (BadRequestException e) {
            stackService.delete(stack);
            throw e;
        }
    }
}
Also used : Cluster(com.sequenceiq.cloudbreak.domain.Cluster)

Example 30 with Cluster

use of com.sequenceiq.cloudbreak.domain.Cluster in project cloudbreak by hortonworks.

the class ClusterCredentialChangeService method finishCredentialUpdate.

public void finishCredentialUpdate(Long stackId, Long clusterId, String password) {
    Cluster cluster = clusterService.getById(clusterId);
    cluster.setPassword(password);
    finishCredentialChange(stackId, cluster);
}
Also used : Cluster(com.sequenceiq.cloudbreak.domain.Cluster)

Aggregations

Cluster (com.sequenceiq.cloudbreak.domain.Cluster)144 Stack (com.sequenceiq.cloudbreak.domain.Stack)68 Test (org.junit.Test)64 AmbariClient (com.sequenceiq.ambari.client.AmbariClient)31 HostGroup (com.sequenceiq.cloudbreak.domain.HostGroup)26 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)22 CloudbreakException (com.sequenceiq.cloudbreak.service.CloudbreakException)22 HashMap (java.util.HashMap)22 HashSet (java.util.HashSet)15 List (java.util.List)15 ArrayList (java.util.ArrayList)13 HttpClientConfig (com.sequenceiq.cloudbreak.client.HttpClientConfig)12 BadRequestException (com.sequenceiq.cloudbreak.controller.BadRequestException)12 BlueprintPreparationObject (com.sequenceiq.cloudbreak.blueprint.BlueprintPreparationObject)11 Matchers.anyString (org.mockito.Matchers.anyString)11 CancellationException (com.sequenceiq.cloudbreak.cloud.scheduler.CancellationException)10 InstanceMetaData (com.sequenceiq.cloudbreak.domain.InstanceMetaData)10 InstanceGroup (com.sequenceiq.cloudbreak.domain.InstanceGroup)9 Json (com.sequenceiq.cloudbreak.domain.json.Json)9 PollingResult (com.sequenceiq.cloudbreak.service.PollingResult)9