-
Notifications
You must be signed in to change notification settings - Fork 913
Better arn parsing #6163
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?
Better arn parsing #6163
Conversation
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.
Looks good, just need a a changelog
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.
Don't we need to update account ID code path to use this new method?
Separate internal Arn class used in endpoints logic already returns Optional |
b5c8985
to
0b61c58
Compare
|
Motivation and Context
Addresses #6108 .
Currently the SDK uses exceptions as control flow for arn parsing. This is an anti pattern in Java and can cause performance overhead.
Modifications
This PR adds another arn parsing method
tryFromString(arn)
that would return an Optional of Arn when the arn is valid, and an empty when it is invalid - this avoids the hot path of throwing exceptions as control flow.Testing
Unit tests: