
com.amazonaws.services.elasticmapreduce.model.RunJobFlowRequest Maven / Gradle / Ivy
/*
* Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.elasticmapreduce.model;
import com.amazonaws.AmazonWebServiceRequest;
/**
* Container for the parameters to the {@link com.amazonaws.services.elasticmapreduce.AmazonElasticMapReduce#runJobFlow(RunJobFlowRequest) RunJobFlow operation}.
*
* RunJobFlow creates and starts running a new job flow. The job flow
* will run the steps specified. Once the job flow completes, the cluster
* is stopped and the HDFS partition is lost. To prevent loss of data,
* configure the last step of the job flow to store results in Amazon
* S3. If the JobFlowInstancesDetail : KeepJobFlowAliveWhenNoSteps
* parameter is set to TRUE
, the job flow will transition
* to the WAITING state rather than shutting down once the steps have
* completed.
*
*
* A maximum of 256 steps are allowed in each job flow.
*
*
* For long running job flows, we recommended that you periodically store
* your results.
*
*
* @see com.amazonaws.services.elasticmapreduce.AmazonElasticMapReduce#runJobFlow(RunJobFlowRequest)
*/
public class RunJobFlowRequest extends AmazonWebServiceRequest {
/**
* The name of the job flow.
*
* Constraints:
* Length: 0 - 256
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*/
private String name;
/**
* Specifies the location in Amazon S3 to write the log files of the job
* flow. If a value is not provided, logs are not created.
*
* Constraints:
* Length: 0 - 10280
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*/
private String logUri;
/**
* A JSON string for selecting additional features.
*
* Constraints:
* Length: 0 - 10280
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*/
private String additionalInfo;
/**
* A specification of the number and type of Amazon EC2 instances on
* which to run the job flow.
*/
private JobFlowInstancesConfig instances;
/**
* A list of steps to be executed by the job flow.
*/
private java.util.List steps;
/**
* A list of bootstrap actions that will be run before Hadoop is started
* on the cluster nodes.
*/
private java.util.List bootstrapActions;
/**
* Default constructor for a new RunJobFlowRequest object. Callers should use the
* setter or fluent setter (with...) methods to initialize this object after creating it.
*/
public RunJobFlowRequest() {}
/**
* Constructs a new RunJobFlowRequest object.
* Callers should use the setter or fluent setter (with...) methods to
* initialize any additional object members.
*
* @param name The name of the job flow.
* @param instances A specification of the number and type of Amazon EC2
* instances on which to run the job flow.
*/
public RunJobFlowRequest(String name, JobFlowInstancesConfig instances) {
this.name = name;
this.instances = instances;
}
/**
* The name of the job flow.
*
* Constraints:
* Length: 0 - 256
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*
* @return The name of the job flow.
*/
public String getName() {
return name;
}
/**
* The name of the job flow.
*
* Constraints:
* Length: 0 - 256
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*
* @param name The name of the job flow.
*/
public void setName(String name) {
this.name = name;
}
/**
* The name of the job flow.
*
* Returns a reference to this object so that method calls can be chained together.
*
* Constraints:
* Length: 0 - 256
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*
* @param name The name of the job flow.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public RunJobFlowRequest withName(String name) {
this.name = name;
return this;
}
/**
* Specifies the location in Amazon S3 to write the log files of the job
* flow. If a value is not provided, logs are not created.
*
* Constraints:
* Length: 0 - 10280
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*
* @return Specifies the location in Amazon S3 to write the log files of the job
* flow. If a value is not provided, logs are not created.
*/
public String getLogUri() {
return logUri;
}
/**
* Specifies the location in Amazon S3 to write the log files of the job
* flow. If a value is not provided, logs are not created.
*
* Constraints:
* Length: 0 - 10280
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*
* @param logUri Specifies the location in Amazon S3 to write the log files of the job
* flow. If a value is not provided, logs are not created.
*/
public void setLogUri(String logUri) {
this.logUri = logUri;
}
/**
* Specifies the location in Amazon S3 to write the log files of the job
* flow. If a value is not provided, logs are not created.
*
* Returns a reference to this object so that method calls can be chained together.
*
* Constraints:
* Length: 0 - 10280
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*
* @param logUri Specifies the location in Amazon S3 to write the log files of the job
* flow. If a value is not provided, logs are not created.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public RunJobFlowRequest withLogUri(String logUri) {
this.logUri = logUri;
return this;
}
/**
* A JSON string for selecting additional features.
*
* Constraints:
* Length: 0 - 10280
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*
* @return A JSON string for selecting additional features.
*/
public String getAdditionalInfo() {
return additionalInfo;
}
/**
* A JSON string for selecting additional features.
*
* Constraints:
* Length: 0 - 10280
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*
* @param additionalInfo A JSON string for selecting additional features.
*/
public void setAdditionalInfo(String additionalInfo) {
this.additionalInfo = additionalInfo;
}
/**
* A JSON string for selecting additional features.
*
* Returns a reference to this object so that method calls can be chained together.
*
* Constraints:
* Length: 0 - 10280
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*
* @param additionalInfo A JSON string for selecting additional features.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public RunJobFlowRequest withAdditionalInfo(String additionalInfo) {
this.additionalInfo = additionalInfo;
return this;
}
/**
* A specification of the number and type of Amazon EC2 instances on
* which to run the job flow.
*
* @return A specification of the number and type of Amazon EC2 instances on
* which to run the job flow.
*/
public JobFlowInstancesConfig getInstances() {
return instances;
}
/**
* A specification of the number and type of Amazon EC2 instances on
* which to run the job flow.
*
* @param instances A specification of the number and type of Amazon EC2 instances on
* which to run the job flow.
*/
public void setInstances(JobFlowInstancesConfig instances) {
this.instances = instances;
}
/**
* A specification of the number and type of Amazon EC2 instances on
* which to run the job flow.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param instances A specification of the number and type of Amazon EC2 instances on
* which to run the job flow.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public RunJobFlowRequest withInstances(JobFlowInstancesConfig instances) {
this.instances = instances;
return this;
}
/**
* A list of steps to be executed by the job flow.
*
* @return A list of steps to be executed by the job flow.
*/
public java.util.List getSteps() {
if (steps == null) {
steps = new java.util.ArrayList();
}
return steps;
}
/**
* A list of steps to be executed by the job flow.
*
* @param steps A list of steps to be executed by the job flow.
*/
public void setSteps(java.util.Collection steps) {
java.util.List stepsCopy = new java.util.ArrayList();
if (steps != null) {
stepsCopy.addAll(steps);
}
this.steps = stepsCopy;
}
/**
* A list of steps to be executed by the job flow.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param steps A list of steps to be executed by the job flow.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public RunJobFlowRequest withSteps(StepConfig... steps) {
for (StepConfig value : steps) {
getSteps().add(value);
}
return this;
}
/**
* A list of steps to be executed by the job flow.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param steps A list of steps to be executed by the job flow.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public RunJobFlowRequest withSteps(java.util.Collection steps) {
java.util.List stepsCopy = new java.util.ArrayList();
if (steps != null) {
stepsCopy.addAll(steps);
}
this.steps = stepsCopy;
return this;
}
/**
* A list of bootstrap actions that will be run before Hadoop is started
* on the cluster nodes.
*
* @return A list of bootstrap actions that will be run before Hadoop is started
* on the cluster nodes.
*/
public java.util.List getBootstrapActions() {
if (bootstrapActions == null) {
bootstrapActions = new java.util.ArrayList();
}
return bootstrapActions;
}
/**
* A list of bootstrap actions that will be run before Hadoop is started
* on the cluster nodes.
*
* @param bootstrapActions A list of bootstrap actions that will be run before Hadoop is started
* on the cluster nodes.
*/
public void setBootstrapActions(java.util.Collection bootstrapActions) {
java.util.List bootstrapActionsCopy = new java.util.ArrayList();
if (bootstrapActions != null) {
bootstrapActionsCopy.addAll(bootstrapActions);
}
this.bootstrapActions = bootstrapActionsCopy;
}
/**
* A list of bootstrap actions that will be run before Hadoop is started
* on the cluster nodes.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param bootstrapActions A list of bootstrap actions that will be run before Hadoop is started
* on the cluster nodes.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public RunJobFlowRequest withBootstrapActions(BootstrapActionConfig... bootstrapActions) {
for (BootstrapActionConfig value : bootstrapActions) {
getBootstrapActions().add(value);
}
return this;
}
/**
* A list of bootstrap actions that will be run before Hadoop is started
* on the cluster nodes.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param bootstrapActions A list of bootstrap actions that will be run before Hadoop is started
* on the cluster nodes.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public RunJobFlowRequest withBootstrapActions(java.util.Collection bootstrapActions) {
java.util.List bootstrapActionsCopy = new java.util.ArrayList();
if (bootstrapActions != null) {
bootstrapActionsCopy.addAll(bootstrapActions);
}
this.bootstrapActions = bootstrapActionsCopy;
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
sb.append("Name: " + name + ", ");
sb.append("LogUri: " + logUri + ", ");
sb.append("AdditionalInfo: " + additionalInfo + ", ");
sb.append("Instances: " + instances + ", ");
sb.append("Steps: " + steps + ", ");
sb.append("BootstrapActions: " + bootstrapActions + ", ");
sb.append("}");
return sb.toString();
}
}