@SdkInternalApi
    final StopPipelineExecutionResult executeStopPipelineExecution(StopPipelineExecutionRequest stopPipelineExecutionRequest) {

        ExecutionContext executionContext = createExecutionContext(stopPipelineExecutionRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<StopPipelineExecutionRequest> request = null;
        Response<StopPipelineExecutionResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new StopPipelineExecutionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopPipelineExecutionRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
                request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
                request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
                request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
                request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopPipelineExecution");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

            } finally {
                awsRequestMetrics.endEvent(Field.RequestMarshallTime);
            }

            HttpResponseHandler<AmazonWebServiceResponse<StopPipelineExecutionResult>> responseHandler = protocolFactory
                    .createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
                            new StopPipelineExecutionResultJsonUnmarshaller());
            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Stops a pipeline execution.
</p>
<p>
<b>Callback Step</b>
</p>
<p>
A pipeline execution won't stop while a callback step is running. When you call
<code>StopPipelineExecution</code> on a pipeline execution with a running callback step, SageMaker Pipelines
sends an additional Amazon SQS message to the specified SQS queue. The body of the SQS message contains a
"Status" field which is set to "Stopping".
</p>
<p>
You should add logic to your Amazon SQS message consumer to take any needed action (for example, resource
cleanup) upon receipt of the message followed by a call to <code>SendPipelineExecutionStepSuccess</code> or
<code>SendPipelineExecutionStepFailure</code>.
</p>
<p>
Only when SageMaker Pipelines receives one of these calls will it stop the pipeline execution.
</p>
<p>
<b>Lambda Step</b>
</p>
<p>
A pipeline execution can't be stopped while a lambda step is running because the Lambda function invoked by the
lambda step can't be stopped. If you attempt to stop the execution while the Lambda function is running, the
pipeline waits for the Lambda function to finish or until the timeout is hit, whichever occurs first, and then
stops. If the Lambda function finishes, the pipeline execution status is <code>Stopped</code>. If the timeout is
hit the pipeline execution status is <code>Failed</code>.
</p>

@param stopPipelineExecutionRequest
@return Result of the StopPipelineExecution operation returned by the service.
@throws ResourceNotFoundException
        Resource being access is not found.
@throws ConflictException
        There was a conflict when you attempted to modify a SageMaker entity such as an <code>Experiment</code>
        or <code>Artifact</code>.
@sample AmazonSageMaker.StopPipelineExecution
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopPipelineExecution"
     target="_top">AWS API Documentation</a>
aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/AmazonSageMakerClient.java