-
Notifications
You must be signed in to change notification settings - Fork 906
URI cache for DynamoDB account id based endpoint #6087
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
base: master
Are you sure you want to change the base?
Conversation
…' into feature/master/endpoint-id-cache
…' into feature/master/endpoint-id-cache
utils/src/main/java/software/amazon/awssdk/utils/cache/lru/LruCache.java
Outdated
Show resolved
Hide resolved
utils/src/main/java/software/amazon/awssdk/utils/uri/SdkUri.java
Outdated
Show resolved
Hide resolved
utils/src/main/java/software/amazon/awssdk/utils/uri/SdkUri.java
Outdated
Show resolved
Hide resolved
utils/src/main/java/software/amazon/awssdk/utils/uri/SdkUri.java
Outdated
Show resolved
Hide resolved
codegen/src/main/java/software/amazon/awssdk/codegen/poet/rules2/CodeGeneratorVisitor.java
Show resolved
Hide resolved
- added codegen tests - added equals & hash-code test for ConstructorArgs classes - fix cache size - SdkUri constructor - checkstyle complained about newURI -> renamed newUri
…' into feature/master/endpoint-id-cache
@@ -359,4 +359,8 @@ | |||
<Class name="software.amazon.awssdk.v2migration.EnumCasingToV2$Visitor"/> | |||
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/> | |||
</Match> | |||
<Match> | |||
<Class name="software.amazon.awssdk.utils.uri.SdkUri" /> | |||
<Bug pattern="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE" /> |
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.
Question: where do we cast?
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.
|
boolean containsK = cache.containsKey(key); | ||
URI uri = cache.get(key); |
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 isn't 100% reliable since the key could have been inserted between 64 and 65. Do we actually need to log this? If we do, should it be done within LruCache
instead?
String authority, | ||
String path, String query, String fragment) throws URISyntaxException { | ||
if (!isAccountIdUri(authority)) { | ||
log.trace(() -> "skipping cache for authority" + authority); |
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.
nit: space after authority
*/ | ||
private boolean isAccountIdUri(String s) { | ||
int firstCharAfterScheme = 0; | ||
int maxIntSizeBase10 = 10; |
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.
Make static constant. Also maybe maxIntDigitsBase10
String userInfo, String host, int port, | ||
String path, String query, String fragment) throws URISyntaxException { | ||
if (!isAccountIdUri(host)) { | ||
log.trace(() -> "skipping cache for host" + host); |
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.
nit: space after host
Motivation and Context
Add caching for account id based endpoint in front of the URI constructors
Modifications
SdkURI
class which caches calls to the various URI constructors methods.SdkURI
class in generated endpoint resolution code. Enabled this config only for DynamoDB.Testing
Types of changes