GGraziadei commented on code in PR #8586:
URL: https://github.com/apache/storm/pull/8586#discussion_r3209592323
##########
storm-client/src/jvm/org/apache/storm/validation/ConfigValidation.java:
##########
@@ -849,6 +849,23 @@ public void validateField(String name, Object o) {
}
}
+ public static class EwmaSmoothingFactorValidator extends Validator {
+ @Override
+ public void validateField(String name, Object o) {
+ if (o == null) {
+ return;
+ }
+ if (o instanceof Number) {
+ double alpha = ((Number) o).doubleValue();
+ if (alpha > 0.0 && alpha < 1.0) {
+ return;
+ }
+ }
+ throw new IllegalArgumentException(
+ "Field " + name + " must be a number in the open interval
(0, 1), got: " + o);
Review Comment:
Note: according to your comment and the symmetric implementation of
`ObjectReader#getInt`
I added this branch to parse a double from a string in
`ObjectReader#getDouble`.
```
...
else if (o instanceof String){
return Double.parseDouble((String) o);
}
...
```
--
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]