AWS SDK Version 2 for .NET
API Reference

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.

.NET Framework 4.5
 
This class provides helper methods for creating common Elastic MapReduce step types. To use StepFactory, you should construct it with the appropriate bucket for your region. The official bucket format is "<region>.elasticmapreduce", so us-east-1 would use the bucket "us-east-1.elasticmapreduce".

Inheritance Hierarchy

System.Object
  Amazon.ElasticMapReduce.Model.StepFactory

Namespace: Amazon.ElasticMapReduce.Model
Assembly: AWSSDK.dll
Version: (assembly version)

Syntax

C#
public class StepFactory : Object

The StepFactory type exposes the following members

Constructors

NameDescription
Public Method StepFactory(string) Constructor that gets its resources from the S3 bucket specified
Public Method StepFactory(RegionEndpoint) Constructor that gets its resources EMR bucket in the specified region.
Public Method StepFactory() Default constructor that gets its resources from the S3 in us-east-1.

Methods

NameDescription
Public Method NewEnableDebuggingStep() When run as the first step in your job flow, enables the Hadoop debugging UI in the AWS Management Console.
Public Method NewInstallHiveStep(HiveVersion[])
Public Method NewInstallHiveStep() Step that installs Hive on your job flow.
Public Method NewInstallPigStep() Step that installs Pig on your job flow.
Public Method NewRunHiveScriptStep(string, String[]) Step that runs a Hive script on your job flow.
Public Method NewRunHiveScriptStepVersioned(string, string, String[]) Step that runs a Hive script on your job flow with a specific verson of Hive.
Public Method NewRunPigScriptStep(string, String[]) Step that runs a Pig script on your job flow.
Public Method NewScriptRunnerStep(string, String[]) Runs a specified script on the master node of your cluster.

Examples

Create an interactive Hive job flow with debugging enabled:
 IAmazonElasticMapReduce emr = AWSClientFactory.CreateAmazonElasticMapReduceClient(accessKey, secretKey);
            
 StepFactory stepFactory = new StepFactory();
            
 StepConfig enableDebugging = new StepConfig {
    Name = "Enable Debugging",
    ActionOnFailure = "TERMINATE_JOB_FLOW",
    HadoopJarStep = stepFactory.NewEnableDebuggingStep()
 };
            
 StepConfig installHive = new StepConfig {
    Name = "Install Hive",
    ActionOnFailure = "TERMINATE_JOB_FLOW",
    HadoopJarStep = stepFactory.NewInstallHiveStep()
 };
              
 RunJobFlowRequest request = new RunJobFlowRequest {
    Name = "Hive Interactive",
    Steps = new List<StepConfig> { enableDebugging, installHive },
    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);
             

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

.NET for Windows Store apps:
Supported in: Windows 8