All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.sagemaker.model.TransformInput Maven / Gradle / Ivy

/*
 * Copyright 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 software.amazon.awssdk.services.sagemaker.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Describes the input source of a transform job and the way the transform job consumes it. *

*/ @Generated("software.amazon.awssdk:codegen") public final class TransformInput implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField DATA_SOURCE_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("DataSource") .getter(getter(TransformInput::dataSource)).setter(setter(Builder::dataSource)) .constructor(TransformDataSource::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataSource").build()).build(); private static final SdkField CONTENT_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ContentType").getter(getter(TransformInput::contentType)).setter(setter(Builder::contentType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ContentType").build()).build(); private static final SdkField COMPRESSION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CompressionType").getter(getter(TransformInput::compressionTypeAsString)) .setter(setter(Builder::compressionType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompressionType").build()).build(); private static final SdkField SPLIT_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SplitType").getter(getter(TransformInput::splitTypeAsString)).setter(setter(Builder::splitType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SplitType").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DATA_SOURCE_FIELD, CONTENT_TYPE_FIELD, COMPRESSION_TYPE_FIELD, SPLIT_TYPE_FIELD)); private static final long serialVersionUID = 1L; private final TransformDataSource dataSource; private final String contentType; private final String compressionType; private final String splitType; private TransformInput(BuilderImpl builder) { this.dataSource = builder.dataSource; this.contentType = builder.contentType; this.compressionType = builder.compressionType; this.splitType = builder.splitType; } /** *

* Describes the location of the channel data, which is, the S3 location of the input data that the model can * consume. *

* * @return Describes the location of the channel data, which is, the S3 location of the input data that the model * can consume. */ public final TransformDataSource dataSource() { return dataSource; } /** *

* The multipurpose internet mail extension (MIME) type of the data. Amazon SageMaker uses the MIME type with each * http call to transfer data to the transform job. *

* * @return The multipurpose internet mail extension (MIME) type of the data. Amazon SageMaker uses the MIME type * with each http call to transfer data to the transform job. */ public final String contentType() { return contentType; } /** *

* If your transform data is compressed, specify the compression type. Amazon SageMaker automatically decompresses * the data for the transform job accordingly. The default value is None. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #compressionType} * will return {@link CompressionType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #compressionTypeAsString}. *

* * @return If your transform data is compressed, specify the compression type. Amazon SageMaker automatically * decompresses the data for the transform job accordingly. The default value is None. * @see CompressionType */ public final CompressionType compressionType() { return CompressionType.fromValue(compressionType); } /** *

* If your transform data is compressed, specify the compression type. Amazon SageMaker automatically decompresses * the data for the transform job accordingly. The default value is None. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #compressionType} * will return {@link CompressionType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #compressionTypeAsString}. *

* * @return If your transform data is compressed, specify the compression type. Amazon SageMaker automatically * decompresses the data for the transform job accordingly. The default value is None. * @see CompressionType */ public final String compressionTypeAsString() { return compressionType; } /** *

* The method to use to split the transform job's data files into smaller batches. Splitting is necessary when the * total size of each object is too large to fit in a single request. You can also use data splitting to improve * performance by processing multiple concurrent mini-batches. The default value for SplitType is * None, which indicates that input data files are not split, and request payloads contain the entire * contents of an input object. Set the value of this parameter to Line to split records on a newline * character boundary. SplitType also supports a number of record-oriented binary data formats. * Currently, the supported record formats are: *

*
    *
  • *

    * RecordIO *

    *
  • *
  • *

    * TFRecord *

    *
  • *
*

* When splitting is enabled, the size of a mini-batch depends on the values of the BatchStrategy and * MaxPayloadInMB parameters. When the value of BatchStrategy is MultiRecord, * Amazon SageMaker sends the maximum number of records in each request, up to the MaxPayloadInMB * limit. If the value of BatchStrategy is SingleRecord, Amazon SageMaker sends individual * records in each request. *

* *

* Some data formats represent a record as a binary payload wrapped with extra padding bytes. When splitting is * applied to a binary data format, padding is removed if the value of BatchStrategy is set to * SingleRecord. Padding is not removed if the value of BatchStrategy is set to * MultiRecord. *

*

* For more information about RecordIO, see Create * a Dataset Using RecordIO in the MXNet documentation. For more information about TFRecord, see Consuming TFRecord data in the * TensorFlow documentation. *

*
*

* If the service returns an enum value that is not available in the current SDK version, {@link #splitType} will * return {@link SplitType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #splitTypeAsString}. *

* * @return The method to use to split the transform job's data files into smaller batches. Splitting is necessary * when the total size of each object is too large to fit in a single request. You can also use data * splitting to improve performance by processing multiple concurrent mini-batches. The default value for * SplitType is None, which indicates that input data files are not split, and * request payloads contain the entire contents of an input object. Set the value of this parameter to * Line to split records on a newline character boundary. SplitType also supports * a number of record-oriented binary data formats. Currently, the supported record formats are:

*
    *
  • *

    * RecordIO *

    *
  • *
  • *

    * TFRecord *

    *
  • *
*

* When splitting is enabled, the size of a mini-batch depends on the values of the * BatchStrategy and MaxPayloadInMB parameters. When the value of * BatchStrategy is MultiRecord, Amazon SageMaker sends the maximum number of * records in each request, up to the MaxPayloadInMB limit. If the value of * BatchStrategy is SingleRecord, Amazon SageMaker sends individual records in * each request. *

* *

* Some data formats represent a record as a binary payload wrapped with extra padding bytes. When splitting * is applied to a binary data format, padding is removed if the value of BatchStrategy is set * to SingleRecord. Padding is not removed if the value of BatchStrategy is set to * MultiRecord. *

*

* For more information about RecordIO, see Create a Dataset Using RecordIO in the MXNet * documentation. For more information about TFRecord, see Consuming TFRecord data in the * TensorFlow documentation. *

* @see SplitType */ public final SplitType splitType() { return SplitType.fromValue(splitType); } /** *

* The method to use to split the transform job's data files into smaller batches. Splitting is necessary when the * total size of each object is too large to fit in a single request. You can also use data splitting to improve * performance by processing multiple concurrent mini-batches. The default value for SplitType is * None, which indicates that input data files are not split, and request payloads contain the entire * contents of an input object. Set the value of this parameter to Line to split records on a newline * character boundary. SplitType also supports a number of record-oriented binary data formats. * Currently, the supported record formats are: *

*
    *
  • *

    * RecordIO *

    *
  • *
  • *

    * TFRecord *

    *
  • *
*

* When splitting is enabled, the size of a mini-batch depends on the values of the BatchStrategy and * MaxPayloadInMB parameters. When the value of BatchStrategy is MultiRecord, * Amazon SageMaker sends the maximum number of records in each request, up to the MaxPayloadInMB * limit. If the value of BatchStrategy is SingleRecord, Amazon SageMaker sends individual * records in each request. *

* *

* Some data formats represent a record as a binary payload wrapped with extra padding bytes. When splitting is * applied to a binary data format, padding is removed if the value of BatchStrategy is set to * SingleRecord. Padding is not removed if the value of BatchStrategy is set to * MultiRecord. *

*

* For more information about RecordIO, see Create * a Dataset Using RecordIO in the MXNet documentation. For more information about TFRecord, see Consuming TFRecord data in the * TensorFlow documentation. *

*
*

* If the service returns an enum value that is not available in the current SDK version, {@link #splitType} will * return {@link SplitType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #splitTypeAsString}. *

* * @return The method to use to split the transform job's data files into smaller batches. Splitting is necessary * when the total size of each object is too large to fit in a single request. You can also use data * splitting to improve performance by processing multiple concurrent mini-batches. The default value for * SplitType is None, which indicates that input data files are not split, and * request payloads contain the entire contents of an input object. Set the value of this parameter to * Line to split records on a newline character boundary. SplitType also supports * a number of record-oriented binary data formats. Currently, the supported record formats are:

*
    *
  • *

    * RecordIO *

    *
  • *
  • *

    * TFRecord *

    *
  • *
*

* When splitting is enabled, the size of a mini-batch depends on the values of the * BatchStrategy and MaxPayloadInMB parameters. When the value of * BatchStrategy is MultiRecord, Amazon SageMaker sends the maximum number of * records in each request, up to the MaxPayloadInMB limit. If the value of * BatchStrategy is SingleRecord, Amazon SageMaker sends individual records in * each request. *

* *

* Some data formats represent a record as a binary payload wrapped with extra padding bytes. When splitting * is applied to a binary data format, padding is removed if the value of BatchStrategy is set * to SingleRecord. Padding is not removed if the value of BatchStrategy is set to * MultiRecord. *

*

* For more information about RecordIO, see Create a Dataset Using RecordIO in the MXNet * documentation. For more information about TFRecord, see Consuming TFRecord data in the * TensorFlow documentation. *

* @see SplitType */ public final String splitTypeAsString() { return splitType; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(dataSource()); hashCode = 31 * hashCode + Objects.hashCode(contentType()); hashCode = 31 * hashCode + Objects.hashCode(compressionTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(splitTypeAsString()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof TransformInput)) { return false; } TransformInput other = (TransformInput) obj; return Objects.equals(dataSource(), other.dataSource()) && Objects.equals(contentType(), other.contentType()) && Objects.equals(compressionTypeAsString(), other.compressionTypeAsString()) && Objects.equals(splitTypeAsString(), other.splitTypeAsString()); } /** * 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. */ @Override public final String toString() { return ToString.builder("TransformInput").add("DataSource", dataSource()).add("ContentType", contentType()) .add("CompressionType", compressionTypeAsString()).add("SplitType", splitTypeAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "DataSource": return Optional.ofNullable(clazz.cast(dataSource())); case "ContentType": return Optional.ofNullable(clazz.cast(contentType())); case "CompressionType": return Optional.ofNullable(clazz.cast(compressionTypeAsString())); case "SplitType": return Optional.ofNullable(clazz.cast(splitTypeAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((TransformInput) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Describes the location of the channel data, which is, the S3 location of the input data that the model can * consume. *

* * @param dataSource * Describes the location of the channel data, which is, the S3 location of the input data that the model * can consume. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dataSource(TransformDataSource dataSource); /** *

* Describes the location of the channel data, which is, the S3 location of the input data that the model can * consume. *

* This is a convenience method that creates an instance of the {@link TransformDataSource.Builder} avoiding the * need to create one manually via {@link TransformDataSource#builder()}. * *

* When the {@link Consumer} completes, {@link TransformDataSource.Builder#build()} is called immediately and * its result is passed to {@link #dataSource(TransformDataSource)}. * * @param dataSource * a consumer that will call methods on {@link TransformDataSource.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #dataSource(TransformDataSource) */ default Builder dataSource(Consumer dataSource) { return dataSource(TransformDataSource.builder().applyMutation(dataSource).build()); } /** *

* The multipurpose internet mail extension (MIME) type of the data. Amazon SageMaker uses the MIME type with * each http call to transfer data to the transform job. *

* * @param contentType * The multipurpose internet mail extension (MIME) type of the data. Amazon SageMaker uses the MIME type * with each http call to transfer data to the transform job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder contentType(String contentType); /** *

* If your transform data is compressed, specify the compression type. Amazon SageMaker automatically * decompresses the data for the transform job accordingly. The default value is None. *

* * @param compressionType * If your transform data is compressed, specify the compression type. Amazon SageMaker automatically * decompresses the data for the transform job accordingly. The default value is None. * @see CompressionType * @return Returns a reference to this object so that method calls can be chained together. * @see CompressionType */ Builder compressionType(String compressionType); /** *

* If your transform data is compressed, specify the compression type. Amazon SageMaker automatically * decompresses the data for the transform job accordingly. The default value is None. *

* * @param compressionType * If your transform data is compressed, specify the compression type. Amazon SageMaker automatically * decompresses the data for the transform job accordingly. The default value is None. * @see CompressionType * @return Returns a reference to this object so that method calls can be chained together. * @see CompressionType */ Builder compressionType(CompressionType compressionType); /** *

* The method to use to split the transform job's data files into smaller batches. Splitting is necessary when * the total size of each object is too large to fit in a single request. You can also use data splitting to * improve performance by processing multiple concurrent mini-batches. The default value for * SplitType is None, which indicates that input data files are not split, and request * payloads contain the entire contents of an input object. Set the value of this parameter to Line * to split records on a newline character boundary. SplitType also supports a number of * record-oriented binary data formats. Currently, the supported record formats are: *

*
    *
  • *

    * RecordIO *

    *
  • *
  • *

    * TFRecord *

    *
  • *
*

* When splitting is enabled, the size of a mini-batch depends on the values of the BatchStrategy * and MaxPayloadInMB parameters. When the value of BatchStrategy is * MultiRecord, Amazon SageMaker sends the maximum number of records in each request, up to the * MaxPayloadInMB limit. If the value of BatchStrategy is SingleRecord, * Amazon SageMaker sends individual records in each request. *

* *

* Some data formats represent a record as a binary payload wrapped with extra padding bytes. When splitting is * applied to a binary data format, padding is removed if the value of BatchStrategy is set to * SingleRecord. Padding is not removed if the value of BatchStrategy is set to * MultiRecord. *

*

* For more information about RecordIO, see Create a Dataset Using RecordIO in the MXNet * documentation. For more information about TFRecord, see Consuming TFRecord data in the * TensorFlow documentation. *

*
* * @param splitType * The method to use to split the transform job's data files into smaller batches. Splitting is necessary * when the total size of each object is too large to fit in a single request. You can also use data * splitting to improve performance by processing multiple concurrent mini-batches. The default value for * SplitType is None, which indicates that input data files are not split, and * request payloads contain the entire contents of an input object. Set the value of this parameter to * Line to split records on a newline character boundary. SplitType also * supports a number of record-oriented binary data formats. Currently, the supported record formats * are:

*
    *
  • *

    * RecordIO *

    *
  • *
  • *

    * TFRecord *

    *
  • *
*

* When splitting is enabled, the size of a mini-batch depends on the values of the * BatchStrategy and MaxPayloadInMB parameters. When the value of * BatchStrategy is MultiRecord, Amazon SageMaker sends the maximum number of * records in each request, up to the MaxPayloadInMB limit. If the value of * BatchStrategy is SingleRecord, Amazon SageMaker sends individual records in * each request. *

* *

* Some data formats represent a record as a binary payload wrapped with extra padding bytes. When * splitting is applied to a binary data format, padding is removed if the value of * BatchStrategy is set to SingleRecord. Padding is not removed if the value of * BatchStrategy is set to MultiRecord. *

*

* For more information about RecordIO, see Create a Dataset Using RecordIO in the MXNet * documentation. For more information about TFRecord, see Consuming TFRecord data in * the TensorFlow documentation. *

* @see SplitType * @return Returns a reference to this object so that method calls can be chained together. * @see SplitType */ Builder splitType(String splitType); /** *

* The method to use to split the transform job's data files into smaller batches. Splitting is necessary when * the total size of each object is too large to fit in a single request. You can also use data splitting to * improve performance by processing multiple concurrent mini-batches. The default value for * SplitType is None, which indicates that input data files are not split, and request * payloads contain the entire contents of an input object. Set the value of this parameter to Line * to split records on a newline character boundary. SplitType also supports a number of * record-oriented binary data formats. Currently, the supported record formats are: *

*
    *
  • *

    * RecordIO *

    *
  • *
  • *

    * TFRecord *

    *
  • *
*

* When splitting is enabled, the size of a mini-batch depends on the values of the BatchStrategy * and MaxPayloadInMB parameters. When the value of BatchStrategy is * MultiRecord, Amazon SageMaker sends the maximum number of records in each request, up to the * MaxPayloadInMB limit. If the value of BatchStrategy is SingleRecord, * Amazon SageMaker sends individual records in each request. *

* *

* Some data formats represent a record as a binary payload wrapped with extra padding bytes. When splitting is * applied to a binary data format, padding is removed if the value of BatchStrategy is set to * SingleRecord. Padding is not removed if the value of BatchStrategy is set to * MultiRecord. *

*

* For more information about RecordIO, see Create a Dataset Using RecordIO in the MXNet * documentation. For more information about TFRecord, see Consuming TFRecord data in the * TensorFlow documentation. *

*
* * @param splitType * The method to use to split the transform job's data files into smaller batches. Splitting is necessary * when the total size of each object is too large to fit in a single request. You can also use data * splitting to improve performance by processing multiple concurrent mini-batches. The default value for * SplitType is None, which indicates that input data files are not split, and * request payloads contain the entire contents of an input object. Set the value of this parameter to * Line to split records on a newline character boundary. SplitType also * supports a number of record-oriented binary data formats. Currently, the supported record formats * are:

*
    *
  • *

    * RecordIO *

    *
  • *
  • *

    * TFRecord *

    *
  • *
*

* When splitting is enabled, the size of a mini-batch depends on the values of the * BatchStrategy and MaxPayloadInMB parameters. When the value of * BatchStrategy is MultiRecord, Amazon SageMaker sends the maximum number of * records in each request, up to the MaxPayloadInMB limit. If the value of * BatchStrategy is SingleRecord, Amazon SageMaker sends individual records in * each request. *

* *

* Some data formats represent a record as a binary payload wrapped with extra padding bytes. When * splitting is applied to a binary data format, padding is removed if the value of * BatchStrategy is set to SingleRecord. Padding is not removed if the value of * BatchStrategy is set to MultiRecord. *

*

* For more information about RecordIO, see Create a Dataset Using RecordIO in the MXNet * documentation. For more information about TFRecord, see Consuming TFRecord data in * the TensorFlow documentation. *

* @see SplitType * @return Returns a reference to this object so that method calls can be chained together. * @see SplitType */ Builder splitType(SplitType splitType); } static final class BuilderImpl implements Builder { private TransformDataSource dataSource; private String contentType; private String compressionType; private String splitType; private BuilderImpl() { } private BuilderImpl(TransformInput model) { dataSource(model.dataSource); contentType(model.contentType); compressionType(model.compressionType); splitType(model.splitType); } public final TransformDataSource.Builder getDataSource() { return dataSource != null ? dataSource.toBuilder() : null; } public final void setDataSource(TransformDataSource.BuilderImpl dataSource) { this.dataSource = dataSource != null ? dataSource.build() : null; } @Override public final Builder dataSource(TransformDataSource dataSource) { this.dataSource = dataSource; return this; } public final String getContentType() { return contentType; } public final void setContentType(String contentType) { this.contentType = contentType; } @Override public final Builder contentType(String contentType) { this.contentType = contentType; return this; } public final String getCompressionType() { return compressionType; } public final void setCompressionType(String compressionType) { this.compressionType = compressionType; } @Override public final Builder compressionType(String compressionType) { this.compressionType = compressionType; return this; } @Override public final Builder compressionType(CompressionType compressionType) { this.compressionType(compressionType == null ? null : compressionType.toString()); return this; } public final String getSplitType() { return splitType; } public final void setSplitType(String splitType) { this.splitType = splitType; } @Override public final Builder splitType(String splitType) { this.splitType = splitType; return this; } @Override public final Builder splitType(SplitType splitType) { this.splitType(splitType == null ? null : splitType.toString()); return this; } @Override public TransformInput build() { return new TransformInput(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy