|
Did this page help you?Yes No Tell us about it... |
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectcom.amazonaws.services.elasticmapreduce.util.StreamingStep
public class StreamingStep
Class that makes it easy to define Hadoop Streaming steps.
See also: Hadoop Streaming
AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
AmazonElasticMapReduce emr = new AmazonElasticMapReduceClient(credentials);
HadoopJarStepConfig config = new StreamingStep()
.withInputs("s3://elasticmapreduce/samples/wordcount/input")
.withOutput("s3://my-bucket/output/")
.withMapper("s3://elasticmapreduce/samples/wordcount/wordSplitter.py")
.withReducer("aggregate")
.toHadoopJarStepConfig();
StepConfig wordCount = new StepConfig()
.withName("Word Count")
.withActionOnFailure("TERMINATE_JOB_FLOW")
.withHadoopJarStep(config);
RunJobFlowRequest request = new RunJobFlowRequest()
.withName("Word Count")
.withSteps(wordCount)
.withLogUri("s3://log-bucket/")
.withInstances(new JobFlowInstancesConfig()
.withEc2KeyName("keypairt")
.withHadoopVersion("0.20")
.withInstanceCount(5)
.withKeepJobFlowAliveWhenNoSteps(true)
.withMasterInstanceType("m1.small")
.withSlaveInstanceType("m1.small"));
RunJobFlowResult result = emr.runJobFlow(request);
| Constructor Summary | |
|---|---|
StreamingStep()
Creates a new default StreamingStep. |
|
| Method Summary | |
|---|---|
Map<String,String> |
getHadoopConfig()
Get the Hadoop config overrides (-D values). |
List<String> |
getInputs()
Get list of step input paths. |
String |
getMapper()
Get the mapper. |
String |
getOutput()
Get output path. |
String |
getReducer()
Get the reducer |
void |
setHadoopConfig(Map<String,String> hadoopConfig)
Set the Hadoop config overrides (-D values). |
void |
setInputs(Collection<String> inputs)
Set the list of step input paths. |
void |
setMapper(String mapper)
Set the mapper. |
void |
setOutput(String output)
Set the output path for this step. |
void |
setReducer(String reducer)
Set the reducer |
HadoopJarStepConfig |
toHadoopJarStepConfig()
Creates the final HadoopJarStepConfig once you are done configuring the step. |
StreamingStep |
withHadoopConfig(String key,
String value)
Add a Hadoop config override (-D value). |
StreamingStep |
withInputs(String... inputs)
Add more input paths to this step. |
StreamingStep |
withMapper(String mapper)
Set the mapper |
StreamingStep |
withOutput(String output)
Set the output path for this step. |
StreamingStep |
withReducer(String reducer)
Set the reducer |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StreamingStep()
| Method Detail |
|---|
public List<String> getInputs()
public void setInputs(Collection<String> inputs)
inputs - List of step inputs.public StreamingStep withInputs(String... inputs)
inputs - A list of inputs to this step.
public String getOutput()
public void setOutput(String output)
output - Output path.public StreamingStep withOutput(String output)
output - Output path
public String getMapper()
public void setMapper(String mapper)
mapper - Mapperpublic StreamingStep withMapper(String mapper)
mapper - Mapper
public String getReducer()
public void setReducer(String reducer)
reducer - Reducerpublic StreamingStep withReducer(String reducer)
reducer - Reducer
public Map<String,String> getHadoopConfig()
public void setHadoopConfig(Map<String,String> hadoopConfig)
hadoopConfig - Hadoop config.
public StreamingStep withHadoopConfig(String key,
String value)
key - Hadoop configuration key.value - Configuration value.
public HadoopJarStepConfig toHadoopJarStepConfig()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||