-
Notifications
You must be signed in to change notification settings - Fork 122
Making client suppliers composable #163
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
Conversation
@@ -73,10 +72,10 @@ public MultiRegionRecordPusherExample(final Region[] regions, final String kmsAl | |||
.build()); | |||
|
|||
keyrings.add(StandardKeyrings.awsKmsBuilder() | |||
.awsKmsClientSupplier(AwsKmsClientSupplier.builder() | |||
.awsKmsClientSupplier(new AllowRegionsAwsKmsClientSupplier(Collections.singleton(region.getName()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have all of these nice builders, why is this one new
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seemed like it might be overkill to have a builder here, but I can make one too. I wasn't really satisfied with the mix of builders and constructors either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to worry about thread-safety?
|
||
private AWSCredentialsProvider credentialsProvider; | ||
private ClientConfiguration clientConfiguration; | ||
private final Map<String, AWSKMS> clientsCache = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look to be thread-safe. Should this be a ConcurrentHashMap
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll make it ConcurrentHashMap. The RegionalClientSupplier that MKPs use also used a ConcurrentHashMap
src/main/java/com/amazonaws/encryptionsdk/kms/StandardAwsKmsClientSuppliers.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description of changes:
Making the Aws KMS client suppliers composable to match the design of the Python and JS ESDKs
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Check any applicable: