Skip to content

Conversation

@dchakrav-github
Copy link
Contributor

Description of changes:

Allow for automated call graph generation to keep contexts unique
inside StdCallbackContext for replay deduping. Now developers do not need to
provide a name when calling services. One is auto-generated with the
SdkClient service name and IAM action named from Request type used.

     ProgressEvent<Model, StdCallbackContext> result = initiator
        .translateToServiceRequest(m -> )
        .makeServiceCall((r, c) -> c.injectCredentialsAndInvokeV2(r, c.client()::createRepository))
        .success();

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ammokhov ammokhov added the enhancement New feature or request label Apr 24, 2020
StdCallbackContext for replay deduping. Now developers do not need to
provide a name when calling services. There is a unique call graph
context maintained for each service call made. The context is request
aware, so different requests made will have their own independent
context for dedupe

Dedupe identical requests

```java
   ProgressEvent<Model, StdCallbackContext> result =
      initiator.translateToServiceRequest(m -> createRepository)
         .makeServiceCall((r, c) ->
            c.injectCredentialsAndInvokeV2(
                r, c.client()::createRepository))
         .success();

   ProgressEvent<Model, StdCallbackContext> result_2 =
       // make same request call
       initiator.translateToServiceRequest(m -> createRepository)
           .makeServiceCall((r, c) ->
              c.injectCredentialsAndInvokeV2(
                r, c.client()::createRepository))
           .success();

   assertThat(result).isEqualsTo(result_2);

```
? ((SdkClient) client_).serviceName()
: client_.getClass().getSimpleName());
String requestName = request != null ? request.getClass().getSimpleName().replace("Request", "") : "";
String callGraph = serviceName + ":" + requestName + "-" + (incoming != null ? incoming : "") + "-"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we lowercase the final value?

@dchakrav-github dchakrav-github merged commit 18f6179 into aws-cloudformation:master Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants