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