コード例 #1
0
        public IncreaseDecreaseResult GetNewDecreaseCombinationModifierCapacityUnits(ProvisionedThroughputDescription current_provisioned_throughput)
        {
            IncreaseDecreaseResult decrease_combination_modifier_result = null;

            if (decrease != null && (decrease_combination_modifier.measurement_units > 0 || decrease_combination_modifier.measurement_percentage > 0))
            {
                Decrease combination_decrease = new Decrease(decrease, decrease_combination_modifier);
                decrease_combination_modifier_result = combination_decrease.ApplyRule(consumed_capacity_units, current_capacity_units, current_provisioned_throughput);
            }

            return(decrease_combination_modifier_result);
        }
コード例 #2
0
        public IncreaseDecreaseResult ApplyRule(long consumed_capacity_units, long current_capacity_units, ProvisionedThroughputDescription current_provisioned_throughput)
        {
            bool threshold_met      = false;
            bool blocked_out        = false;
            long?new_capacity_units = null;

            threshold_met = ThresholdMet(consumed_capacity_units, current_capacity_units);
            if (threshold_met)
            {
                blocked_out = IsBlockedOut(current_provisioned_throughput);
                if (!blocked_out)
                {
                    new_capacity_units = GetNewCapacityUnits(current_capacity_units);
                }
            }

            IncreaseDecreaseResult increase_decrease_result = new IncreaseDecreaseResult(threshold, amount, threshold_met, blocked_out, new_capacity_units);

            return(increase_decrease_result);
        }