Skip to content

Conversation

@16lim21
Copy link
Contributor

@16lim21 16lim21 commented Aug 25, 2021

Motivation and Context

Service specific batch managers will rely on a BatchFunctions utility file that defines all the necessary work to map combine individual requests to batch requests, map batch responses back to individual responses, and to generate batchKeys from a request. Of the files/classes related a service batch manager, this is the most complicated so I put the modifications in a separate PR from the other classes.

Description

Added code generation for the BatchFunctions file. Code generation for the rest of the service batch manager classes will be done in a separate PR.

Testing

Added codegen tests to check the generated batchFunctions class matched expectations for it. Also had to modify the other codegen tests since the service-2.json file had to be modified to include some operations and classes (since I am no parsing the service-2.json file to extract the shapes).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed
  • A short description of the change has been added to the CHANGELOG
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@16lim21 16lim21 changed the title Feature/master/automatic request batching Code generation for Service BatchFunctions class Aug 26, 2021
@16lim21
Copy link
Contributor Author

16lim21 commented Aug 26, 2021

There are only a few code smells. Most are TODOs and 2 are related to code duplication (just some really short strings that are reused but wouldn't make sense to make into a constant).

}

private String methodNameFromMemberModel(String memberModelName) {
// Have to lowercase second char as well since MD5 methods/members have the D capitalized as well
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems this does not cover for the case where more than 2 characters are capitalized.

Can we use this method instead? https://github.com/aws/aws-sdk-java-v2/blob/master/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/MemberModel.java#L174

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

90.9% 90.9% Coverage
0.2% 0.2% Duplication

@zoewangg zoewangg merged commit a04369a into aws:feature/master/automatic-request-batching Aug 27, 2021
aws-sdk-java-automation added a commit that referenced this pull request Sep 7, 2023
…5c0d218d1

Pull request: release <- staging/edc1b242-cf39-400b-b82e-b485c0d218d1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants