use of com.sequenceiq.periscope.domain.ScalingPolicy in project cloudbreak by hortonworks.
the class ScalingPolicyResponseConverter method convert.
@Override
public ScalingPolicy convert(ScalingPolicyResponse source) {
ScalingPolicy policy = new ScalingPolicy();
policy.setAdjustmentType(source.getAdjustmentType());
policy.setName(source.getName());
policy.setScalingAdjustment(source.getScalingAdjustment());
policy.setHostGroup(source.getHostGroup());
return policy;
}
use of com.sequenceiq.periscope.domain.ScalingPolicy in project cloudbreak by hortonworks.
the class ScalingService method getScalingPolicy.
private ScalingPolicy getScalingPolicy(Long clusterId, Long policyId) {
ScalingPolicy policy = policyRepository.findByCluster(clusterId, policyId);
if (policy == null) {
throw new NotFoundException("Scaling policy not found");
}
alertService.getBaseAlert(clusterId, policy.getAlertId());
return policy;
}
Aggregations