Skip to content

Commit

Permalink
Advanced Scaling in Amazon EMR Managed Scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-sdk-dotnet-automation committed Nov 22, 2024
1 parent c5e7c57 commit 280da5f
Show file tree
Hide file tree
Showing 8 changed files with 169 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2344,7 +2344,9 @@
"ManagedScalingPolicy":{
"type":"structure",
"members":{
"ComputeLimits":{"shape":"ComputeLimits"}
"ComputeLimits":{"shape":"ComputeLimits"},
"UtilizationPerformanceIndex":{"shape":"UtilizationPerformanceIndexInteger"},
"ScalingStrategy":{"shape":"ScalingStrategy"}
}
},
"Marker":{"type":"string"},
Expand Down Expand Up @@ -2831,6 +2833,13 @@
"type":"list",
"member":{"shape":"ScalingRule"}
},
"ScalingStrategy":{
"type":"string",
"enum":[
"DEFAULT",
"ADVANCED"
]
},
"ScalingTrigger":{
"type":"structure",
"required":["CloudWatchAlarmDefinition"],
Expand Down Expand Up @@ -3360,6 +3369,11 @@
},
"sensitive":true
},
"UtilizationPerformanceIndexInteger":{
"type":"integer",
"max":100,
"min":1
},
"VolumeSpecification":{
"type":"structure",
"required":[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1801,6 +1801,12 @@
"AutoScalingPolicyDescription$Rules": "<p>The scale-in and scale-out rules that comprise the automatic scaling policy.</p>"
}
},
"ScalingStrategy": {
"base": null,
"refs": {
"ManagedScalingPolicy$ScalingStrategy": "<p>Determines whether a custom scaling utilization performance index can be set. Possible values include <i>ADVANCED</i> or <i>DEFAULT</i>.</p>"
}
},
"ScalingTrigger": {
"base": "<p>The conditions that trigger an automatic scaling activity.</p>",
"refs": {
Expand Down Expand Up @@ -2275,6 +2281,12 @@
"Credentials$UsernamePassword": "<p>The username and password that you use to connect to cluster endpoints.</p>"
}
},
"UtilizationPerformanceIndexInteger": {
"base": null,
"refs": {
"ManagedScalingPolicy$UtilizationPerformanceIndex": "<p>An integer value that represents an advanced scaling strategy. Setting a higher value optimizes for performance. Setting a lower value optimizes for resource conservation. Setting the value to 50 balances performance and resource conservation. Possible values are 1, 25, 50, 75, and 100.</p>"
}
},
"VolumeSpecification": {
"base": "<p>EBS volume specifications such as volume type, IOPS, size (GiB) and throughput (MiB/s) that are requested for the EBS volume attached to an Amazon EC2 instance in the cluster.</p>",
"refs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3942,6 +3942,14 @@
"ComputeLimits":{
"shape":"ComputeLimits",
"documentation":"<p>The Amazon EC2 unit limits for a managed scaling policy. The managed scaling activity of a cluster is not allowed to go above or below these limits. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.</p>"
},
"UtilizationPerformanceIndex":{
"shape":"UtilizationPerformanceIndexInteger",
"documentation":"<p>An integer value that represents an advanced scaling strategy. Setting a higher value optimizes for performance. Setting a lower value optimizes for resource conservation. Setting the value to 50 balances performance and resource conservation. Possible values are 1, 25, 50, 75, and 100.</p>"
},
"ScalingStrategy":{
"shape":"ScalingStrategy",
"documentation":"<p>Determines whether a custom scaling utilization performance index can be set. Possible values include <i>ADVANCED</i> or <i>DEFAULT</i>.</p>"
}
},
"documentation":"<p> Managed scaling policy for an Amazon EMR cluster. The policy specifies the limits for resources that can be added or terminated from a cluster. The policy only applies to the core and task nodes. The master node cannot be scaled after initial configuration. </p>"
Expand Down Expand Up @@ -4801,6 +4809,13 @@
"type":"list",
"member":{"shape":"ScalingRule"}
},
"ScalingStrategy":{
"type":"string",
"enum":[
"DEFAULT",
"ADVANCED"
]
},
"ScalingTrigger":{
"type":"structure",
"required":["CloudWatchAlarmDefinition"],
Expand Down Expand Up @@ -5777,6 +5792,11 @@
"documentation":"<p>The username and password that you use to connect to cluster endpoints.</p>",
"sensitive":true
},
"UtilizationPerformanceIndexInteger":{
"type":"integer",
"max":100,
"min":1
},
"VolumeSpecification":{
"type":"structure",
"required":[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,11 @@
<min>0</min>
<max>10280</max>
</property-value-rule>
<property-value-rule>
<property>Amazon.ElasticMapReduce.Model.ManagedScalingPolicy.UtilizationPerformanceIndex</property>
<min>1</min>
<max>100</max>
</property-value-rule>
<property-value-rule>
<property>Amazon.ElasticMapReduce.Model.NotebookExecution.Arn</property>
<min>0</min>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ public void Marshall(ManagedScalingPolicy requestObject, JsonMarshallerContext c
context.Writer.WriteObjectEnd();
}

if(requestObject.IsSetScalingStrategy())
{
context.Writer.WritePropertyName("ScalingStrategy");
context.Writer.Write(requestObject.ScalingStrategy);
}

if(requestObject.IsSetUtilizationPerformanceIndex())
{
context.Writer.WritePropertyName("UtilizationPerformanceIndex");
context.Writer.Write(requestObject.UtilizationPerformanceIndex);
}

}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ public ManagedScalingPolicy Unmarshall(JsonUnmarshallerContext context)
unmarshalledObject.ComputeLimits = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("ScalingStrategy", targetDepth))
{
var unmarshaller = StringUnmarshaller.Instance;
unmarshalledObject.ScalingStrategy = unmarshaller.Unmarshall(context);
continue;
}
if (context.TestExpression("UtilizationPerformanceIndex", targetDepth))
{
var unmarshaller = IntUnmarshaller.Instance;
unmarshalledObject.UtilizationPerformanceIndex = unmarshaller.Unmarshall(context);
continue;
}
}
return unmarshalledObject;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ namespace Amazon.ElasticMapReduce.Model
public partial class ManagedScalingPolicy
{
private ComputeLimits _computeLimits;
private ScalingStrategy _scalingStrategy;
private int? _utilizationPerformanceIndex;

/// <summary>
/// Gets and sets the property ComputeLimits.
Expand All @@ -58,5 +60,46 @@ internal bool IsSetComputeLimits()
return this._computeLimits != null;
}

/// <summary>
/// Gets and sets the property ScalingStrategy.
/// <para>
/// Determines whether a custom scaling utilization performance index can be set. Possible
/// values include <i>ADVANCED</i> or <i>DEFAULT</i>.
/// </para>
/// </summary>
public ScalingStrategy ScalingStrategy
{
get { return this._scalingStrategy; }
set { this._scalingStrategy = value; }
}

// Check to see if ScalingStrategy property is set
internal bool IsSetScalingStrategy()
{
return this._scalingStrategy != null;
}

/// <summary>
/// Gets and sets the property UtilizationPerformanceIndex.
/// <para>
/// An integer value that represents an advanced scaling strategy. Setting a higher value
/// optimizes for performance. Setting a lower value optimizes for resource conservation.
/// Setting the value to 50 balances performance and resource conservation. Possible values
/// are 1, 25, 50, 75, and 100.
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=100)]
public int UtilizationPerformanceIndex
{
get { return this._utilizationPerformanceIndex.GetValueOrDefault(); }
set { this._utilizationPerformanceIndex = value; }
}

// Check to see if UtilizationPerformanceIndex property is set
internal bool IsSetUtilizationPerformanceIndex()
{
return this._utilizationPerformanceIndex.HasValue;
}

}
}
50 changes: 50 additions & 0 deletions sdk/src/Services/ElasticMapReduce/Generated/ServiceEnumerations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1972,6 +1972,56 @@ public static implicit operator ScaleDownBehavior(string value)
}


/// <summary>
/// Constants used for properties of type ScalingStrategy.
/// </summary>
public class ScalingStrategy : ConstantClass
{

/// <summary>
/// Constant ADVANCED for ScalingStrategy
/// </summary>
public static readonly ScalingStrategy ADVANCED = new ScalingStrategy("ADVANCED");
/// <summary>
/// Constant DEFAULT for ScalingStrategy
/// </summary>
public static readonly ScalingStrategy DEFAULT = new ScalingStrategy("DEFAULT");

/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public ScalingStrategy(string value)
: base(value)
{
}

/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static ScalingStrategy FindValue(string value)
{
return FindValue<ScalingStrategy>(value);
}

/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator ScalingStrategy(string value)
{
return FindValue(value);
}
}


/// <summary>
/// Constants used for properties of type SpotProvisioningAllocationStrategy.
/// </summary>
Expand Down

0 comments on commit 280da5f

Please sign in to comment.