Search in sources :

Example 1 with ClusterPertain

use of com.sequenceiq.periscope.domain.ClusterPertain in project cloudbreak by hortonworks.

the class ClusterDeleteHandlerTest method getCluster.

private Cluster getCluster(ClusterState clusterState) {
    Cluster cluster = new Cluster();
    cluster.setId(AUTOSCALE_CLUSTER_ID);
    cluster.setStackCrn(CLOUDBREAK_STACK_CRN);
    cluster.setState(clusterState);
    cluster.setStopStartScalingEnabled(Boolean.FALSE);
    ClusterPertain clusterPertain = new ClusterPertain();
    cluster.setClusterPertain(clusterPertain);
    return cluster;
}
Also used : ClusterPertain(com.sequenceiq.periscope.domain.ClusterPertain) Cluster(com.sequenceiq.periscope.domain.Cluster)

Example 2 with ClusterPertain

use of com.sequenceiq.periscope.domain.ClusterPertain in project cloudbreak by hortonworks.

the class ClusterRepositoryTest method getAClusterWithTimeAlerts.

private Cluster getAClusterWithTimeAlerts() {
    Cluster cluster = new Cluster();
    cluster.setStackCrn(CLOUDBREAK_STACK_CRN_2);
    cluster.setState(ClusterState.RUNNING);
    cluster.setAutoscalingEnabled(Boolean.TRUE);
    cluster.setStackType(StackType.WORKLOAD);
    ClusterPertain clusterPertain = new ClusterPertain();
    clusterPertain.setTenant(TEST_TENANT);
    cluster.setClusterPertain(clusterPertain);
    ScalingPolicy scalingPolicy = new ScalingPolicy();
    scalingPolicy.setAdjustmentType(AdjustmentType.EXACT);
    scalingPolicy.setHostGroup("compute");
    TimeAlert alert = new TimeAlert();
    alert.setCron(TEST_CRON_EXPRESSION);
    alert.setCluster(cluster);
    alert.setScalingPolicy(scalingPolicy);
    cluster.setTimeAlerts(Set.of(alert));
    return cluster;
}
Also used : ClusterPertain(com.sequenceiq.periscope.domain.ClusterPertain) ScalingPolicy(com.sequenceiq.periscope.domain.ScalingPolicy) TimeAlert(com.sequenceiq.periscope.domain.TimeAlert) Cluster(com.sequenceiq.periscope.domain.Cluster)

Example 3 with ClusterPertain

use of com.sequenceiq.periscope.domain.ClusterPertain in project cloudbreak by hortonworks.

the class ClusterRepositoryTest method getAClusterWithLoadAlerts.

private Cluster getAClusterWithLoadAlerts() {
    Cluster cluster = new Cluster();
    cluster.setStackCrn(CLOUDBREAK_STACK_CRN_1);
    cluster.setState(ClusterState.RUNNING);
    cluster.setAutoscalingEnabled(Boolean.TRUE);
    cluster.setStackType(StackType.WORKLOAD);
    ClusterPertain clusterPertain = new ClusterPertain();
    clusterPertain.setTenant(TEST_TENANT);
    cluster.setClusterPertain(clusterPertain);
    ScalingPolicy scalingPolicy = new ScalingPolicy();
    scalingPolicy.setAdjustmentType(AdjustmentType.LOAD_BASED);
    scalingPolicy.setHostGroup("compute");
    LoadAlertConfiguration alertConfiguration = new LoadAlertConfiguration();
    alertConfiguration.setCoolDownMinutes(10);
    alertConfiguration.setMaxResourceValue(TEST_HOSTGROUP_MAX_SIZE);
    alertConfiguration.setMinResourceValue(TEST_HOSTGROUP_MIN_SIZE);
    LoadAlert loadAlert = new LoadAlert();
    loadAlert.setScalingPolicy(scalingPolicy);
    loadAlert.setLoadAlertConfiguration(alertConfiguration);
    loadAlert.setCluster(cluster);
    cluster.setLoadAlerts(Set.of(loadAlert));
    cluster.setLastScalingActivity(Instant.now().minus(45, ChronoUnit.MINUTES).toEpochMilli());
    return cluster;
}
Also used : ClusterPertain(com.sequenceiq.periscope.domain.ClusterPertain) ScalingPolicy(com.sequenceiq.periscope.domain.ScalingPolicy) Cluster(com.sequenceiq.periscope.domain.Cluster) LoadAlert(com.sequenceiq.periscope.domain.LoadAlert) LoadAlertConfiguration(com.sequenceiq.periscope.domain.LoadAlertConfiguration)

Example 4 with ClusterPertain

use of com.sequenceiq.periscope.domain.ClusterPertain in project cloudbreak by hortonworks.

the class AltusMachineUserServiceTest method getACluster.

protected Cluster getACluster() {
    Cluster cluster = new Cluster();
    cluster.setEnvironmentCrn(testEnvironmentCrn);
    cluster.setId(10);
    ClusterPertain clusterPertain = new ClusterPertain();
    clusterPertain.setTenant(testAccountId);
    cluster.setClusterPertain(clusterPertain);
    return cluster;
}
Also used : ClusterPertain(com.sequenceiq.periscope.domain.ClusterPertain) Cluster(com.sequenceiq.periscope.domain.Cluster)

Example 5 with ClusterPertain

use of com.sequenceiq.periscope.domain.ClusterPertain in project cloudbreak by hortonworks.

the class YarnLoadEvaluatorTest method getARunningCluster.

private Cluster getARunningCluster() {
    Cluster cluster = new Cluster();
    cluster.setId(AUTOSCALE_CLUSTER_ID);
    cluster.setStackCrn(CLOUDBREAK_STACK_CRN);
    cluster.setState(ClusterState.RUNNING);
    ClusterPertain clusterPertain = new ClusterPertain();
    clusterPertain.setTenant("testtenant");
    cluster.setClusterPertain(clusterPertain);
    ScalingPolicy scalingPolicy = new ScalingPolicy();
    scalingPolicy.setAdjustmentType(AdjustmentType.LOAD_BASED);
    scalingPolicy.setHostGroup("compute");
    LoadAlertConfiguration alertConfiguration = new LoadAlertConfiguration();
    alertConfiguration.setCoolDownMinutes(10);
    alertConfiguration.setMaxResourceValue(TEST_HOSTGROUP_MAX_SIZE);
    alertConfiguration.setMinResourceValue(TEST_HOSTGROUP_MIN_SIZE);
    LoadAlert loadAlert = new LoadAlert();
    loadAlert.setScalingPolicy(scalingPolicy);
    loadAlert.setLoadAlertConfiguration(alertConfiguration);
    cluster.setLoadAlerts(Set.of(loadAlert));
    cluster.setLastScalingActivity(Instant.now().minus(45, ChronoUnit.MINUTES).toEpochMilli());
    cluster.setMachineUserCrn(MACHINE_USER_CNR);
    return cluster;
}
Also used : ClusterPertain(com.sequenceiq.periscope.domain.ClusterPertain) ScalingPolicy(com.sequenceiq.periscope.domain.ScalingPolicy) Cluster(com.sequenceiq.periscope.domain.Cluster) LoadAlert(com.sequenceiq.periscope.domain.LoadAlert) LoadAlertConfiguration(com.sequenceiq.periscope.domain.LoadAlertConfiguration)

Aggregations

ClusterPertain (com.sequenceiq.periscope.domain.ClusterPertain)16 Cluster (com.sequenceiq.periscope.domain.Cluster)15 ScalingPolicy (com.sequenceiq.periscope.domain.ScalingPolicy)7 TimeAlert (com.sequenceiq.periscope.domain.TimeAlert)4 UsageProto (com.cloudera.thunderhead.service.common.usage.UsageProto)3 LoadAlert (com.sequenceiq.periscope.domain.LoadAlert)3 LoadAlertConfiguration (com.sequenceiq.periscope.domain.LoadAlertConfiguration)3 Test (org.junit.Test)3 UserManagementProto (com.cloudera.thunderhead.service.usermanagement.UserManagementProto)1 AutoscaleRecommendationV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.connector.responses.AutoscaleRecommendationV4Response)1 CloudbreakServiceCrnEndpoints (com.sequenceiq.cloudbreak.client.CloudbreakServiceCrnEndpoints)1 AutoscaleUserCrnClientBuilder (com.sequenceiq.periscope.client.AutoscaleUserCrnClientBuilder)1 BaseAlert (com.sequenceiq.periscope.domain.BaseAlert)1 ClusterManager (com.sequenceiq.periscope.domain.ClusterManager)1 UpdateFailedDetails (com.sequenceiq.periscope.domain.UpdateFailedDetails)1 List (java.util.List)1 Before (org.junit.Before)1