/* * Copyright 2018-2023 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.emrcontainers.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* This entity describes a job run. A job run is a unit of work, such as a Spark jar, PySpark script, or SparkSQL query, * that you submit to Amazon EMR on EKS. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class JobRun implements Serializable, Cloneable, StructuredPojo { /** *

* The ID of the job run. *

*/ private String id; /** *

* The name of the job run. *

*/ private String name; /** *

* The ID of the job run's virtual cluster. *

*/ private String virtualClusterId; /** *

* The ARN of job run. *

*/ private String arn; /** *

* The state of the job run. *

*/ private String state; /** *

* The client token used to start a job run. *

*/ private String clientToken; /** *

* The execution role ARN of the job run. *

*/ private String executionRoleArn; /** *

* The release version of Amazon EMR. *

*/ private String releaseLabel; /** *

* The configuration settings that are used to override default configuration. *

*/ private ConfigurationOverrides configurationOverrides; /** *

* Parameters of job driver for the job run. *

*/ private JobDriver jobDriver; /** *

* The date and time when the job run was created. *

*/ private java.util.Date createdAt; /** *

* The user who created the job run. *

*/ private String createdBy; /** *

* The date and time when the job run has finished. *

*/ private java.util.Date finishedAt; /** *

* Additional details of the job run state. *

*/ private String stateDetails; /** *

* The reasons why the job run has failed. *

*/ private String failureReason; /** *

* The assigned tags of the job run. *

*/ private java.util.Map tags; /** *

* The configuration of the retry policy that the job runs on. *

*/ private RetryPolicyConfiguration retryPolicyConfiguration; /** *

* The current status of the retry policy executed on the job. *

*/ private RetryPolicyExecution retryPolicyExecution; /** *

* The ID of the job run. *

* * @param id * The ID of the job run. */ public void setId(String id) { this.id = id; } /** *

* The ID of the job run. *

* * @return The ID of the job run. */ public String getId() { return this.id; } /** *

* The ID of the job run. *

* * @param id * The ID of the job run. * @return Returns a reference to this object so that method calls can be chained together. */ public JobRun withId(String id) { setId(id); return this; } /** *

* The name of the job run. *

* * @param name * The name of the job run. */ public void setName(String name) { this.name = name; } /** *

* The name of the job run. *

* * @return The name of the job run. */ public String getName() { return this.name; } /** *

* The name of the job run. *

* * @param name * The name of the job run. * @return Returns a reference to this object so that method calls can be chained together. */ public JobRun withName(String name) { setName(name); return this; } /** *

* The ID of the job run's virtual cluster. *

* * @param virtualClusterId * The ID of the job run's virtual cluster. */ public void setVirtualClusterId(String virtualClusterId) { this.virtualClusterId = virtualClusterId; } /** *

* The ID of the job run's virtual cluster. *

* * @return The ID of the job run's virtual cluster. */ public String getVirtualClusterId() { return this.virtualClusterId; } /** *

* The ID of the job run's virtual cluster. *

* * @param virtualClusterId * The ID of the job run's virtual cluster. * @return Returns a reference to this object so that method calls can be chained together. */ public JobRun withVirtualClusterId(String virtualClusterId) { setVirtualClusterId(virtualClusterId); return this; } /** *

* The ARN of job run. *

* * @param arn * The ARN of job run. */ public void setArn(String arn) { this.arn = arn; } /** *

* The ARN of job run. *

* * @return The ARN of job run. */ public String getArn() { return this.arn; } /** *

* The ARN of job run. *

* * @param arn * The ARN of job run. * @return Returns a reference to this object so that method calls can be chained together. */ public JobRun withArn(String arn) { setArn(arn); return this; } /** *

* The state of the job run. *

* * @param state * The state of the job run. * @see JobRunState */ public void setState(String state) { this.state = state; } /** *

* The state of the job run. *

* * @return The state of the job run. * @see JobRunState */ public String getState() { return this.state; } /** *

* The state of the job run. *

* * @param state * The state of the job run. * @return Returns a reference to this object so that method calls can be chained together. * @see JobRunState */ public JobRun withState(String state) { setState(state); return this; } /** *

* The state of the job run. *

* * @param state * The state of the job run. * @return Returns a reference to this object so that method calls can be chained together. * @see JobRunState */ public JobRun withState(JobRunState state) { this.state = state.toString(); return this; } /** *

* The client token used to start a job run. *

* * @param clientToken * The client token used to start a job run. */ public void setClientToken(String clientToken) { this.clientToken = clientToken; } /** *

* The client token used to start a job run. *

* * @return The client token used to start a job run. */ public String getClientToken() { return this.clientToken; } /** *

* The client token used to start a job run. *

* * @param clientToken * The client token used to start a job run. * @return Returns a reference to this object so that method calls can be chained together. */ public JobRun withClientToken(String clientToken) { setClientToken(clientToken); return this; } /** *

* The execution role ARN of the job run. *

* * @param executionRoleArn * The execution role ARN of the job run. */ public void setExecutionRoleArn(String executionRoleArn) { this.executionRoleArn = executionRoleArn; } /** *

* The execution role ARN of the job run. *

* * @return The execution role ARN of the job run. */ public String getExecutionRoleArn() { return this.executionRoleArn; } /** *

* The execution role ARN of the job run. *

* * @param executionRoleArn * The execution role ARN of the job run. * @return Returns a reference to this object so that method calls can be chained together. */ public JobRun withExecutionRoleArn(String executionRoleArn) { setExecutionRoleArn(executionRoleArn); return this; } /** *

* The release version of Amazon EMR. *

* * @param releaseLabel * The release version of Amazon EMR. */ public void setReleaseLabel(String releaseLabel) { this.releaseLabel = releaseLabel; } /** *

* The release version of Amazon EMR. *

* * @return The release version of Amazon EMR. */ public String getReleaseLabel() { return this.releaseLabel; } /** *

* The release version of Amazon EMR. *

* * @param releaseLabel * The release version of Amazon EMR. * @return Returns a reference to this object so that method calls can be chained together. */ public JobRun withReleaseLabel(String releaseLabel) { setReleaseLabel(releaseLabel); return this; } /** *

* The configuration settings that are used to override default configuration. *

* * @param configurationOverrides * The configuration settings that are used to override default configuration. */ public void setConfigurationOverrides(ConfigurationOverrides configurationOverrides) { this.configurationOverrides = configurationOverrides; } /** *

* The configuration settings that are used to override default configuration. *

* * @return The configuration settings that are used to override default configuration. */ public ConfigurationOverrides getConfigurationOverrides() { return this.configurationOverrides; } /** *

* The configuration settings that are used to override default configuration. *

* * @param configurationOverrides * The configuration settings that are used to override default configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public JobRun withConfigurationOverrides(ConfigurationOverrides configurationOverrides) { setConfigurationOverrides(configurationOverrides); return this; } /** *

* Parameters of job driver for the job run. *

* * @param jobDriver * Parameters of job driver for the job run. */ public void setJobDriver(JobDriver jobDriver) { this.jobDriver = jobDriver; } /** *

* Parameters of job driver for the job run. *

* * @return Parameters of job driver for the job run. */ public JobDriver getJobDriver() { return this.jobDriver; } /** *

* Parameters of job driver for the job run. *

* * @param jobDriver * Parameters of job driver for the job run. * @return Returns a reference to this object so that method calls can be chained together. */ public JobRun withJobDriver(JobDriver jobDriver) { setJobDriver(jobDriver); return this; } /** *

* The date and time when the job run was created. *

* * @param createdAt * The date and time when the job run was created. */ public void setCreatedAt(java.util.Date createdAt) { this.createdAt = createdAt; } /** *

* The date and time when the job run was created. *

* * @return The date and time when the job run was created. */ public java.util.Date getCreatedAt() { return this.createdAt; } /** *

* The date and time when the job run was created. *

* * @param createdAt * The date and time when the job run was created. * @return Returns a reference to this object so that method calls can be chained together. */ public JobRun withCreatedAt(java.util.Date createdAt) { setCreatedAt(createdAt); return this; } /** *

* The user who created the job run. *

* * @param createdBy * The user who created the job run. */ public void setCreatedBy(String createdBy) { this.createdBy = createdBy; } /** *

* The user who created the job run. *

* * @return The user who created the job run. */ public String getCreatedBy() { return this.createdBy; } /** *

* The user who created the job run. *

* * @param createdBy * The user who created the job run. * @return Returns a reference to this object so that method calls can be chained together. */ public JobRun withCreatedBy(String createdBy) { setCreatedBy(createdBy); return this; } /** *

* The date and time when the job run has finished. *

* * @param finishedAt * The date and time when the job run has finished. */ public void setFinishedAt(java.util.Date finishedAt) { this.finishedAt = finishedAt; } /** *

* The date and time when the job run has finished. *

* * @return The date and time when the job run has finished. */ public java.util.Date getFinishedAt() { return this.finishedAt; } /** *

* The date and time when the job run has finished. *

* * @param finishedAt * The date and time when the job run has finished. * @return Returns a reference to this object so that method calls can be chained together. */ public JobRun withFinishedAt(java.util.Date finishedAt) { setFinishedAt(finishedAt); return this; } /** *

* Additional details of the job run state. *

* * @param stateDetails * Additional details of the job run state. */ public void setStateDetails(String stateDetails) { this.stateDetails = stateDetails; } /** *

* Additional details of the job run state. *

* * @return Additional details of the job run state. */ public String getStateDetails() { return this.stateDetails; } /** *

* Additional details of the job run state. *

* * @param stateDetails * Additional details of the job run state. * @return Returns a reference to this object so that method calls can be chained together. */ public JobRun withStateDetails(String stateDetails) { setStateDetails(stateDetails); return this; } /** *

* The reasons why the job run has failed. *

* * @param failureReason * The reasons why the job run has failed. * @see FailureReason */ public void setFailureReason(String failureReason) { this.failureReason = failureReason; } /** *

* The reasons why the job run has failed. *

* * @return The reasons why the job run has failed. * @see FailureReason */ public String getFailureReason() { return this.failureReason; } /** *

* The reasons why the job run has failed. *

* * @param failureReason * The reasons why the job run has failed. * @return Returns a reference to this object so that method calls can be chained together. * @see FailureReason */ public JobRun withFailureReason(String failureReason) { setFailureReason(failureReason); return this; } /** *

* The reasons why the job run has failed. *

* * @param failureReason * The reasons why the job run has failed. * @return Returns a reference to this object so that method calls can be chained together. * @see FailureReason */ public JobRun withFailureReason(FailureReason failureReason) { this.failureReason = failureReason.toString(); return this; } /** *

* The assigned tags of the job run. *

* * @return The assigned tags of the job run. */ public java.util.Map getTags() { return tags; } /** *

* The assigned tags of the job run. *

* * @param tags * The assigned tags of the job run. */ public void setTags(java.util.Map tags) { this.tags = tags; } /** *

* The assigned tags of the job run. *

* * @param tags * The assigned tags of the job run. * @return Returns a reference to this object so that method calls can be chained together. */ public JobRun withTags(java.util.Map tags) { setTags(tags); return this; } /** * Add a single Tags entry * * @see JobRun#withTags * @returns a reference to this object so that method calls can be chained together. */ public JobRun addTagsEntry(String key, String value) { if (null == this.tags) { this.tags = new java.util.HashMap(); } if (this.tags.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.tags.put(key, value); return this; } /** * Removes all the entries added into Tags. * * @return Returns a reference to this object so that method calls can be chained together. */ public JobRun clearTagsEntries() { this.tags = null; return this; } /** *

* The configuration of the retry policy that the job runs on. *

* * @param retryPolicyConfiguration * The configuration of the retry policy that the job runs on. */ public void setRetryPolicyConfiguration(RetryPolicyConfiguration retryPolicyConfiguration) { this.retryPolicyConfiguration = retryPolicyConfiguration; } /** *

* The configuration of the retry policy that the job runs on. *

* * @return The configuration of the retry policy that the job runs on. */ public RetryPolicyConfiguration getRetryPolicyConfiguration() { return this.retryPolicyConfiguration; } /** *

* The configuration of the retry policy that the job runs on. *

* * @param retryPolicyConfiguration * The configuration of the retry policy that the job runs on. * @return Returns a reference to this object so that method calls can be chained together. */ public JobRun withRetryPolicyConfiguration(RetryPolicyConfiguration retryPolicyConfiguration) { setRetryPolicyConfiguration(retryPolicyConfiguration); return this; } /** *

* The current status of the retry policy executed on the job. *

* * @param retryPolicyExecution * The current status of the retry policy executed on the job. */ public void setRetryPolicyExecution(RetryPolicyExecution retryPolicyExecution) { this.retryPolicyExecution = retryPolicyExecution; } /** *

* The current status of the retry policy executed on the job. *

* * @return The current status of the retry policy executed on the job. */ public RetryPolicyExecution getRetryPolicyExecution() { return this.retryPolicyExecution; } /** *

* The current status of the retry policy executed on the job. *

* * @param retryPolicyExecution * The current status of the retry policy executed on the job. * @return Returns a reference to this object so that method calls can be chained together. */ public JobRun withRetryPolicyExecution(RetryPolicyExecution retryPolicyExecution) { setRetryPolicyExecution(retryPolicyExecution); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getVirtualClusterId() != null) sb.append("VirtualClusterId: ").append(getVirtualClusterId()).append(","); if (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getState() != null) sb.append("State: ").append(getState()).append(","); if (getClientToken() != null) sb.append("ClientToken: ").append(getClientToken()).append(","); if (getExecutionRoleArn() != null) sb.append("ExecutionRoleArn: ").append(getExecutionRoleArn()).append(","); if (getReleaseLabel() != null) sb.append("ReleaseLabel: ").append(getReleaseLabel()).append(","); if (getConfigurationOverrides() != null) sb.append("ConfigurationOverrides: ").append(getConfigurationOverrides()).append(","); if (getJobDriver() != null) sb.append("JobDriver: ").append(getJobDriver()).append(","); if (getCreatedAt() != null) sb.append("CreatedAt: ").append(getCreatedAt()).append(","); if (getCreatedBy() != null) sb.append("CreatedBy: ").append(getCreatedBy()).append(","); if (getFinishedAt() != null) sb.append("FinishedAt: ").append(getFinishedAt()).append(","); if (getStateDetails() != null) sb.append("StateDetails: ").append(getStateDetails()).append(","); if (getFailureReason() != null) sb.append("FailureReason: ").append(getFailureReason()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getRetryPolicyConfiguration() != null) sb.append("RetryPolicyConfiguration: ").append(getRetryPolicyConfiguration()).append(","); if (getRetryPolicyExecution() != null) sb.append("RetryPolicyExecution: ").append(getRetryPolicyExecution()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof JobRun == false) return false; JobRun other = (JobRun) obj; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getVirtualClusterId() == null ^ this.getVirtualClusterId() == null) return false; if (other.getVirtualClusterId() != null && other.getVirtualClusterId().equals(this.getVirtualClusterId()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getState() == null ^ this.getState() == null) return false; if (other.getState() != null && other.getState().equals(this.getState()) == false) return false; if (other.getClientToken() == null ^ this.getClientToken() == null) return false; if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false) return false; if (other.getExecutionRoleArn() == null ^ this.getExecutionRoleArn() == null) return false; if (other.getExecutionRoleArn() != null && other.getExecutionRoleArn().equals(this.getExecutionRoleArn()) == false) return false; if (other.getReleaseLabel() == null ^ this.getReleaseLabel() == null) return false; if (other.getReleaseLabel() != null && other.getReleaseLabel().equals(this.getReleaseLabel()) == false) return false; if (other.getConfigurationOverrides() == null ^ this.getConfigurationOverrides() == null) return false; if (other.getConfigurationOverrides() != null && other.getConfigurationOverrides().equals(this.getConfigurationOverrides()) == false) return false; if (other.getJobDriver() == null ^ this.getJobDriver() == null) return false; if (other.getJobDriver() != null && other.getJobDriver().equals(this.getJobDriver()) == false) return false; if (other.getCreatedAt() == null ^ this.getCreatedAt() == null) return false; if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == false) return false; if (other.getCreatedBy() == null ^ this.getCreatedBy() == null) return false; if (other.getCreatedBy() != null && other.getCreatedBy().equals(this.getCreatedBy()) == false) return false; if (other.getFinishedAt() == null ^ this.getFinishedAt() == null) return false; if (other.getFinishedAt() != null && other.getFinishedAt().equals(this.getFinishedAt()) == false) return false; if (other.getStateDetails() == null ^ this.getStateDetails() == null) return false; if (other.getStateDetails() != null && other.getStateDetails().equals(this.getStateDetails()) == false) return false; if (other.getFailureReason() == null ^ this.getFailureReason() == null) return false; if (other.getFailureReason() != null && other.getFailureReason().equals(this.getFailureReason()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getRetryPolicyConfiguration() == null ^ this.getRetryPolicyConfiguration() == null) return false; if (other.getRetryPolicyConfiguration() != null && other.getRetryPolicyConfiguration().equals(this.getRetryPolicyConfiguration()) == false) return false; if (other.getRetryPolicyExecution() == null ^ this.getRetryPolicyExecution() == null) return false; if (other.getRetryPolicyExecution() != null && other.getRetryPolicyExecution().equals(this.getRetryPolicyExecution()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getVirtualClusterId() == null) ? 0 : getVirtualClusterId().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); hashCode = prime * hashCode + ((getExecutionRoleArn() == null) ? 0 : getExecutionRoleArn().hashCode()); hashCode = prime * hashCode + ((getReleaseLabel() == null) ? 0 : getReleaseLabel().hashCode()); hashCode = prime * hashCode + ((getConfigurationOverrides() == null) ? 0 : getConfigurationOverrides().hashCode()); hashCode = prime * hashCode + ((getJobDriver() == null) ? 0 : getJobDriver().hashCode()); hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); hashCode = prime * hashCode + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode()); hashCode = prime * hashCode + ((getFinishedAt() == null) ? 0 : getFinishedAt().hashCode()); hashCode = prime * hashCode + ((getStateDetails() == null) ? 0 : getStateDetails().hashCode()); hashCode = prime * hashCode + ((getFailureReason() == null) ? 0 : getFailureReason().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getRetryPolicyConfiguration() == null) ? 0 : getRetryPolicyConfiguration().hashCode()); hashCode = prime * hashCode + ((getRetryPolicyExecution() == null) ? 0 : getRetryPolicyExecution().hashCode()); return hashCode; } @Override public JobRun clone() { try { return (JobRun) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.emrcontainers.model.transform.JobRunMarshaller.getInstance().marshall(this, protocolMarshaller); } }