Search in sources :

Example 6 with ResizeRecommendation

use of com.sequenceiq.cloudbreak.cloud.model.ResizeRecommendation in project cloudbreak by hortonworks.

the class CmTemplateProcessorTest method recommendResize.

@Test
public void recommendResize() {
    Versioned blueprintVersion = () -> "7.2.11";
    underTest = new CmTemplateProcessor(getBlueprintText("input/kafka.bp"));
    assertEquals(new ResizeRecommendation(Set.of("quorum"), Set.of("quorum")), underTest.recommendResize(List.of(), blueprintVersion));
    underTest = new CmTemplateProcessor(getBlueprintText("input/de-ha.bp"));
    Set<String> hostGroups = Set.of("gateway", "compute", "worker");
    assertEquals(new ResizeRecommendation(hostGroups, hostGroups), underTest.recommendResize(List.of(), blueprintVersion));
    underTest = new CmTemplateProcessor(getBlueprintText("input/cb5660.bp"));
    hostGroups = Set.of("gateway", "quorum", "worker", "compute");
    assertEquals(new ResizeRecommendation(hostGroups, hostGroups), underTest.recommendResize(List.of(), blueprintVersion));
    underTest = new CmTemplateProcessor(getBlueprintText("input/nifi.bp"));
    assertEquals(new ResizeRecommendation(Set.of(), Set.of()), underTest.recommendResize(List.of(), blueprintVersion));
}
Also used : ResizeRecommendation(com.sequenceiq.cloudbreak.cloud.model.ResizeRecommendation) Versioned(com.sequenceiq.cloudbreak.common.type.Versioned) Test(org.junit.jupiter.api.Test)

Aggregations

ResizeRecommendation (com.sequenceiq.cloudbreak.cloud.model.ResizeRecommendation)6 AutoscaleRecommendation (com.sequenceiq.cloudbreak.cloud.model.AutoscaleRecommendation)4 ScaleRecommendation (com.sequenceiq.cloudbreak.cloud.model.ScaleRecommendation)3 Versioned (com.sequenceiq.cloudbreak.common.type.Versioned)2 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)2 BlueprintTextProcessor (com.sequenceiq.cloudbreak.template.processor.BlueprintTextProcessor)2 Test (org.junit.Test)2 CloudVmTypes (com.sequenceiq.cloudbreak.cloud.model.CloudVmTypes)1 DiskTypes (com.sequenceiq.cloudbreak.cloud.model.DiskTypes)1 GatewayRecommendation (com.sequenceiq.cloudbreak.cloud.model.GatewayRecommendation)1 InstanceCount (com.sequenceiq.cloudbreak.cloud.model.InstanceCount)1 Platform (com.sequenceiq.cloudbreak.cloud.model.Platform)1 PlatformDisks (com.sequenceiq.cloudbreak.cloud.model.PlatformDisks)1 PlatformRecommendation (com.sequenceiq.cloudbreak.cloud.model.PlatformRecommendation)1 VmRecommendations (com.sequenceiq.cloudbreak.cloud.model.VmRecommendations)1 VmType (com.sequenceiq.cloudbreak.cloud.model.VmType)1 HashMap (java.util.HashMap)1 Set (java.util.Set)1 Test (org.junit.jupiter.api.Test)1