slfan1989 opened a new pull request, #1354:
URL: https://github.com/apache/ratis/pull/1354
## What changes were proposed in this pull request?
This PR implements support for different RetryPolicy implementations with a
flexible comma-separated format:
#### New Format:
```
<classname>,<retry-policy-parameters>
```
#### Key Changes:
- Enhanced RetryPolicy.parse() method to support explicit class name
specification:
- `ExponentialBackoffRetry,100ms,5s,100` - Exponential backoff retry
- `MultipleLinearRandomRetry,1ms,10,1s,20,5s,1000` - Multiple linear
random retry
- Backward Compatibility - Legacy format (without class name) is still
supported:
- `1ms,10,1s,20,5s,1000` defaults to MultipleLinearRandomRetry
- Implemented smart detection via
`isLegacyMultipleLinearRandomRetryParams()` to distinguish between legacy
duration-based format and unknown class names
- Improved Error Handling - Fails fast with clear error messages when:
- Unknown class name is provided (e.g., `UnknownRetry,1ms,10`)
- Required parameters are missing
## What is the link to the Apache JIRA
RATIS-2413. Support different RetryPolicy implementations.
## How was this patch tested?
Add Unit Tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]