// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.gcp.dataproc.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import java.lang.Double;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class AutoscalingPolicyBasicAlgorithmYarnConfigArgs extends com.pulumi.resources.ResourceArgs {

    public static final AutoscalingPolicyBasicAlgorithmYarnConfigArgs Empty = new AutoscalingPolicyBasicAlgorithmYarnConfigArgs();

    /**
     * Timeout for YARN graceful decommissioning of Node Managers. Specifies the
     * duration to wait for jobs to complete before forcefully removing workers
     * (and potentially interrupting jobs). Only applicable to downscaling operations.
     * Bounds: [0s, 1d].
     * 
     */
    @Import(name="gracefulDecommissionTimeout", required=true)
    private Output<String> gracefulDecommissionTimeout;

    /**
     * @return Timeout for YARN graceful decommissioning of Node Managers. Specifies the
     * duration to wait for jobs to complete before forcefully removing workers
     * (and potentially interrupting jobs). Only applicable to downscaling operations.
     * Bounds: [0s, 1d].
     * 
     */
    public Output<String> gracefulDecommissionTimeout() {
        return this.gracefulDecommissionTimeout;
    }

    /**
     * Fraction of average pending memory in the last cooldown period for which to
     * remove workers. A scale-down factor of 1 will result in scaling down so that there
     * is no available memory remaining after the update (more aggressive scaling).
     * A scale-down factor of 0 disables removing workers, which can be beneficial for
     * autoscaling a single job.
     * Bounds: [0.0, 1.0].
     * 
     */
    @Import(name="scaleDownFactor", required=true)
    private Output<Double> scaleDownFactor;

    /**
     * @return Fraction of average pending memory in the last cooldown period for which to
     * remove workers. A scale-down factor of 1 will result in scaling down so that there
     * is no available memory remaining after the update (more aggressive scaling).
     * A scale-down factor of 0 disables removing workers, which can be beneficial for
     * autoscaling a single job.
     * Bounds: [0.0, 1.0].
     * 
     */
    public Output<Double> scaleDownFactor() {
        return this.scaleDownFactor;
    }

    /**
     * Minimum scale-down threshold as a fraction of total cluster size before scaling occurs.
     * For example, in a 20-worker cluster, a threshold of 0.1 means the autoscaler must
     * recommend at least a 2 worker scale-down for the cluster to scale. A threshold of 0
     * means the autoscaler will scale down on any recommended change.
     * Bounds: [0.0, 1.0]. Default: 0.0.
     * 
     */
    @Import(name="scaleDownMinWorkerFraction")
    private @Nullable Output<Double> scaleDownMinWorkerFraction;

    /**
     * @return Minimum scale-down threshold as a fraction of total cluster size before scaling occurs.
     * For example, in a 20-worker cluster, a threshold of 0.1 means the autoscaler must
     * recommend at least a 2 worker scale-down for the cluster to scale. A threshold of 0
     * means the autoscaler will scale down on any recommended change.
     * Bounds: [0.0, 1.0]. Default: 0.0.
     * 
     */
    public Optional<Output<Double>> scaleDownMinWorkerFraction() {
        return Optional.ofNullable(this.scaleDownMinWorkerFraction);
    }

    /**
     * Fraction of average pending memory in the last cooldown period for which to
     * add workers. A scale-up factor of 1.0 will result in scaling up so that there
     * is no pending memory remaining after the update (more aggressive scaling).
     * A scale-up factor closer to 0 will result in a smaller magnitude of scaling up
     * (less aggressive scaling).
     * Bounds: [0.0, 1.0].
     * 
     */
    @Import(name="scaleUpFactor", required=true)
    private Output<Double> scaleUpFactor;

    /**
     * @return Fraction of average pending memory in the last cooldown period for which to
     * add workers. A scale-up factor of 1.0 will result in scaling up so that there
     * is no pending memory remaining after the update (more aggressive scaling).
     * A scale-up factor closer to 0 will result in a smaller magnitude of scaling up
     * (less aggressive scaling).
     * Bounds: [0.0, 1.0].
     * 
     */
    public Output<Double> scaleUpFactor() {
        return this.scaleUpFactor;
    }

    /**
     * Minimum scale-up threshold as a fraction of total cluster size before scaling
     * occurs. For example, in a 20-worker cluster, a threshold of 0.1 means the autoscaler
     * must recommend at least a 2-worker scale-up for the cluster to scale. A threshold of
     * 0 means the autoscaler will scale up on any recommended change.
     * Bounds: [0.0, 1.0]. Default: 0.0.
     * 
     */
    @Import(name="scaleUpMinWorkerFraction")
    private @Nullable Output<Double> scaleUpMinWorkerFraction;

    /**
     * @return Minimum scale-up threshold as a fraction of total cluster size before scaling
     * occurs. For example, in a 20-worker cluster, a threshold of 0.1 means the autoscaler
     * must recommend at least a 2-worker scale-up for the cluster to scale. A threshold of
     * 0 means the autoscaler will scale up on any recommended change.
     * Bounds: [0.0, 1.0]. Default: 0.0.
     * 
     */
    public Optional<Output<Double>> scaleUpMinWorkerFraction() {
        return Optional.ofNullable(this.scaleUpMinWorkerFraction);
    }

    private AutoscalingPolicyBasicAlgorithmYarnConfigArgs() {}

    private AutoscalingPolicyBasicAlgorithmYarnConfigArgs(AutoscalingPolicyBasicAlgorithmYarnConfigArgs $) {
        this.gracefulDecommissionTimeout = $.gracefulDecommissionTimeout;
        this.scaleDownFactor = $.scaleDownFactor;
        this.scaleDownMinWorkerFraction = $.scaleDownMinWorkerFraction;
        this.scaleUpFactor = $.scaleUpFactor;
        this.scaleUpMinWorkerFraction = $.scaleUpMinWorkerFraction;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(AutoscalingPolicyBasicAlgorithmYarnConfigArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private AutoscalingPolicyBasicAlgorithmYarnConfigArgs $;

        public Builder() {
            $ = new AutoscalingPolicyBasicAlgorithmYarnConfigArgs();
        }

        public Builder(AutoscalingPolicyBasicAlgorithmYarnConfigArgs defaults) {
            $ = new AutoscalingPolicyBasicAlgorithmYarnConfigArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param gracefulDecommissionTimeout Timeout for YARN graceful decommissioning of Node Managers. Specifies the
         * duration to wait for jobs to complete before forcefully removing workers
         * (and potentially interrupting jobs). Only applicable to downscaling operations.
         * Bounds: [0s, 1d].
         * 
         * @return builder
         * 
         */
        public Builder gracefulDecommissionTimeout(Output<String> gracefulDecommissionTimeout) {
            $.gracefulDecommissionTimeout = gracefulDecommissionTimeout;
            return this;
        }

        /**
         * @param gracefulDecommissionTimeout Timeout for YARN graceful decommissioning of Node Managers. Specifies the
         * duration to wait for jobs to complete before forcefully removing workers
         * (and potentially interrupting jobs). Only applicable to downscaling operations.
         * Bounds: [0s, 1d].
         * 
         * @return builder
         * 
         */
        public Builder gracefulDecommissionTimeout(String gracefulDecommissionTimeout) {
            return gracefulDecommissionTimeout(Output.of(gracefulDecommissionTimeout));
        }

        /**
         * @param scaleDownFactor Fraction of average pending memory in the last cooldown period for which to
         * remove workers. A scale-down factor of 1 will result in scaling down so that there
         * is no available memory remaining after the update (more aggressive scaling).
         * A scale-down factor of 0 disables removing workers, which can be beneficial for
         * autoscaling a single job.
         * Bounds: [0.0, 1.0].
         * 
         * @return builder
         * 
         */
        public Builder scaleDownFactor(Output<Double> scaleDownFactor) {
            $.scaleDownFactor = scaleDownFactor;
            return this;
        }

        /**
         * @param scaleDownFactor Fraction of average pending memory in the last cooldown period for which to
         * remove workers. A scale-down factor of 1 will result in scaling down so that there
         * is no available memory remaining after the update (more aggressive scaling).
         * A scale-down factor of 0 disables removing workers, which can be beneficial for
         * autoscaling a single job.
         * Bounds: [0.0, 1.0].
         * 
         * @return builder
         * 
         */
        public Builder scaleDownFactor(Double scaleDownFactor) {
            return scaleDownFactor(Output.of(scaleDownFactor));
        }

        /**
         * @param scaleDownMinWorkerFraction Minimum scale-down threshold as a fraction of total cluster size before scaling occurs.
         * For example, in a 20-worker cluster, a threshold of 0.1 means the autoscaler must
         * recommend at least a 2 worker scale-down for the cluster to scale. A threshold of 0
         * means the autoscaler will scale down on any recommended change.
         * Bounds: [0.0, 1.0]. Default: 0.0.
         * 
         * @return builder
         * 
         */
        public Builder scaleDownMinWorkerFraction(@Nullable Output<Double> scaleDownMinWorkerFraction) {
            $.scaleDownMinWorkerFraction = scaleDownMinWorkerFraction;
            return this;
        }

        /**
         * @param scaleDownMinWorkerFraction Minimum scale-down threshold as a fraction of total cluster size before scaling occurs.
         * For example, in a 20-worker cluster, a threshold of 0.1 means the autoscaler must
         * recommend at least a 2 worker scale-down for the cluster to scale. A threshold of 0
         * means the autoscaler will scale down on any recommended change.
         * Bounds: [0.0, 1.0]. Default: 0.0.
         * 
         * @return builder
         * 
         */
        public Builder scaleDownMinWorkerFraction(Double scaleDownMinWorkerFraction) {
            return scaleDownMinWorkerFraction(Output.of(scaleDownMinWorkerFraction));
        }

        /**
         * @param scaleUpFactor Fraction of average pending memory in the last cooldown period for which to
         * add workers. A scale-up factor of 1.0 will result in scaling up so that there
         * is no pending memory remaining after the update (more aggressive scaling).
         * A scale-up factor closer to 0 will result in a smaller magnitude of scaling up
         * (less aggressive scaling).
         * Bounds: [0.0, 1.0].
         * 
         * @return builder
         * 
         */
        public Builder scaleUpFactor(Output<Double> scaleUpFactor) {
            $.scaleUpFactor = scaleUpFactor;
            return this;
        }

        /**
         * @param scaleUpFactor Fraction of average pending memory in the last cooldown period for which to
         * add workers. A scale-up factor of 1.0 will result in scaling up so that there
         * is no pending memory remaining after the update (more aggressive scaling).
         * A scale-up factor closer to 0 will result in a smaller magnitude of scaling up
         * (less aggressive scaling).
         * Bounds: [0.0, 1.0].
         * 
         * @return builder
         * 
         */
        public Builder scaleUpFactor(Double scaleUpFactor) {
            return scaleUpFactor(Output.of(scaleUpFactor));
        }

        /**
         * @param scaleUpMinWorkerFraction Minimum scale-up threshold as a fraction of total cluster size before scaling
         * occurs. For example, in a 20-worker cluster, a threshold of 0.1 means the autoscaler
         * must recommend at least a 2-worker scale-up for the cluster to scale. A threshold of
         * 0 means the autoscaler will scale up on any recommended change.
         * Bounds: [0.0, 1.0]. Default: 0.0.
         * 
         * @return builder
         * 
         */
        public Builder scaleUpMinWorkerFraction(@Nullable Output<Double> scaleUpMinWorkerFraction) {
            $.scaleUpMinWorkerFraction = scaleUpMinWorkerFraction;
            return this;
        }

        /**
         * @param scaleUpMinWorkerFraction Minimum scale-up threshold as a fraction of total cluster size before scaling
         * occurs. For example, in a 20-worker cluster, a threshold of 0.1 means the autoscaler
         * must recommend at least a 2-worker scale-up for the cluster to scale. A threshold of
         * 0 means the autoscaler will scale up on any recommended change.
         * Bounds: [0.0, 1.0]. Default: 0.0.
         * 
         * @return builder
         * 
         */
        public Builder scaleUpMinWorkerFraction(Double scaleUpMinWorkerFraction) {
            return scaleUpMinWorkerFraction(Output.of(scaleUpMinWorkerFraction));
        }

        public AutoscalingPolicyBasicAlgorithmYarnConfigArgs build() {
            $.gracefulDecommissionTimeout = Objects.requireNonNull($.gracefulDecommissionTimeout, "expected parameter 'gracefulDecommissionTimeout' to be non-null");
            $.scaleDownFactor = Objects.requireNonNull($.scaleDownFactor, "expected parameter 'scaleDownFactor' to be non-null");
            $.scaleUpFactor = Objects.requireNonNull($.scaleUpFactor, "expected parameter 'scaleUpFactor' to be non-null");
            return $;
        }
    }

}
