/* * 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.sagemaker.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Defines the input needed to run a transform job using the inference specification specified in the algorithm. *
* * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class TransformJobDefinition implements Serializable, Cloneable, StructuredPojo { /** ** The maximum number of parallel requests that can be sent to each instance in a transform job. The default value * is 1. *
*/ private Integer maxConcurrentTransforms; /** ** The maximum payload size allowed, in MB. A payload is the data portion of a record (without metadata). *
*/ private Integer maxPayloadInMB; /** ** A string that determines the number of records included in a single mini-batch. *
*
* SingleRecord
means only one record is used per mini-batch. MultiRecord
means a
* mini-batch is set to contain as many records that can fit within the MaxPayloadInMB
limit.
*
* The environment variables to set in the Docker container. We support up to 16 key and values entries in the map. *
*/ private java.util.Map* A description of the input source and the way the transform job consumes it. *
*/ private TransformInput transformInput; /** ** Identifies the Amazon S3 location where you want Amazon SageMaker to save the results from the transform job. *
*/ private TransformOutput transformOutput; /** ** Identifies the ML compute instances for the transform job. *
*/ private TransformResources transformResources; /** ** The maximum number of parallel requests that can be sent to each instance in a transform job. The default value * is 1. *
* * @param maxConcurrentTransforms * The maximum number of parallel requests that can be sent to each instance in a transform job. The default * value is 1. */ public void setMaxConcurrentTransforms(Integer maxConcurrentTransforms) { this.maxConcurrentTransforms = maxConcurrentTransforms; } /** ** The maximum number of parallel requests that can be sent to each instance in a transform job. The default value * is 1. *
* * @return The maximum number of parallel requests that can be sent to each instance in a transform job. The default * value is 1. */ public Integer getMaxConcurrentTransforms() { return this.maxConcurrentTransforms; } /** ** The maximum number of parallel requests that can be sent to each instance in a transform job. The default value * is 1. *
* * @param maxConcurrentTransforms * The maximum number of parallel requests that can be sent to each instance in a transform job. The default * value is 1. * @return Returns a reference to this object so that method calls can be chained together. */ public TransformJobDefinition withMaxConcurrentTransforms(Integer maxConcurrentTransforms) { setMaxConcurrentTransforms(maxConcurrentTransforms); return this; } /** ** The maximum payload size allowed, in MB. A payload is the data portion of a record (without metadata). *
* * @param maxPayloadInMB * The maximum payload size allowed, in MB. A payload is the data portion of a record (without metadata). */ public void setMaxPayloadInMB(Integer maxPayloadInMB) { this.maxPayloadInMB = maxPayloadInMB; } /** ** The maximum payload size allowed, in MB. A payload is the data portion of a record (without metadata). *
* * @return The maximum payload size allowed, in MB. A payload is the data portion of a record (without metadata). */ public Integer getMaxPayloadInMB() { return this.maxPayloadInMB; } /** ** The maximum payload size allowed, in MB. A payload is the data portion of a record (without metadata). *
* * @param maxPayloadInMB * The maximum payload size allowed, in MB. A payload is the data portion of a record (without metadata). * @return Returns a reference to this object so that method calls can be chained together. */ public TransformJobDefinition withMaxPayloadInMB(Integer maxPayloadInMB) { setMaxPayloadInMB(maxPayloadInMB); return this; } /** ** A string that determines the number of records included in a single mini-batch. *
*
* SingleRecord
means only one record is used per mini-batch. MultiRecord
means a
* mini-batch is set to contain as many records that can fit within the MaxPayloadInMB
limit.
*
* SingleRecord
means only one record is used per mini-batch. MultiRecord
means a
* mini-batch is set to contain as many records that can fit within the MaxPayloadInMB
limit.
* @see BatchStrategy
*/
public void setBatchStrategy(String batchStrategy) {
this.batchStrategy = batchStrategy;
}
/**
*
* A string that determines the number of records included in a single mini-batch. *
*
* SingleRecord
means only one record is used per mini-batch. MultiRecord
means a
* mini-batch is set to contain as many records that can fit within the MaxPayloadInMB
limit.
*
* SingleRecord
means only one record is used per mini-batch. MultiRecord
means a
* mini-batch is set to contain as many records that can fit within the MaxPayloadInMB
limit.
* @see BatchStrategy
*/
public String getBatchStrategy() {
return this.batchStrategy;
}
/**
*
* A string that determines the number of records included in a single mini-batch. *
*
* SingleRecord
means only one record is used per mini-batch. MultiRecord
means a
* mini-batch is set to contain as many records that can fit within the MaxPayloadInMB
limit.
*
* SingleRecord
means only one record is used per mini-batch. MultiRecord
means a
* mini-batch is set to contain as many records that can fit within the MaxPayloadInMB
limit.
* @return Returns a reference to this object so that method calls can be chained together.
* @see BatchStrategy
*/
public TransformJobDefinition withBatchStrategy(String batchStrategy) {
setBatchStrategy(batchStrategy);
return this;
}
/**
*
* A string that determines the number of records included in a single mini-batch. *
*
* SingleRecord
means only one record is used per mini-batch. MultiRecord
means a
* mini-batch is set to contain as many records that can fit within the MaxPayloadInMB
limit.
*
* SingleRecord
means only one record is used per mini-batch. MultiRecord
means a
* mini-batch is set to contain as many records that can fit within the MaxPayloadInMB
limit.
* @return Returns a reference to this object so that method calls can be chained together.
* @see BatchStrategy
*/
public TransformJobDefinition withBatchStrategy(BatchStrategy batchStrategy) {
this.batchStrategy = batchStrategy.toString();
return this;
}
/**
*
* The environment variables to set in the Docker container. We support up to 16 key and values entries in the map. *
* * @return The environment variables to set in the Docker container. We support up to 16 key and values entries in * the map. */ public java.util.Map* The environment variables to set in the Docker container. We support up to 16 key and values entries in the map. *
* * @param environment * The environment variables to set in the Docker container. We support up to 16 key and values entries in * the map. */ public void setEnvironment(java.util.Map* The environment variables to set in the Docker container. We support up to 16 key and values entries in the map. *
* * @param environment * The environment variables to set in the Docker container. We support up to 16 key and values entries in * the map. * @return Returns a reference to this object so that method calls can be chained together. */ public TransformJobDefinition withEnvironment(java.util.Map* A description of the input source and the way the transform job consumes it. *
* * @param transformInput * A description of the input source and the way the transform job consumes it. */ public void setTransformInput(TransformInput transformInput) { this.transformInput = transformInput; } /** ** A description of the input source and the way the transform job consumes it. *
* * @return A description of the input source and the way the transform job consumes it. */ public TransformInput getTransformInput() { return this.transformInput; } /** ** A description of the input source and the way the transform job consumes it. *
* * @param transformInput * A description of the input source and the way the transform job consumes it. * @return Returns a reference to this object so that method calls can be chained together. */ public TransformJobDefinition withTransformInput(TransformInput transformInput) { setTransformInput(transformInput); return this; } /** ** Identifies the Amazon S3 location where you want Amazon SageMaker to save the results from the transform job. *
* * @param transformOutput * Identifies the Amazon S3 location where you want Amazon SageMaker to save the results from the transform * job. */ public void setTransformOutput(TransformOutput transformOutput) { this.transformOutput = transformOutput; } /** ** Identifies the Amazon S3 location where you want Amazon SageMaker to save the results from the transform job. *
* * @return Identifies the Amazon S3 location where you want Amazon SageMaker to save the results from the transform * job. */ public TransformOutput getTransformOutput() { return this.transformOutput; } /** ** Identifies the Amazon S3 location where you want Amazon SageMaker to save the results from the transform job. *
* * @param transformOutput * Identifies the Amazon S3 location where you want Amazon SageMaker to save the results from the transform * job. * @return Returns a reference to this object so that method calls can be chained together. */ public TransformJobDefinition withTransformOutput(TransformOutput transformOutput) { setTransformOutput(transformOutput); return this; } /** ** Identifies the ML compute instances for the transform job. *
* * @param transformResources * Identifies the ML compute instances for the transform job. */ public void setTransformResources(TransformResources transformResources) { this.transformResources = transformResources; } /** ** Identifies the ML compute instances for the transform job. *
* * @return Identifies the ML compute instances for the transform job. */ public TransformResources getTransformResources() { return this.transformResources; } /** ** Identifies the ML compute instances for the transform job. *
* * @param transformResources * Identifies the ML compute instances for the transform job. * @return Returns a reference to this object so that method calls can be chained together. */ public TransformJobDefinition withTransformResources(TransformResources transformResources) { setTransformResources(transformResources); 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 (getMaxConcurrentTransforms() != null) sb.append("MaxConcurrentTransforms: ").append(getMaxConcurrentTransforms()).append(","); if (getMaxPayloadInMB() != null) sb.append("MaxPayloadInMB: ").append(getMaxPayloadInMB()).append(","); if (getBatchStrategy() != null) sb.append("BatchStrategy: ").append(getBatchStrategy()).append(","); if (getEnvironment() != null) sb.append("Environment: ").append(getEnvironment()).append(","); if (getTransformInput() != null) sb.append("TransformInput: ").append(getTransformInput()).append(","); if (getTransformOutput() != null) sb.append("TransformOutput: ").append(getTransformOutput()).append(","); if (getTransformResources() != null) sb.append("TransformResources: ").append(getTransformResources()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TransformJobDefinition == false) return false; TransformJobDefinition other = (TransformJobDefinition) obj; if (other.getMaxConcurrentTransforms() == null ^ this.getMaxConcurrentTransforms() == null) return false; if (other.getMaxConcurrentTransforms() != null && other.getMaxConcurrentTransforms().equals(this.getMaxConcurrentTransforms()) == false) return false; if (other.getMaxPayloadInMB() == null ^ this.getMaxPayloadInMB() == null) return false; if (other.getMaxPayloadInMB() != null && other.getMaxPayloadInMB().equals(this.getMaxPayloadInMB()) == false) return false; if (other.getBatchStrategy() == null ^ this.getBatchStrategy() == null) return false; if (other.getBatchStrategy() != null && other.getBatchStrategy().equals(this.getBatchStrategy()) == false) return false; if (other.getEnvironment() == null ^ this.getEnvironment() == null) return false; if (other.getEnvironment() != null && other.getEnvironment().equals(this.getEnvironment()) == false) return false; if (other.getTransformInput() == null ^ this.getTransformInput() == null) return false; if (other.getTransformInput() != null && other.getTransformInput().equals(this.getTransformInput()) == false) return false; if (other.getTransformOutput() == null ^ this.getTransformOutput() == null) return false; if (other.getTransformOutput() != null && other.getTransformOutput().equals(this.getTransformOutput()) == false) return false; if (other.getTransformResources() == null ^ this.getTransformResources() == null) return false; if (other.getTransformResources() != null && other.getTransformResources().equals(this.getTransformResources()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getMaxConcurrentTransforms() == null) ? 0 : getMaxConcurrentTransforms().hashCode()); hashCode = prime * hashCode + ((getMaxPayloadInMB() == null) ? 0 : getMaxPayloadInMB().hashCode()); hashCode = prime * hashCode + ((getBatchStrategy() == null) ? 0 : getBatchStrategy().hashCode()); hashCode = prime * hashCode + ((getEnvironment() == null) ? 0 : getEnvironment().hashCode()); hashCode = prime * hashCode + ((getTransformInput() == null) ? 0 : getTransformInput().hashCode()); hashCode = prime * hashCode + ((getTransformOutput() == null) ? 0 : getTransformOutput().hashCode()); hashCode = prime * hashCode + ((getTransformResources() == null) ? 0 : getTransformResources().hashCode()); return hashCode; } @Override public TransformJobDefinition clone() { try { return (TransformJobDefinition) 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.sagemaker.model.transform.TransformJobDefinitionMarshaller.getInstance().marshall(this, protocolMarshaller); } }