Adding Retry policy to provide optional capabilities#36
Open
michaelraney wants to merge 1 commit intoaws:masterfrom
Open
Adding Retry policy to provide optional capabilities#36michaelraney wants to merge 1 commit intoaws:masterfrom
michaelraney wants to merge 1 commit intoaws:masterfrom
Conversation
Adding retry policy and exponential retry policy. When errors occur do to WriteThrottle, ReadThrottle, or System error, Keyspaces returns Cassandra timeout value. This retry policy helps customers retry these errors which are transient.
ch-yogya
reviewed
Jun 17, 2025
|
|
||
| ``` | ||
| advanced.retry-policy { | ||
| class = com.aws.ssa.keyspaces.retry.AmazonKeyspacesRetryPolicy |
There was a problem hiding this comment.
Out of curiosity, How is this class path arrived at? I see this is different from the path used within the classes defined in this PR.
There was a problem hiding this comment.
These classes are being carried over from https://github.com/aws-samples/amazon-keyspaces-java-driver-helpers/blob/main/src/main/java/com/aws/ssa/keyspaces/retry/AmazonKeyspacesRetryPolicy.java to this package and thus the class path will need to be updated now?
ch-yogya
reviewed
Jun 17, 2025
|
|
||
| long timeToWaitCalculation = Math.max(minWaitTime, exponentialWaitWithJitter); | ||
|
|
||
| long timeToWaitFinal = Math.min(maxWaitTime, timeToWaitCalculation); |
There was a problem hiding this comment.
Can we rename the variable - totalTimeToWait
|
|
||
| stopwatch.stop(); | ||
|
|
||
| long millsObserved = stopwatch.elapsed().toMillis(); |
|
|
||
| stopwatch.stop(); | ||
|
|
||
| long millsObserved = stopwatch.elapsed().toMillis(); |
|
|
||
| stopwatch.stop(); | ||
|
|
||
| long millsObserved = stopwatch.elapsed().toMillis(); |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adding retry policy and exponential retry policy. When errors occur do to WriteThrottle, ReadThrottle, or System error, Keyspaces returns Cassandra timeout value. This retry policy helps customers retry these errors which are mainly transient in Amazon Keyspaces.
Issue #, if available:
Description of changes:
Including two retry polices. AmazonKeyspacesRetryPolicy and AmazonKeyspacesExponentialRetryPolicy. Both policies have configurable number of retries, but the expoential policy adds an exponential increasing delay between retry attempts. The developer has the ability to customize min wait and max wait to bound execution time.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.