@SdkInternalApi
    final CreateReplaceRootVolumeTaskResult executeCreateReplaceRootVolumeTask(CreateReplaceRootVolumeTaskRequest createReplaceRootVolumeTaskRequest) {

        ExecutionContext executionContext = createExecutionContext(createReplaceRootVolumeTaskRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<CreateReplaceRootVolumeTaskRequest> request = null;
        Response<CreateReplaceRootVolumeTaskResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new CreateReplaceRootVolumeTaskRequestMarshaller().marshall(super.beforeMarshalling(createReplaceRootVolumeTaskRequest));
                // 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, "EC2");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateReplaceRootVolumeTask");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

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

            StaxResponseHandler<CreateReplaceRootVolumeTaskResult> responseHandler = new StaxResponseHandler<CreateReplaceRootVolumeTaskResult>(
                    new CreateReplaceRootVolumeTaskResultStaxUnmarshaller());

            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Replaces the EBS-backed root volume for a <code>running</code> instance with a new volume that is restored to the
original root volume's launch state, that is restored to a specific snapshot taken from the original root volume,
or that is restored from an AMI that has the same key characteristics as that of the instance.
</p>
<p>
For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/replace-root.html">Replace
a root volume</a> in the <i>Amazon EC2 User Guide</i>.
</p>

@param createReplaceRootVolumeTaskRequest
@return Result of the CreateReplaceRootVolumeTask operation returned by the service.
@sample AmazonEC2.CreateReplaceRootVolumeTask
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateReplaceRootVolumeTask"
     target="_top">AWS API Documentation</a>
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/AmazonEC2Client.java