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

software.amazon.awssdk.services.sagemakerfeaturestoreruntime.DefaultSageMakerFeatureStoreRuntimeAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Sage Maker Feature Store Runtime module holds the client classes that are used for communicating with Sage Maker Feature Store Runtime.

There is a newer version: 2.29.15
Show newest version
/*
 * 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.sagemakerfeaturestoreruntime;

import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import java.util.function.Function;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.awscore.retry.AwsRetryStrategy;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.retry.RetryMode;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.retries.api.RetryStrategy;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.internal.SageMakerFeatureStoreRuntimeServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.model.AccessForbiddenException;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.model.BatchGetRecordRequest;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.model.BatchGetRecordResponse;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.model.DeleteRecordRequest;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.model.DeleteRecordResponse;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.model.GetRecordRequest;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.model.GetRecordResponse;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.model.InternalFailureException;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.model.PutRecordRequest;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.model.PutRecordResponse;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.model.ResourceNotFoundException;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.model.SageMakerFeatureStoreRuntimeException;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.model.ServiceUnavailableException;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.model.ValidationErrorException;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.transform.BatchGetRecordRequestMarshaller;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.transform.DeleteRecordRequestMarshaller;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.transform.GetRecordRequestMarshaller;
import software.amazon.awssdk.services.sagemakerfeaturestoreruntime.transform.PutRecordRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;

/**
 * Internal implementation of {@link SageMakerFeatureStoreRuntimeAsyncClient}.
 *
 * @see SageMakerFeatureStoreRuntimeAsyncClient#builder()
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultSageMakerFeatureStoreRuntimeAsyncClient implements SageMakerFeatureStoreRuntimeAsyncClient {
    private static final Logger log = LoggerFactory.getLogger(DefaultSageMakerFeatureStoreRuntimeAsyncClient.class);

    private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
            .serviceProtocol(AwsServiceProtocol.REST_JSON).build();

    private final AsyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

    protected DefaultSageMakerFeatureStoreRuntimeAsyncClient(SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
    }

    /**
     * 

* Retrieves a batch of Records from a FeatureGroup. *

* * @param batchGetRecordRequest * @return A Java Future containing the result of the BatchGetRecord operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationErrorException There was an error validating your request.
  • *
  • InternalFailureException An internal failure occurred. Try your request again. If the problem * persists, contact Amazon Web Services customer support.
  • *
  • ServiceUnavailableException The service is currently unavailable.
  • *
  • AccessForbiddenException You do not have permission to perform an action.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • SageMakerFeatureStoreRuntimeException Base class for all service exceptions. Unknown exceptions will * be thrown as an instance of this type.
  • *
* @sample SageMakerFeatureStoreRuntimeAsyncClient.BatchGetRecord * @see AWS API Documentation */ @Override public CompletableFuture batchGetRecord(BatchGetRecordRequest batchGetRecordRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchGetRecordRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, batchGetRecordRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SageMaker FeatureStore Runtime"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchGetRecord"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, BatchGetRecordResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("BatchGetRecord").withProtocolMetadata(protocolMetadata) .withMarshaller(new BatchGetRecordRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(batchGetRecordRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a Record from a FeatureGroup in the OnlineStore. Feature Store * supports both SoftDelete and HardDelete. For SoftDelete (default), feature * columns are set to null and the record is no longer retrievable by GetRecord or * BatchGetRecord. For HardDelete, the complete Record is removed from the * OnlineStore. In both cases, Feature Store appends the deleted record marker to the * OfflineStore. The deleted record marker is a record with the same RecordIdentifer as * the original, but with is_deleted value set to True, EventTime set to the * delete input EventTime, and other feature values set to null. *

*

* Note that the EventTime specified in DeleteRecord should be set later than the * EventTime of the existing record in the OnlineStore for that * RecordIdentifer. If it is not, the deletion does not occur: *

*
    *
  • *

    * For SoftDelete, the existing (not deleted) record remains in the OnlineStore, though * the delete record marker is still written to the OfflineStore. *

    *
  • *
  • *

    * HardDelete returns EventTime: 400 ValidationException to indicate that the * delete operation failed. No delete record marker is written to the OfflineStore. *

    *
  • *
*

* When a record is deleted from the OnlineStore, the deleted record marker is appended to the * OfflineStore. If you have the Iceberg table format enabled for your OfflineStore, you * can remove all history of a record from the OfflineStore using Amazon Athena or Apache Spark. For * information on how to hard delete a record from the OfflineStore with the Iceberg table format * enabled, see Delete records from the offline store. *

* * @param deleteRecordRequest * @return A Java Future containing the result of the DeleteRecord operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationErrorException There was an error validating your request.
  • *
  • InternalFailureException An internal failure occurred. Try your request again. If the problem * persists, contact Amazon Web Services customer support.
  • *
  • ServiceUnavailableException The service is currently unavailable.
  • *
  • AccessForbiddenException You do not have permission to perform an action.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • SageMakerFeatureStoreRuntimeException Base class for all service exceptions. Unknown exceptions will * be thrown as an instance of this type.
  • *
* @sample SageMakerFeatureStoreRuntimeAsyncClient.DeleteRecord * @see AWS API Documentation */ @Override public CompletableFuture deleteRecord(DeleteRecordRequest deleteRecordRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteRecordRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteRecordRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SageMaker FeatureStore Runtime"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteRecord"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteRecordResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteRecord").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteRecordRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteRecordRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Use for OnlineStore serving from a FeatureStore. Only the latest records stored in the * OnlineStore can be retrieved. If no Record with RecordIdentifierValue is found, then an * empty result is returned. *

* * @param getRecordRequest * @return A Java Future containing the result of the GetRecord operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationErrorException There was an error validating your request.
  • *
  • ResourceNotFoundException A resource that is required to perform an action was not found.
  • *
  • InternalFailureException An internal failure occurred. Try your request again. If the problem * persists, contact Amazon Web Services customer support.
  • *
  • ServiceUnavailableException The service is currently unavailable.
  • *
  • AccessForbiddenException You do not have permission to perform an action.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • SageMakerFeatureStoreRuntimeException Base class for all service exceptions. Unknown exceptions will * be thrown as an instance of this type.
  • *
* @sample SageMakerFeatureStoreRuntimeAsyncClient.GetRecord * @see AWS API Documentation */ @Override public CompletableFuture getRecord(GetRecordRequest getRecordRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getRecordRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getRecordRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SageMaker FeatureStore Runtime"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetRecord"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetRecordResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("GetRecord") .withProtocolMetadata(protocolMetadata) .withMarshaller(new GetRecordRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withMetricCollector(apiCallMetricCollector).withInput(getRecordRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* The PutRecord API is used to ingest a list of Records into your feature group. *

*

* If a new record’s EventTime is greater, the new record is written to both the * OnlineStore and OfflineStore. Otherwise, the record is a historic record and it is * written only to the OfflineStore. *

*

* You can specify the ingestion to be applied to the OnlineStore, OfflineStore, or both * by using the TargetStores request parameter. *

*

* You can set the ingested record to expire at a given time to live (TTL) duration after the record’s event time, * ExpiresAt = EventTime + TtlDuration, by specifying the * TtlDuration parameter. A record level TtlDuration is set when specifying the * TtlDuration parameter using the PutRecord API call. If the input * TtlDuration is null or unspecified, TtlDuration is set to the default * feature group level TtlDuration. A record level TtlDuration supersedes the group level * TtlDuration. *

* * @param putRecordRequest * @return A Java Future containing the result of the PutRecord operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ValidationErrorException There was an error validating your request.
  • *
  • InternalFailureException An internal failure occurred. Try your request again. If the problem * persists, contact Amazon Web Services customer support.
  • *
  • ServiceUnavailableException The service is currently unavailable.
  • *
  • AccessForbiddenException You do not have permission to perform an action.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • SageMakerFeatureStoreRuntimeException Base class for all service exceptions. Unknown exceptions will * be thrown as an instance of this type.
  • *
* @sample SageMakerFeatureStoreRuntimeAsyncClient.PutRecord * @see AWS API Documentation */ @Override public CompletableFuture putRecord(PutRecordRequest putRecordRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putRecordRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, putRecordRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SageMaker FeatureStore Runtime"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutRecord"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, PutRecordResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("PutRecord") .withProtocolMetadata(protocolMetadata) .withMarshaller(new PutRecordRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withMetricCollector(apiCallMetricCollector).withInput(putRecordRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } @Override public final SageMakerFeatureStoreRuntimeServiceClientConfiguration serviceClientConfiguration() { return new SageMakerFeatureStoreRuntimeServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build(); } @Override public final String serviceName() { return SERVICE_NAME; } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(SageMakerFeatureStoreRuntimeException::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("ValidationError") .exceptionBuilderSupplier(ValidationErrorException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceUnavailable") .exceptionBuilderSupplier(ServiceUnavailableException::builder).httpStatusCode(503).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AccessForbidden") .exceptionBuilderSupplier(AccessForbiddenException::builder).httpStatusCode(403).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalFailure") .exceptionBuilderSupplier(InternalFailureException::builder).httpStatusCode(500).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFound") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(404).build()); } private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration, RequestOverrideConfiguration requestOverrideConfiguration) { List publishers = null; if (requestOverrideConfiguration != null) { publishers = requestOverrideConfiguration.metricPublishers(); } if (publishers == null || publishers.isEmpty()) { publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS); } if (publishers == null) { publishers = Collections.emptyList(); } return publishers; } private void updateRetryStrategyClientConfiguration(SdkClientConfiguration.Builder configuration) { ClientOverrideConfiguration.Builder builder = configuration.asOverrideConfigurationBuilder(); RetryMode retryMode = builder.retryMode(); if (retryMode != null) { configuration.option(SdkClientOption.RETRY_STRATEGY, AwsRetryStrategy.forRetryMode(retryMode)); } else { Consumer> configurator = builder.retryStrategyConfigurator(); if (configurator != null) { RetryStrategy.Builder defaultBuilder = AwsRetryStrategy.defaultRetryStrategy().toBuilder(); configurator.accept(defaultBuilder); configuration.option(SdkClientOption.RETRY_STRATEGY, defaultBuilder.build()); } else { RetryStrategy retryStrategy = builder.retryStrategy(); if (retryStrategy != null) { configuration.option(SdkClientOption.RETRY_STRATEGY, retryStrategy); } } } configuration.option(SdkClientOption.CONFIGURED_RETRY_MODE, null); configuration.option(SdkClientOption.CONFIGURED_RETRY_STRATEGY, null); configuration.option(SdkClientOption.CONFIGURED_RETRY_CONFIGURATOR, null); } private SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request, SdkClientConfiguration clientConfiguration) { List plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList()); SdkClientConfiguration.Builder configuration = clientConfiguration.toBuilder(); if (plugins.isEmpty()) { return configuration.build(); } SageMakerFeatureStoreRuntimeServiceClientConfigurationBuilder serviceConfigBuilder = new SageMakerFeatureStoreRuntimeServiceClientConfigurationBuilder( configuration); for (SdkPlugin plugin : plugins) { plugin.configureClient(serviceConfigBuilder); } updateRetryStrategyClientConfiguration(configuration); return configuration.build(); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata, Function> exceptionMetadataMapper) { return protocolFactory.createErrorResponseHandler(operationMetadata, exceptionMetadataMapper); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy