Search in sources :

Example 41 with MetricCollector

use of software.amazon.awssdk.metrics.MetricCollector in project aws-sdk-java-v2 by aws.

the class DefaultQueryAsyncClient method getOperationWithChecksum.

/**
 * Invokes the GetOperationWithChecksum operation asynchronously.
 *
 * @param getOperationWithChecksumRequest
 * @return A Java Future containing the result of the GetOperationWithChecksum operation returned by the service.<br/>
 *         The CompletableFuture returned by this method can be completed exceptionally with the following
 *         exceptions.
 *         <ul>
 *         <li>SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
 *         Can be used for catch all scenarios.</li>
 *         <li>SdkClientException If any client side error occurs such as an IO related failure, failure to get
 *         credentials, etc.</li>
 *         <li>QueryException Base class for all service exceptions. Unknown exceptions will be thrown as an
 *         instance of this type.</li>
 *         </ul>
 * @sample QueryAsyncClient.GetOperationWithChecksum
 * @see <a href="https://docs.aws.amazon.com/goto/WebAPI/query-service-2010-05-08/GetOperationWithChecksum"
 *      target="_top">AWS API Documentation</a>
 */
@Override
public CompletableFuture<GetOperationWithChecksumResponse> getOperationWithChecksum(GetOperationWithChecksumRequest getOperationWithChecksumRequest) {
    List<MetricPublisher> metricPublishers = resolveMetricPublishers(clientConfiguration, getOperationWithChecksumRequest.overrideConfiguration().orElse(null));
    MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector.create("ApiCall");
    try {
        apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Query Service");
        apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetOperationWithChecksum");
        HttpResponseHandler<GetOperationWithChecksumResponse> responseHandler = protocolFactory.createResponseHandler(GetOperationWithChecksumResponse::builder);
        HttpResponseHandler<AwsServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler();
        CompletableFuture<GetOperationWithChecksumResponse> executeFuture = clientHandler.execute(new ClientExecutionParams<GetOperationWithChecksumRequest, GetOperationWithChecksumResponse>().withOperationName("GetOperationWithChecksum").withMarshaller(new GetOperationWithChecksumRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector).putExecutionAttribute(SdkInternalExecutionAttribute.HTTP_CHECKSUM, HttpChecksum.builder().requestChecksumRequired(true).requestAlgorithm(getOperationWithChecksumRequest.checksumAlgorithmAsString()).isRequestStreaming(false).build()).withInput(getOperationWithChecksumRequest));
        CompletableFuture<GetOperationWithChecksumResponse> whenCompleteFuture = null;
        whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
            metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
        });
        return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
    } catch (Throwable t) {
        metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
        return CompletableFutureUtils.failedFuture(t);
    }
}
Also used : ExceptionMetadata(software.amazon.awssdk.protocols.core.ExceptionMetadata) StreamingInputOperationRequestMarshaller(software.amazon.awssdk.services.query.transform.StreamingInputOperationRequestMarshaller) AwsAsyncClientHandler(software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler) LoggerFactory(org.slf4j.LoggerFactory) MetricPublisher(software.amazon.awssdk.metrics.MetricPublisher) QueryException(software.amazon.awssdk.services.query.model.QueryException) AsyncStreamingRequestMarshaller(software.amazon.awssdk.core.runtime.transform.AsyncStreamingRequestMarshaller) AsyncResponseTransformer(software.amazon.awssdk.core.async.AsyncResponseTransformer) SdkClientOption(software.amazon.awssdk.core.client.config.SdkClientOption) OperationWithChecksumRequiredResponse(software.amazon.awssdk.services.query.model.OperationWithChecksumRequiredResponse) AsyncClientHandler(software.amazon.awssdk.core.client.handler.AsyncClientHandler) APostOperationRequestMarshaller(software.amazon.awssdk.services.query.transform.APostOperationRequestMarshaller) AwsServiceException(software.amazon.awssdk.awscore.exception.AwsServiceException) StreamingOutputOperationResponse(software.amazon.awssdk.services.query.model.StreamingOutputOperationResponse) StreamingOutputOperationRequest(software.amazon.awssdk.services.query.model.StreamingOutputOperationRequest) List(java.util.List) AsyncRequestBody(software.amazon.awssdk.core.async.AsyncRequestBody) OperationWithChecksumRequiredRequest(software.amazon.awssdk.services.query.model.OperationWithChecksumRequiredRequest) AsyncAws4Signer(software.amazon.awssdk.auth.signer.AsyncAws4Signer) HttpResponseHandler(software.amazon.awssdk.core.http.HttpResponseHandler) PutOperationWithChecksumResponse(software.amazon.awssdk.services.query.model.PutOperationWithChecksumResponse) Generated(software.amazon.awssdk.annotations.Generated) AsyncResponseTransformerUtils(software.amazon.awssdk.core.async.AsyncResponseTransformerUtils) GetOperationWithChecksumRequest(software.amazon.awssdk.services.query.model.GetOperationWithChecksumRequest) AwsRequestOverrideConfiguration(software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration) Signer(software.amazon.awssdk.core.signer.Signer) PutOperationWithChecksumRequestMarshaller(software.amazon.awssdk.services.query.transform.PutOperationWithChecksumRequestMarshaller) OperationWithChecksumRequiredRequestMarshaller(software.amazon.awssdk.services.query.transform.OperationWithChecksumRequiredRequestMarshaller) CompletableFutureUtils(software.amazon.awssdk.utils.CompletableFutureUtils) CompletableFuture(java.util.concurrent.CompletableFuture) SdkClientConfiguration(software.amazon.awssdk.core.client.config.SdkClientConfiguration) StreamingOutputOperationRequestMarshaller(software.amazon.awssdk.services.query.transform.StreamingOutputOperationRequestMarshaller) StreamingInputOperationRequest(software.amazon.awssdk.services.query.model.StreamingInputOperationRequest) HttpChecksumRequired(software.amazon.awssdk.core.interceptor.trait.HttpChecksumRequired) CoreMetric(software.amazon.awssdk.core.metrics.CoreMetric) AwsQueryProtocolFactory(software.amazon.awssdk.protocols.query.AwsQueryProtocolFactory) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) RequestOverrideConfiguration(software.amazon.awssdk.core.RequestOverrideConfiguration) InvalidInputException(software.amazon.awssdk.services.query.model.InvalidInputException) APostOperationResponse(software.amazon.awssdk.services.query.model.APostOperationResponse) NoOpMetricCollector(software.amazon.awssdk.metrics.NoOpMetricCollector) GetOperationWithChecksumResponse(software.amazon.awssdk.services.query.model.GetOperationWithChecksumResponse) APostOperationWithOutputResponse(software.amazon.awssdk.services.query.model.APostOperationWithOutputResponse) APostOperationWithOutputRequestMarshaller(software.amazon.awssdk.services.query.transform.APostOperationWithOutputRequestMarshaller) Logger(org.slf4j.Logger) SdkInternalExecutionAttribute(software.amazon.awssdk.core.interceptor.SdkInternalExecutionAttribute) MetricCollector(software.amazon.awssdk.metrics.MetricCollector) QueryAsyncWaiter(software.amazon.awssdk.services.query.waiters.QueryAsyncWaiter) StreamingInputOperationResponse(software.amazon.awssdk.services.query.model.StreamingInputOperationResponse) Pair(software.amazon.awssdk.utils.Pair) PutOperationWithChecksumRequest(software.amazon.awssdk.services.query.model.PutOperationWithChecksumRequest) QueryRequest(software.amazon.awssdk.services.query.model.QueryRequest) Consumer(java.util.function.Consumer) HttpChecksum(software.amazon.awssdk.core.interceptor.trait.HttpChecksum) ClientExecutionParams(software.amazon.awssdk.core.client.handler.ClientExecutionParams) APostOperationWithOutputRequest(software.amazon.awssdk.services.query.model.APostOperationWithOutputRequest) APostOperationRequest(software.amazon.awssdk.services.query.model.APostOperationRequest) GetOperationWithChecksumRequestMarshaller(software.amazon.awssdk.services.query.transform.GetOperationWithChecksumRequestMarshaller) SdkInternalApi(software.amazon.awssdk.annotations.SdkInternalApi) FunctionalUtils.runAndLogError(software.amazon.awssdk.utils.FunctionalUtils.runAndLogError) Collections(java.util.Collections) ClientExecutionParams(software.amazon.awssdk.core.client.handler.ClientExecutionParams) GetOperationWithChecksumResponse(software.amazon.awssdk.services.query.model.GetOperationWithChecksumResponse) AwsServiceException(software.amazon.awssdk.awscore.exception.AwsServiceException) MetricPublisher(software.amazon.awssdk.metrics.MetricPublisher) NoOpMetricCollector(software.amazon.awssdk.metrics.NoOpMetricCollector) MetricCollector(software.amazon.awssdk.metrics.MetricCollector) GetOperationWithChecksumRequestMarshaller(software.amazon.awssdk.services.query.transform.GetOperationWithChecksumRequestMarshaller)

Example 42 with MetricCollector

use of software.amazon.awssdk.metrics.MetricCollector in project aws-sdk-java-v2 by aws.

the class DefaultQueryAsyncClient method streamingOutputOperation.

/**
 * Some operation with a streaming output
 *
 * @param streamingOutputOperationRequest
 * @param asyncResponseTransformer
 *        The response transformer for processing the streaming response in a non-blocking manner. See
 *        {@link AsyncResponseTransformer} for details on how this callback should be implemented and for links to
 *        precanned implementations for common scenarios like downloading to a file. The service documentation for
 *        the response content is as follows 'This be a stream'.
 * @return A future to the transformed result of the AsyncResponseTransformer.<br/>
 *         The CompletableFuture returned by this method can be completed exceptionally with the following
 *         exceptions.
 *         <ul>
 *         <li>SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
 *         Can be used for catch all scenarios.</li>
 *         <li>SdkClientException If any client side error occurs such as an IO related failure, failure to get
 *         credentials, etc.</li>
 *         <li>QueryException Base class for all service exceptions. Unknown exceptions will be thrown as an
 *         instance of this type.</li>
 *         </ul>
 * @sample QueryAsyncClient.StreamingOutputOperation
 * @see <a href="https://docs.aws.amazon.com/goto/WebAPI/query-service-2010-05-08/StreamingOutputOperation"
 *      target="_top">AWS API Documentation</a>
 */
@Override
public <ReturnT> CompletableFuture<ReturnT> streamingOutputOperation(StreamingOutputOperationRequest streamingOutputOperationRequest, AsyncResponseTransformer<StreamingOutputOperationResponse, ReturnT> asyncResponseTransformer) {
    List<MetricPublisher> metricPublishers = resolveMetricPublishers(clientConfiguration, streamingOutputOperationRequest.overrideConfiguration().orElse(null));
    MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector.create("ApiCall");
    try {
        apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Query Service");
        apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StreamingOutputOperation");
        Pair<AsyncResponseTransformer<StreamingOutputOperationResponse, ReturnT>, CompletableFuture<Void>> pair = AsyncResponseTransformerUtils.wrapWithEndOfStreamFuture(asyncResponseTransformer);
        asyncResponseTransformer = pair.left();
        CompletableFuture<Void> endOfStreamFuture = pair.right();
        HttpResponseHandler<StreamingOutputOperationResponse> responseHandler = protocolFactory.createResponseHandler(StreamingOutputOperationResponse::builder);
        HttpResponseHandler<AwsServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler();
        CompletableFuture<ReturnT> executeFuture = clientHandler.execute(new ClientExecutionParams<StreamingOutputOperationRequest, StreamingOutputOperationResponse>().withOperationName("StreamingOutputOperation").withMarshaller(new StreamingOutputOperationRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector).withInput(streamingOutputOperationRequest), asyncResponseTransformer);
        CompletableFuture<ReturnT> whenCompleteFuture = null;
        AsyncResponseTransformer<StreamingOutputOperationResponse, ReturnT> finalAsyncResponseTransformer = asyncResponseTransformer;
        whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
            if (e != null) {
                runAndLogError(log, "Exception thrown in exceptionOccurred callback, ignoring", () -> finalAsyncResponseTransformer.exceptionOccurred(e));
            }
            endOfStreamFuture.whenComplete((r2, e2) -> {
                metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
            });
        });
        return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
    } catch (Throwable t) {
        AsyncResponseTransformer<StreamingOutputOperationResponse, ReturnT> finalAsyncResponseTransformer = asyncResponseTransformer;
        runAndLogError(log, "Exception thrown in exceptionOccurred callback, ignoring", () -> finalAsyncResponseTransformer.exceptionOccurred(t));
        metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
        return CompletableFutureUtils.failedFuture(t);
    }
}
Also used : ExceptionMetadata(software.amazon.awssdk.protocols.core.ExceptionMetadata) StreamingInputOperationRequestMarshaller(software.amazon.awssdk.services.query.transform.StreamingInputOperationRequestMarshaller) AwsAsyncClientHandler(software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler) LoggerFactory(org.slf4j.LoggerFactory) MetricPublisher(software.amazon.awssdk.metrics.MetricPublisher) QueryException(software.amazon.awssdk.services.query.model.QueryException) AsyncStreamingRequestMarshaller(software.amazon.awssdk.core.runtime.transform.AsyncStreamingRequestMarshaller) AsyncResponseTransformer(software.amazon.awssdk.core.async.AsyncResponseTransformer) SdkClientOption(software.amazon.awssdk.core.client.config.SdkClientOption) OperationWithChecksumRequiredResponse(software.amazon.awssdk.services.query.model.OperationWithChecksumRequiredResponse) AsyncClientHandler(software.amazon.awssdk.core.client.handler.AsyncClientHandler) APostOperationRequestMarshaller(software.amazon.awssdk.services.query.transform.APostOperationRequestMarshaller) AwsServiceException(software.amazon.awssdk.awscore.exception.AwsServiceException) StreamingOutputOperationResponse(software.amazon.awssdk.services.query.model.StreamingOutputOperationResponse) StreamingOutputOperationRequest(software.amazon.awssdk.services.query.model.StreamingOutputOperationRequest) List(java.util.List) AsyncRequestBody(software.amazon.awssdk.core.async.AsyncRequestBody) OperationWithChecksumRequiredRequest(software.amazon.awssdk.services.query.model.OperationWithChecksumRequiredRequest) AsyncAws4Signer(software.amazon.awssdk.auth.signer.AsyncAws4Signer) HttpResponseHandler(software.amazon.awssdk.core.http.HttpResponseHandler) PutOperationWithChecksumResponse(software.amazon.awssdk.services.query.model.PutOperationWithChecksumResponse) Generated(software.amazon.awssdk.annotations.Generated) AsyncResponseTransformerUtils(software.amazon.awssdk.core.async.AsyncResponseTransformerUtils) GetOperationWithChecksumRequest(software.amazon.awssdk.services.query.model.GetOperationWithChecksumRequest) AwsRequestOverrideConfiguration(software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration) Signer(software.amazon.awssdk.core.signer.Signer) PutOperationWithChecksumRequestMarshaller(software.amazon.awssdk.services.query.transform.PutOperationWithChecksumRequestMarshaller) OperationWithChecksumRequiredRequestMarshaller(software.amazon.awssdk.services.query.transform.OperationWithChecksumRequiredRequestMarshaller) CompletableFutureUtils(software.amazon.awssdk.utils.CompletableFutureUtils) CompletableFuture(java.util.concurrent.CompletableFuture) SdkClientConfiguration(software.amazon.awssdk.core.client.config.SdkClientConfiguration) StreamingOutputOperationRequestMarshaller(software.amazon.awssdk.services.query.transform.StreamingOutputOperationRequestMarshaller) StreamingInputOperationRequest(software.amazon.awssdk.services.query.model.StreamingInputOperationRequest) HttpChecksumRequired(software.amazon.awssdk.core.interceptor.trait.HttpChecksumRequired) CoreMetric(software.amazon.awssdk.core.metrics.CoreMetric) AwsQueryProtocolFactory(software.amazon.awssdk.protocols.query.AwsQueryProtocolFactory) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) RequestOverrideConfiguration(software.amazon.awssdk.core.RequestOverrideConfiguration) InvalidInputException(software.amazon.awssdk.services.query.model.InvalidInputException) APostOperationResponse(software.amazon.awssdk.services.query.model.APostOperationResponse) NoOpMetricCollector(software.amazon.awssdk.metrics.NoOpMetricCollector) GetOperationWithChecksumResponse(software.amazon.awssdk.services.query.model.GetOperationWithChecksumResponse) APostOperationWithOutputResponse(software.amazon.awssdk.services.query.model.APostOperationWithOutputResponse) APostOperationWithOutputRequestMarshaller(software.amazon.awssdk.services.query.transform.APostOperationWithOutputRequestMarshaller) Logger(org.slf4j.Logger) SdkInternalExecutionAttribute(software.amazon.awssdk.core.interceptor.SdkInternalExecutionAttribute) MetricCollector(software.amazon.awssdk.metrics.MetricCollector) QueryAsyncWaiter(software.amazon.awssdk.services.query.waiters.QueryAsyncWaiter) StreamingInputOperationResponse(software.amazon.awssdk.services.query.model.StreamingInputOperationResponse) Pair(software.amazon.awssdk.utils.Pair) PutOperationWithChecksumRequest(software.amazon.awssdk.services.query.model.PutOperationWithChecksumRequest) QueryRequest(software.amazon.awssdk.services.query.model.QueryRequest) Consumer(java.util.function.Consumer) HttpChecksum(software.amazon.awssdk.core.interceptor.trait.HttpChecksum) ClientExecutionParams(software.amazon.awssdk.core.client.handler.ClientExecutionParams) APostOperationWithOutputRequest(software.amazon.awssdk.services.query.model.APostOperationWithOutputRequest) APostOperationRequest(software.amazon.awssdk.services.query.model.APostOperationRequest) GetOperationWithChecksumRequestMarshaller(software.amazon.awssdk.services.query.transform.GetOperationWithChecksumRequestMarshaller) SdkInternalApi(software.amazon.awssdk.annotations.SdkInternalApi) FunctionalUtils.runAndLogError(software.amazon.awssdk.utils.FunctionalUtils.runAndLogError) Collections(java.util.Collections) StreamingOutputOperationRequest(software.amazon.awssdk.services.query.model.StreamingOutputOperationRequest) MetricPublisher(software.amazon.awssdk.metrics.MetricPublisher) CompletableFuture(java.util.concurrent.CompletableFuture) StreamingOutputOperationRequestMarshaller(software.amazon.awssdk.services.query.transform.StreamingOutputOperationRequestMarshaller) AsyncResponseTransformer(software.amazon.awssdk.core.async.AsyncResponseTransformer) AwsServiceException(software.amazon.awssdk.awscore.exception.AwsServiceException) NoOpMetricCollector(software.amazon.awssdk.metrics.NoOpMetricCollector) MetricCollector(software.amazon.awssdk.metrics.MetricCollector) StreamingOutputOperationResponse(software.amazon.awssdk.services.query.model.StreamingOutputOperationResponse)

Example 43 with MetricCollector

use of software.amazon.awssdk.metrics.MetricCollector in project aws-sdk-java-v2 by aws.

the class DefaultXmlClient method aPostOperationWithOutput.

/**
 * <p>
 * Performs a post operation to the xml service and has modelled output
 * </p>
 *
 * @param aPostOperationWithOutputRequest
 * @return Result of the APostOperationWithOutput operation returned by the service.
 * @throws InvalidInputException
 *         The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
 * @throws SdkException
 *         Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
 *         catch all scenarios.
 * @throws SdkClientException
 *         If any client side error occurs such as an IO related failure, failure to get credentials, etc.
 * @throws XmlException
 *         Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
 * @sample XmlClient.APostOperationWithOutput
 * @see <a href="https://docs.aws.amazon.com/goto/WebAPI/xml-service-2010-05-08/APostOperationWithOutput"
 *      target="_top">AWS API Documentation</a>
 */
@Override
public APostOperationWithOutputResponse aPostOperationWithOutput(APostOperationWithOutputRequest aPostOperationWithOutputRequest) throws InvalidInputException, AwsServiceException, SdkClientException, XmlException {
    HttpResponseHandler<Response<APostOperationWithOutputResponse>> responseHandler = protocolFactory.createCombinedResponseHandler(APostOperationWithOutputResponse::builder, new XmlOperationMetadata().withHasStreamingSuccessResponse(false));
    List<MetricPublisher> metricPublishers = resolveMetricPublishers(clientConfiguration, aPostOperationWithOutputRequest.overrideConfiguration().orElse(null));
    MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector.create("ApiCall");
    try {
        apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Xml Service");
        apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "APostOperationWithOutput");
        return clientHandler.execute(new ClientExecutionParams<APostOperationWithOutputRequest, APostOperationWithOutputResponse>().withOperationName("APostOperationWithOutput").withCombinedResponseHandler(responseHandler).withMetricCollector(apiCallMetricCollector).withInput(aPostOperationWithOutputRequest).withMarshaller(new APostOperationWithOutputRequestMarshaller(protocolFactory)));
    } finally {
        metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
    }
}
Also used : StreamingInputOperationResponse(software.amazon.awssdk.services.xml.model.StreamingInputOperationResponse) GetOperationWithChecksumResponse(software.amazon.awssdk.services.xml.model.GetOperationWithChecksumResponse) StreamingOutputOperationResponse(software.amazon.awssdk.services.xml.model.StreamingOutputOperationResponse) PutOperationWithChecksumResponse(software.amazon.awssdk.services.xml.model.PutOperationWithChecksumResponse) Response(software.amazon.awssdk.core.Response) APostOperationWithOutputResponse(software.amazon.awssdk.services.xml.model.APostOperationWithOutputResponse) APostOperationResponse(software.amazon.awssdk.services.xml.model.APostOperationResponse) OperationWithChecksumRequiredResponse(software.amazon.awssdk.services.xml.model.OperationWithChecksumRequiredResponse) ClientExecutionParams(software.amazon.awssdk.core.client.handler.ClientExecutionParams) MetricPublisher(software.amazon.awssdk.metrics.MetricPublisher) NoOpMetricCollector(software.amazon.awssdk.metrics.NoOpMetricCollector) MetricCollector(software.amazon.awssdk.metrics.MetricCollector) XmlOperationMetadata(software.amazon.awssdk.protocols.xml.XmlOperationMetadata) APostOperationWithOutputRequestMarshaller(software.amazon.awssdk.services.xml.transform.APostOperationWithOutputRequestMarshaller) APostOperationWithOutputResponse(software.amazon.awssdk.services.xml.model.APostOperationWithOutputResponse)

Example 44 with MetricCollector

use of software.amazon.awssdk.metrics.MetricCollector in project aws-sdk-java-v2 by aws.

the class DefaultEndpointDiscoveryTestAsyncClient method testDiscoveryIdentifiersRequired.

/**
 * Invokes the TestDiscoveryIdentifiersRequired operation asynchronously.
 *
 * @param testDiscoveryIdentifiersRequiredRequest
 * @return A Java Future containing the result of the TestDiscoveryIdentifiersRequired operation returned by the
 *         service.<br/>
 *         The CompletableFuture returned by this method can be completed exceptionally with the following
 *         exceptions.
 *         <ul>
 *         <li>SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
 *         Can be used for catch all scenarios.</li>
 *         <li>SdkClientException If any client side error occurs such as an IO related failure, failure to get
 *         credentials, etc.</li>
 *         <li>EndpointDiscoveryTestException Base class for all service exceptions. Unknown exceptions will be
 *         thrown as an instance of this type.</li>
 *         </ul>
 * @sample EndpointDiscoveryTestAsyncClient.TestDiscoveryIdentifiersRequired
 */
@Override
public CompletableFuture<TestDiscoveryIdentifiersRequiredResponse> testDiscoveryIdentifiersRequired(TestDiscoveryIdentifiersRequiredRequest testDiscoveryIdentifiersRequiredRequest) {
    List<MetricPublisher> metricPublishers = resolveMetricPublishers(clientConfiguration, testDiscoveryIdentifiersRequiredRequest.overrideConfiguration().orElse(null));
    MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector.create("ApiCall");
    try {
        apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AwsEndpointDiscoveryTest");
        apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TestDiscoveryIdentifiersRequired");
        JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false).isPayloadJson(true).build();
        HttpResponseHandler<TestDiscoveryIdentifiersRequiredResponse> responseHandler = protocolFactory.createResponseHandler(operationMetadata, TestDiscoveryIdentifiersRequiredResponse::builder);
        HttpResponseHandler<AwsServiceException> errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata);
        boolean endpointDiscoveryEnabled = clientConfiguration.option(SdkClientOption.ENDPOINT_DISCOVERY_ENABLED);
        boolean endpointOverridden = clientConfiguration.option(SdkClientOption.ENDPOINT_OVERRIDDEN) == Boolean.TRUE;
        if (endpointOverridden) {
            throw new IllegalStateException("This operation requires endpoint discovery, but an endpoint override was specified when the client was created. This is not supported.");
        }
        if (!endpointDiscoveryEnabled) {
            throw new IllegalStateException("This operation requires endpoint discovery, but endpoint discovery was disabled on the client.");
        }
        URI cachedEndpoint = null;
        if (endpointDiscoveryEnabled) {
            String key = testDiscoveryIdentifiersRequiredRequest.overrideConfiguration().flatMap(AwsRequestOverrideConfiguration::credentialsProvider).orElseGet(() -> clientConfiguration.option(AwsClientOption.CREDENTIALS_PROVIDER)).resolveCredentials().accessKeyId();
            EndpointDiscoveryRequest endpointDiscoveryRequest = EndpointDiscoveryRequest.builder().required(true).defaultEndpoint(clientConfiguration.option(SdkClientOption.ENDPOINT)).overrideConfiguration(testDiscoveryIdentifiersRequiredRequest.overrideConfiguration().orElse(null)).build();
            cachedEndpoint = endpointDiscoveryCache.get(key, endpointDiscoveryRequest);
        }
        CompletableFuture<TestDiscoveryIdentifiersRequiredResponse> executeFuture = clientHandler.execute(new ClientExecutionParams<TestDiscoveryIdentifiersRequiredRequest, TestDiscoveryIdentifiersRequiredResponse>().withOperationName("TestDiscoveryIdentifiersRequired").withMarshaller(new TestDiscoveryIdentifiersRequiredRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector).discoveredEndpoint(cachedEndpoint).withInput(testDiscoveryIdentifiersRequiredRequest));
        CompletableFuture<TestDiscoveryIdentifiersRequiredResponse> 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);
    }
}
Also used : AwsJsonProtocol(software.amazon.awssdk.protocols.json.AwsJsonProtocol) AwsAsyncClientHandler(software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler) LoggerFactory(org.slf4j.LoggerFactory) CompletableFutureUtils(software.amazon.awssdk.utils.CompletableFutureUtils) CompletableFuture(java.util.concurrent.CompletableFuture) SdkClientConfiguration(software.amazon.awssdk.core.client.config.SdkClientConfiguration) DescribeEndpointsResponse(software.amazon.awssdk.services.endpointdiscoverytest.model.DescribeEndpointsResponse) TestDiscoveryRequiredRequestMarshaller(software.amazon.awssdk.services.endpointdiscoverytest.transform.TestDiscoveryRequiredRequestMarshaller) CoreMetric(software.amazon.awssdk.core.metrics.CoreMetric) TestDiscoveryIdentifiersRequiredRequestMarshaller(software.amazon.awssdk.services.endpointdiscoverytest.transform.TestDiscoveryIdentifiersRequiredRequestMarshaller) TestDiscoveryOptionalRequestMarshaller(software.amazon.awssdk.services.endpointdiscoverytest.transform.TestDiscoveryOptionalRequestMarshaller) MetricPublisher(software.amazon.awssdk.metrics.MetricPublisher) JsonOperationMetadata(software.amazon.awssdk.protocols.json.JsonOperationMetadata) BaseAwsJsonProtocolFactory(software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory) AwsClientOption(software.amazon.awssdk.awscore.client.config.AwsClientOption) RequestOverrideConfiguration(software.amazon.awssdk.core.RequestOverrideConfiguration) SdkClientOption(software.amazon.awssdk.core.client.config.SdkClientOption) URI(java.net.URI) NoOpMetricCollector(software.amazon.awssdk.metrics.NoOpMetricCollector) AsyncClientHandler(software.amazon.awssdk.core.client.handler.AsyncClientHandler) AwsServiceException(software.amazon.awssdk.awscore.exception.AwsServiceException) Logger(org.slf4j.Logger) MetricCollector(software.amazon.awssdk.metrics.MetricCollector) EndpointDiscoveryRefreshCache(software.amazon.awssdk.core.endpointdiscovery.EndpointDiscoveryRefreshCache) DescribeEndpointsRequestMarshaller(software.amazon.awssdk.services.endpointdiscoverytest.transform.DescribeEndpointsRequestMarshaller) EndpointDiscoveryTestException(software.amazon.awssdk.services.endpointdiscoverytest.model.EndpointDiscoveryTestException) TestDiscoveryOptionalResponse(software.amazon.awssdk.services.endpointdiscoverytest.model.TestDiscoveryOptionalResponse) List(java.util.List) TestDiscoveryRequiredResponse(software.amazon.awssdk.services.endpointdiscoverytest.model.TestDiscoveryRequiredResponse) ClientExecutionParams(software.amazon.awssdk.core.client.handler.ClientExecutionParams) EndpointDiscoveryRequest(software.amazon.awssdk.core.endpointdiscovery.EndpointDiscoveryRequest) TestDiscoveryRequiredRequest(software.amazon.awssdk.services.endpointdiscoverytest.model.TestDiscoveryRequiredRequest) SdkInternalApi(software.amazon.awssdk.annotations.SdkInternalApi) HttpResponseHandler(software.amazon.awssdk.core.http.HttpResponseHandler) TestDiscoveryIdentifiersRequiredRequest(software.amazon.awssdk.services.endpointdiscoverytest.model.TestDiscoveryIdentifiersRequiredRequest) AwsJsonProtocolFactory(software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory) FunctionalUtils.runAndLogError(software.amazon.awssdk.utils.FunctionalUtils.runAndLogError) Collections(java.util.Collections) TestDiscoveryIdentifiersRequiredResponse(software.amazon.awssdk.services.endpointdiscoverytest.model.TestDiscoveryIdentifiersRequiredResponse) Generated(software.amazon.awssdk.annotations.Generated) AwsRequestOverrideConfiguration(software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration) DescribeEndpointsRequest(software.amazon.awssdk.services.endpointdiscoverytest.model.DescribeEndpointsRequest) TestDiscoveryOptionalRequest(software.amazon.awssdk.services.endpointdiscoverytest.model.TestDiscoveryOptionalRequest) ClientExecutionParams(software.amazon.awssdk.core.client.handler.ClientExecutionParams) TestDiscoveryIdentifiersRequiredRequestMarshaller(software.amazon.awssdk.services.endpointdiscoverytest.transform.TestDiscoveryIdentifiersRequiredRequestMarshaller) MetricPublisher(software.amazon.awssdk.metrics.MetricPublisher) TestDiscoveryIdentifiersRequiredResponse(software.amazon.awssdk.services.endpointdiscoverytest.model.TestDiscoveryIdentifiersRequiredResponse) EndpointDiscoveryRequest(software.amazon.awssdk.core.endpointdiscovery.EndpointDiscoveryRequest) JsonOperationMetadata(software.amazon.awssdk.protocols.json.JsonOperationMetadata) URI(java.net.URI) AwsServiceException(software.amazon.awssdk.awscore.exception.AwsServiceException) NoOpMetricCollector(software.amazon.awssdk.metrics.NoOpMetricCollector) MetricCollector(software.amazon.awssdk.metrics.MetricCollector)

Example 45 with MetricCollector

use of software.amazon.awssdk.metrics.MetricCollector in project aws-sdk-java-v2 by aws.

the class DefaultJsonAsyncClient method putOperationWithChecksum.

/**
 * Invokes the PutOperationWithChecksum operation asynchronously.
 *
 * @param putOperationWithChecksumRequest
 * @param requestBody
 *        Functional interface that can be implemented to produce the request content in a non-blocking manner. The
 *        size of the content is expected to be known up front. See {@link AsyncRequestBody} for specific details on
 *        implementing this interface as well as links to precanned implementations for common scenarios like
 *        uploading from a file. The service documentation for the request content is as follows '
 *        <p>
 *        Object data.
 *        </p>
 *        '
 * @param asyncResponseTransformer
 *        The response transformer for processing the streaming response in a non-blocking manner. See
 *        {@link AsyncResponseTransformer} for details on how this callback should be implemented and for links to
 *        precanned implementations for common scenarios like downloading to a file. The service documentation for
 *        the response content is as follows '
 *        <p>
 *        Object data.
 *        </p>
 *        '.
 * @return A future to the transformed result of the AsyncResponseTransformer.<br/>
 *         The CompletableFuture returned by this method can be completed exceptionally with the following
 *         exceptions.
 *         <ul>
 *         <li>SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
 *         Can be used for catch all scenarios.</li>
 *         <li>SdkClientException If any client side error occurs such as an IO related failure, failure to get
 *         credentials, etc.</li>
 *         <li>JsonException Base class for all service exceptions. Unknown exceptions will be thrown as an instance
 *         of this type.</li>
 *         </ul>
 * @sample JsonAsyncClient.PutOperationWithChecksum
 * @see <a href="https://docs.aws.amazon.com/goto/WebAPI/json-service-2010-05-08/PutOperationWithChecksum"
 *      target="_top">AWS API Documentation</a>
 */
@Override
public <ReturnT> CompletableFuture<ReturnT> putOperationWithChecksum(PutOperationWithChecksumRequest putOperationWithChecksumRequest, AsyncRequestBody requestBody, AsyncResponseTransformer<PutOperationWithChecksumResponse, ReturnT> asyncResponseTransformer) {
    List<MetricPublisher> metricPublishers = resolveMetricPublishers(clientConfiguration, putOperationWithChecksumRequest.overrideConfiguration().orElse(null));
    MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector.create("ApiCall");
    try {
        apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service");
        apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutOperationWithChecksum");
        Pair<AsyncResponseTransformer<PutOperationWithChecksumResponse, ReturnT>, CompletableFuture<Void>> pair = AsyncResponseTransformerUtils.wrapWithEndOfStreamFuture(asyncResponseTransformer);
        asyncResponseTransformer = pair.left();
        CompletableFuture<Void> endOfStreamFuture = pair.right();
        if (!isSignerOverridden(clientConfiguration)) {
            putOperationWithChecksumRequest = applySignerOverride(putOperationWithChecksumRequest, AsyncAws4Signer.create());
        }
        JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(true).isPayloadJson(false).build();
        HttpResponseHandler<PutOperationWithChecksumResponse> responseHandler = protocolFactory.createResponseHandler(operationMetadata, PutOperationWithChecksumResponse::builder);
        HttpResponseHandler<AwsServiceException> errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata);
        CompletableFuture<ReturnT> executeFuture = clientHandler.execute(new ClientExecutionParams<PutOperationWithChecksumRequest, PutOperationWithChecksumResponse>().withOperationName("PutOperationWithChecksum").withMarshaller(AsyncStreamingRequestMarshaller.builder().delegateMarshaller(new PutOperationWithChecksumRequestMarshaller(protocolFactory)).asyncRequestBody(requestBody).build()).withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector).withAsyncRequestBody(requestBody).putExecutionAttribute(SdkInternalExecutionAttribute.HTTP_CHECKSUM, HttpChecksum.builder().requestChecksumRequired(false).requestValidationMode(putOperationWithChecksumRequest.checksumModeAsString()).responseAlgorithms("CRC32C", "CRC32", "SHA1", "SHA256").isRequestStreaming(true).build()).withInput(putOperationWithChecksumRequest), asyncResponseTransformer);
        AsyncResponseTransformer<PutOperationWithChecksumResponse, ReturnT> finalAsyncResponseTransformer = asyncResponseTransformer;
        CompletableFuture<ReturnT> whenCompleted = executeFuture.whenComplete((r, e) -> {
            if (e != null) {
                runAndLogError(log, "Exception thrown in exceptionOccurred callback, ignoring", () -> finalAsyncResponseTransformer.exceptionOccurred(e));
            }
            endOfStreamFuture.whenComplete((r2, e2) -> {
                metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
            });
        });
        executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
        return executeFuture;
    } catch (Throwable t) {
        AsyncResponseTransformer<PutOperationWithChecksumResponse, ReturnT> finalAsyncResponseTransformer = asyncResponseTransformer;
        runAndLogError(log, "Exception thrown in exceptionOccurred callback, ignoring", () -> finalAsyncResponseTransformer.exceptionOccurred(t));
        metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
        return CompletableFutureUtils.failedFuture(t);
    }
}
Also used : ExceptionMetadata(software.amazon.awssdk.protocols.core.ExceptionMetadata) AwsAsyncClientHandler(software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler) StreamingInputOutputOperationRequestMarshaller(software.amazon.awssdk.services.json.transform.StreamingInputOutputOperationRequestMarshaller) EventStreamOperationResponseHandler(software.amazon.awssdk.services.json.model.EventStreamOperationResponseHandler) AsyncStreamingRequestMarshaller(software.amazon.awssdk.core.runtime.transform.AsyncStreamingRequestMarshaller) AsyncResponseTransformer(software.amazon.awssdk.core.async.AsyncResponseTransformer) InputEventStreamTwo(software.amazon.awssdk.services.json.model.InputEventStreamTwo) StreamingInputOperationRequest(software.amazon.awssdk.services.json.model.StreamingInputOperationRequest) AsyncClientHandler(software.amazon.awssdk.core.client.handler.AsyncClientHandler) PaginatedOperationWithResultKeyResponse(software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyResponse) AwsServiceException(software.amazon.awssdk.awscore.exception.AwsServiceException) PaginatedOperationWithResultKeyPublisher(software.amazon.awssdk.services.json.paginators.PaginatedOperationWithResultKeyPublisher) EventStreamOperationWithOnlyInputRequestMarshaller(software.amazon.awssdk.services.json.transform.EventStreamOperationWithOnlyInputRequestMarshaller) APostOperationWithOutputResponse(software.amazon.awssdk.services.json.model.APostOperationWithOutputResponse) EventStream(software.amazon.awssdk.services.json.model.EventStream) APostOperationRequest(software.amazon.awssdk.services.json.model.APostOperationRequest) PaginatedOperationWithoutResultKeyPublisher(software.amazon.awssdk.services.json.paginators.PaginatedOperationWithoutResultKeyPublisher) PaginatedOperationWithoutResultKeyResponse(software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyResponse) AsyncRequestBody(software.amazon.awssdk.core.async.AsyncRequestBody) GetOperationWithChecksumResponse(software.amazon.awssdk.services.json.model.GetOperationWithChecksumResponse) AsyncAws4Signer(software.amazon.awssdk.auth.signer.AsyncAws4Signer) SdkAdvancedAsyncClientOption(software.amazon.awssdk.core.client.config.SdkAdvancedAsyncClientOption) APostOperationWithOutputRequestMarshaller(software.amazon.awssdk.services.json.transform.APostOperationWithOutputRequestMarshaller) PutOperationWithChecksumRequestMarshaller(software.amazon.awssdk.services.json.transform.PutOperationWithChecksumRequestMarshaller) EventStreamOperationRequest(software.amazon.awssdk.services.json.model.EventStreamOperationRequest) HttpResponseHandler(software.amazon.awssdk.core.http.HttpResponseHandler) Generated(software.amazon.awssdk.annotations.Generated) AsyncResponseTransformerUtils(software.amazon.awssdk.core.async.AsyncResponseTransformerUtils) PaginatedOperationWithResultKeyRequestMarshaller(software.amazon.awssdk.services.json.transform.PaginatedOperationWithResultKeyRequestMarshaller) PaginatedOperationWithoutResultKeyRequestMarshaller(software.amazon.awssdk.services.json.transform.PaginatedOperationWithoutResultKeyRequestMarshaller) OperationWithChecksumRequiredResponse(software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredResponse) EventStreamTaggedUnionJsonMarshaller(software.amazon.awssdk.awscore.eventstream.EventStreamTaggedUnionJsonMarshaller) VoidSdkResponse(software.amazon.awssdk.core.protocol.VoidSdkResponse) CompletableFutureUtils(software.amazon.awssdk.utils.CompletableFutureUtils) SdkClientConfiguration(software.amazon.awssdk.core.client.config.SdkClientConfiguration) VersionInfo(software.amazon.awssdk.core.util.VersionInfo) PaginatedOperationWithResultKeyRequest(software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest) CoreMetric(software.amazon.awssdk.core.metrics.CoreMetric) BaseAwsJsonProtocolFactory(software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory) RequestOverrideConfiguration(software.amazon.awssdk.core.RequestOverrideConfiguration) EventStreamOperationWithOnlyOutputResponse(software.amazon.awssdk.services.json.model.EventStreamOperationWithOnlyOutputResponse) StreamingOutputOperationRequest(software.amazon.awssdk.services.json.model.StreamingOutputOperationRequest) InputEventTwoMarshaller(software.amazon.awssdk.services.json.transform.InputEventTwoMarshaller) SdkInternalExecutionAttribute(software.amazon.awssdk.core.interceptor.SdkInternalExecutionAttribute) MetricCollector(software.amazon.awssdk.metrics.MetricCollector) Executor(java.util.concurrent.Executor) Publisher(org.reactivestreams.Publisher) APostOperationWithOutputRequest(software.amazon.awssdk.services.json.model.APostOperationWithOutputRequest) HttpChecksum(software.amazon.awssdk.core.interceptor.trait.HttpChecksum) EventStreamOperationWithOnlyInputResponse(software.amazon.awssdk.services.json.model.EventStreamOperationWithOnlyInputResponse) SdkInternalApi(software.amazon.awssdk.annotations.SdkInternalApi) GetWithoutRequiredMembersResponse(software.amazon.awssdk.services.json.model.GetWithoutRequiredMembersResponse) DefaultInputEventTwo(software.amazon.awssdk.services.json.model.inputeventstreamtwo.DefaultInputEventTwo) GetWithoutRequiredMembersRequestMarshaller(software.amazon.awssdk.services.json.transform.GetWithoutRequiredMembersRequestMarshaller) LoggerFactory(org.slf4j.LoggerFactory) StreamingInputOperationRequestMarshaller(software.amazon.awssdk.services.json.transform.StreamingInputOperationRequestMarshaller) RestEventStreamAsyncResponseTransformer(software.amazon.awssdk.awscore.eventstream.RestEventStreamAsyncResponseTransformer) GetOperationWithChecksumRequest(software.amazon.awssdk.services.json.model.GetOperationWithChecksumRequest) ByteBuffer(java.nio.ByteBuffer) JsonException(software.amazon.awssdk.services.json.model.JsonException) MetricPublisher(software.amazon.awssdk.metrics.MetricPublisher) DefaultInputEvent(software.amazon.awssdk.services.json.model.inputeventstream.DefaultInputEvent) JsonOperationMetadata(software.amazon.awssdk.protocols.json.JsonOperationMetadata) EventStreamOperationWithOnlyInputRequest(software.amazon.awssdk.services.json.model.EventStreamOperationWithOnlyInputRequest) ApiName(software.amazon.awssdk.core.ApiName) GetWithoutRequiredMembersRequest(software.amazon.awssdk.services.json.model.GetWithoutRequiredMembersRequest) PutOperationWithChecksumResponse(software.amazon.awssdk.services.json.model.PutOperationWithChecksumResponse) SdkClientOption(software.amazon.awssdk.core.client.config.SdkClientOption) HostnameValidator(software.amazon.awssdk.utils.HostnameValidator) StreamingOutputOperationResponse(software.amazon.awssdk.services.json.model.StreamingOutputOperationResponse) APostOperationRequestMarshaller(software.amazon.awssdk.services.json.transform.APostOperationRequestMarshaller) StreamingInputOperationResponse(software.amazon.awssdk.services.json.model.StreamingInputOperationResponse) EventStreamOperationRequestMarshaller(software.amazon.awssdk.services.json.transform.EventStreamOperationRequestMarshaller) DefaultInputEventOne(software.amazon.awssdk.services.json.model.inputeventstreamtwo.DefaultInputEventOne) SdkPojoBuilder(software.amazon.awssdk.core.SdkPojoBuilder) InputEventMarshaller(software.amazon.awssdk.services.json.transform.InputEventMarshaller) OperationWithChecksumRequiredRequest(software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredRequest) InputEventStream(software.amazon.awssdk.services.json.model.InputEventStream) GetOperationWithChecksumRequestMarshaller(software.amazon.awssdk.services.json.transform.GetOperationWithChecksumRequestMarshaller) List(java.util.List) APostOperationResponse(software.amazon.awssdk.services.json.model.APostOperationResponse) StreamingInputOutputOperationRequest(software.amazon.awssdk.services.json.model.StreamingInputOutputOperationRequest) AttachHttpMetadataResponseHandler(software.amazon.awssdk.core.client.handler.AttachHttpMetadataResponseHandler) Aws4UnsignedPayloadSigner(software.amazon.awssdk.auth.signer.Aws4UnsignedPayloadSigner) JsonRequest(software.amazon.awssdk.services.json.model.JsonRequest) EventStreamOperationWithOnlyOutputRequestMarshaller(software.amazon.awssdk.services.json.transform.EventStreamOperationWithOnlyOutputRequestMarshaller) OperationWithChecksumRequiredRequestMarshaller(software.amazon.awssdk.services.json.transform.OperationWithChecksumRequiredRequestMarshaller) AwsRequestOverrideConfiguration(software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration) Signer(software.amazon.awssdk.core.signer.Signer) AwsJsonProtocol(software.amazon.awssdk.protocols.json.AwsJsonProtocol) PutOperationWithChecksumRequest(software.amazon.awssdk.services.json.model.PutOperationWithChecksumRequest) EventStreamAsyncResponseTransformer(software.amazon.awssdk.awscore.eventstream.EventStreamAsyncResponseTransformer) EventStreamTaggedUnionPojoSupplier(software.amazon.awssdk.awscore.eventstream.EventStreamTaggedUnionPojoSupplier) CompletableFuture(java.util.concurrent.CompletableFuture) HttpChecksumRequired(software.amazon.awssdk.core.interceptor.trait.HttpChecksumRequired) InvalidInputException(software.amazon.awssdk.services.json.model.InvalidInputException) NoOpMetricCollector(software.amazon.awssdk.metrics.NoOpMetricCollector) PaginatedOperationWithoutResultKeyRequest(software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyRequest) Logger(org.slf4j.Logger) EventStreamOperationWithOnlyOutputRequest(software.amazon.awssdk.services.json.model.EventStreamOperationWithOnlyOutputRequest) Pair(software.amazon.awssdk.utils.Pair) SdkPublisher(software.amazon.awssdk.core.async.SdkPublisher) EventStreamAws4Signer(software.amazon.awssdk.auth.signer.EventStreamAws4Signer) Consumer(java.util.function.Consumer) StreamingOutputOperationRequestMarshaller(software.amazon.awssdk.services.json.transform.StreamingOutputOperationRequestMarshaller) ClientExecutionParams(software.amazon.awssdk.core.client.handler.ClientExecutionParams) EventStreamOperationWithOnlyOutputResponseHandler(software.amazon.awssdk.services.json.model.EventStreamOperationWithOnlyOutputResponseHandler) StreamingInputOutputOperationResponse(software.amazon.awssdk.services.json.model.StreamingInputOutputOperationResponse) AwsClientHandlerUtils(software.amazon.awssdk.awscore.client.handler.AwsClientHandlerUtils) EventStreamOperationResponse(software.amazon.awssdk.services.json.model.EventStreamOperationResponse) SdkResponse(software.amazon.awssdk.core.SdkResponse) AwsJsonProtocolFactory(software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory) FunctionalUtils.runAndLogError(software.amazon.awssdk.utils.FunctionalUtils.runAndLogError) Collections(java.util.Collections) MetricPublisher(software.amazon.awssdk.metrics.MetricPublisher) JsonOperationMetadata(software.amazon.awssdk.protocols.json.JsonOperationMetadata) PutOperationWithChecksumRequest(software.amazon.awssdk.services.json.model.PutOperationWithChecksumRequest) CompletableFuture(java.util.concurrent.CompletableFuture) AsyncResponseTransformer(software.amazon.awssdk.core.async.AsyncResponseTransformer) RestEventStreamAsyncResponseTransformer(software.amazon.awssdk.awscore.eventstream.RestEventStreamAsyncResponseTransformer) EventStreamAsyncResponseTransformer(software.amazon.awssdk.awscore.eventstream.EventStreamAsyncResponseTransformer) PutOperationWithChecksumRequestMarshaller(software.amazon.awssdk.services.json.transform.PutOperationWithChecksumRequestMarshaller) AwsServiceException(software.amazon.awssdk.awscore.exception.AwsServiceException) MetricCollector(software.amazon.awssdk.metrics.MetricCollector) NoOpMetricCollector(software.amazon.awssdk.metrics.NoOpMetricCollector) PutOperationWithChecksumResponse(software.amazon.awssdk.services.json.model.PutOperationWithChecksumResponse)

Aggregations

MetricCollector (software.amazon.awssdk.metrics.MetricCollector)115 NoOpMetricCollector (software.amazon.awssdk.metrics.NoOpMetricCollector)65 MetricPublisher (software.amazon.awssdk.metrics.MetricPublisher)64 AwsServiceException (software.amazon.awssdk.awscore.exception.AwsServiceException)59 ClientExecutionParams (software.amazon.awssdk.core.client.handler.ClientExecutionParams)47 CompletableFuture (java.util.concurrent.CompletableFuture)37 JsonOperationMetadata (software.amazon.awssdk.protocols.json.JsonOperationMetadata)35 Collections (java.util.Collections)34 List (java.util.List)34 Logger (org.slf4j.Logger)34 LoggerFactory (org.slf4j.LoggerFactory)34 Generated (software.amazon.awssdk.annotations.Generated)34 SdkInternalApi (software.amazon.awssdk.annotations.SdkInternalApi)34 AwsAsyncClientHandler (software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler)34 RequestOverrideConfiguration (software.amazon.awssdk.core.RequestOverrideConfiguration)34 SdkClientConfiguration (software.amazon.awssdk.core.client.config.SdkClientConfiguration)34 SdkClientOption (software.amazon.awssdk.core.client.config.SdkClientOption)34 AsyncClientHandler (software.amazon.awssdk.core.client.handler.AsyncClientHandler)34 HttpResponseHandler (software.amazon.awssdk.core.http.HttpResponseHandler)34 CoreMetric (software.amazon.awssdk.core.metrics.CoreMetric)34