-
Notifications
You must be signed in to change notification settings - Fork 914
Adding batchManager() method into code generated sync and async clients #2666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
zoewangg
merged 26 commits into
aws:feature/master/automatic-request-batching
from
16lim21:feature/master/automatic-request-batching
Aug 19, 2021
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
56bf8ed
Moving protected APIs out of internal package
a1a5022
Refactoring test import
3e10d3c
Adding configurable option for users to specify batchKey and batchBuf…
19ac4a0
Modifying batchBuffer and batchingMap to handle limits
91a9bc0
Returning exception on batch entry failure
e56da96
Modifying test to expect exception on batch entry failure
3c60b32
Refactoring core DefaultBatchManager
9a67cb0
Modifying SqsBatchManager and associated files to accept generated cl…
cd6ea6b
Adding batchManager configuration class
8ff9aa1
Adding batchManager config into CustomizationConfig
7a15a33
Adding batchManager() method
18ffd5a
Adding batchManager config into sqs customization.config
9445a55
Removed need for a hasExecutor and hasScheduledExecutor configuration
63a83df
Removed need to check and sepcify instance type
fd2b869
Adding .batchManager() method to async client
82dd2cd
Removing create() method in AsyncBatchManager and adding async batch …
d47456e
Merge branch 'feature/master/automatic-request-batching-codegenChange…
74b057b
Adding expected generated test files
1388fed
Adding tests for codegen batchManager() method
9300a44
Modifying SqsBatchManager tests to use client's batchManager() method
2545bfa
Modifying codegen to use a scheduledExecutor (sync clients don't supp…
000288a
Addressing PR comments
31b7e4f
Addressing more PR comments
b83022e
Only create default executor if builder.executor is null. Adding test…
676d5e6
Fixing checkstyle issues
419833d
Reverting to using Executor instead of ExecutorService
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
...in/java/software/amazon/awssdk/codegen/model/config/customization/BatchManagerMethod.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
package software.amazon.awssdk.codegen.model.config.customization; | ||
|
||
/** | ||
* Config required to generate a batchManager method that returns an instance of a BatchManager in addition to any required | ||
* executors or scheduledExecutors. | ||
*/ | ||
public class BatchManagerMethod { | ||
|
||
public static final String METHOD_NAME = "batchManager"; | ||
|
||
/** Fqcn of the return type of the operation for the sync client */ | ||
private String returnType; | ||
|
||
/** Fqcn of the return type of the operation for the async client */ | ||
private String asyncReturnType; | ||
|
||
public String getReturnType() { | ||
return returnType; | ||
} | ||
|
||
public void setReturnType(String returnType) { | ||
this.returnType = returnType; | ||
} | ||
|
||
public String getAsyncReturnType() { | ||
return asyncReturnType; | ||
} | ||
|
||
public void setAsyncReturnType(String asyncReturnType) { | ||
this.asyncReturnType = asyncReturnType; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...esources/software/amazon/awssdk/codegen/poet/client/c2j/batchmanager/customization.config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"batchManagerMethod": { | ||
"returnType": "software.amazon.awssdk.services.batchmanagertest.batchmanager.SyncBatchManagerTest", | ||
"asyncReturnType": "software.amazon.awssdk.services.batchmanagertest.batchmanager.AsyncBatchManagerTest" | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...test/resources/software/amazon/awssdk/codegen/poet/client/c2j/batchmanager/service-2.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"version":"2.0", | ||
"metadata":{ | ||
"apiVersion":"2016-03-11", | ||
"endpointPrefix":"batchmanager", | ||
"jsonVersion":"1.1", | ||
"protocol":"rest-json", | ||
"serviceAbbreviation":"BatchManager", | ||
"serviceFullName":"BatchManager", | ||
"serviceId":"BatchManager", | ||
"signatureVersion":"v4", | ||
"uid":"batchmanager-2016-03-11" | ||
}, | ||
"operations":{ | ||
}, | ||
"shapes": { | ||
"String":{"type":"string"} | ||
}, | ||
"documentation": "A service that implements the batchManager() method" | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.