AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey); IAmazonElasticMapReduce emr = new AmazonElasticMapReduceClient(credentials); var resize = new ResizeJobFlowStep { OnArrested = OnArrested.Continue, OnFailure = OnFailure.Continue }; resize.AddResizeAction(new AddInstanceGroup { InstanceGroup = "core", InstanceCount = 10 }); resize.AddResizeAction(new AddInstanceGroup { InstanceGroup = "task", InstanceCount = 10, WithInstanceType = "m1.small" }); HadoopJarStepConfig config = resize.ToHadoopJarStepConfig(); StepConfig resizeJobFlow = new StepConfig { Name = "Resize job flow", ActionOnFailure = "TERMINATE_JOB_FLOW", HadoopJarStep = config, }; RunJobFlowRequest request = new RunJobFlowRequest { Name = "Resize job flow", Steps = new List<StepConfig> { resizeJobFlow }, LogUri = "s3://log-bucket/", Instances = new JobFlowInstancesConfig { Ec2KeyName = "keypair", HadoopVersion = "0.20", InstanceCount = 5, KeepJobFlowAliveWhenNoSteps = true, MasterInstanceType = "m1.small", SlaveInstanceType = "m1.small" } }; RunJobFlowResponse response = emr.RunJobFlow(request);
Namespace: Amazon.ElasticMapReduce.Model
Assembly: AWSSDK.dll
Version: (assembly version)
public class ResizeJobFlowStep : Object
The ResizeJobFlowStep type exposes the following members
Name | Description | |
---|---|---|
ResizeJobFlowStep() | Creates a new ResizeJobFlowStep using the default Elastic Map Reduce bucket (us-east-1.elasticmapreduce) for the default (us-east-1) region. | |
ResizeJobFlowStep(string) |
Creates a new ResizeJobFlowStep using the specified Amazon S3 bucket to
load resources.
The official bucket format is "<region>.elasticmapreduce", so if you're using the us-east-1 region, you should use the bucket "us-east-1.elasticmapreduce". |
Name | Type | Description | |
---|---|---|---|
OnArrested | System.Nullable<Amazon.ElasticMapReduce.Model.OnArrested> | What action this step should take if any of the instance group modifications result in the instance group entering Arrested state. This can happen when the bootstrap actions on the newly launched instances are continuously failing. | |
OnFailure | System.Nullable<Amazon.ElasticMapReduce.Model.OnFailure> | What action this step should take if the modification fails. This can happen when you request to perform an invalid action, such as shrink a core instance group. | |
Wait | System.Boolean | Whether the step should wait for the modification to complete or if it should just continue onto the next step once the modification request is received. Defaults to true. |
Name | Description | |
---|---|---|
AddResizeAction(ResizeAction) | Add a new action for this step to perform. These actions can be to modify or add instance groups. This step supports multiple actions, but requires at least one be specified. | |
ToHadoopJarStepConfig() | Creates the final HadoopJarStepConfig once you are done configuring the step. You can use this as you would any other HadoopJarStepConfig. |
.NET Framework:
Supported in: 4.5, 4.0, 3.5
.NET for Windows Store apps:
Supported in: Windows 8