public class BootstrapActions extends Object
 AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
 AmazonElasticMapReduce emr = new AmazonElasticMapReduceClient(credentials);
 BootstrapActions bootstrapActions = new BootstrapActions();
 RunJobFlowRequest request = new RunJobFlowRequest()
       .withName("Job Flow With Bootstrap Actions")
       .withBootstrapActions(
             bootstrapActions.newRunIf(
                 "instance.isMaster=true",
                 bootstrapActions.newConfigureDaemons()
                     .withHeapSize(Daemon.JobTracker, 2048)
                     .build()))
       .withLogUri("s3://log-bucket/")
       .withInstances(new JobFlowInstancesConfig()
            .withEc2KeyName("keypair")
            .withHadoopVersion("0.20")
            .withInstanceCount(5)
            .withKeepJobFlowAliveWhenNoSteps(true)
            .withMasterInstanceType("m1.small")
            .withSlaveInstanceType("m1.small"));
 RunJobFlowResult result = emr.runJobFlow(request);
 | Modifier and Type | Class and Description | 
|---|---|
| static class  | BootstrapActions.ConfigFileEnum specifying all valid config files. | 
| class  | BootstrapActions.ConfigureDaemons | 
| class  | BootstrapActions.ConfigureHadoop | 
| static class  | BootstrapActions.DaemonList of Hadoop daemons which can be configured. | 
| Constructor and Description | 
|---|
| BootstrapActions()Creates a new default BootstrapActions for us in us-east-1. | 
| BootstrapActions(String bucket)Creates a new BootstrapActions. | 
| Modifier and Type | Method and Description | 
|---|---|
| BootstrapActions.ConfigureDaemons | newConfigureDaemons()Create a new bootstrap action which lets you configure Hadoop's daemons. | 
| BootstrapActions.ConfigureHadoop | newConfigureHadoop()Create a new bootstrap action which lets you configure Hadoop's XML files. | 
| BootstrapActionConfig | newRunIf(String condition,
        BootstrapActionConfig config)Create a new run-if bootstrap action which lets you conditionally run bootstrap actions. | 
public BootstrapActions()
public BootstrapActions(String bucket)
bucket - the bucket from which to download the bootstrap actions.public BootstrapActionConfig newRunIf(String condition, BootstrapActionConfig config)
condition - The condition to evaluate, if true the bootstrap action executes.config - The bootstrap action to execute in case of successful evaluation.public BootstrapActions.ConfigureHadoop newConfigureHadoop()
public BootstrapActions.ConfigureDaemons newConfigureDaemons()
Copyright © 2015. All rights reserved.