GitHub user HeartSaVioR opened a pull request:
https://github.com/apache/incubator-storm/pull/187
STORM-328 : More restrictive to Config, strict range check within
Utils.getInt()
Related Issue : https://issues.apache.org/jira/browse/STORM-328
There're some reasons to make this change.
1. We use Utils.getInt() to read configuration parameters.
2. Utils.getInt() uses Long.intValue(). It just convert long to int by
narrow conversion, using lowest 4 bytes so it would be weird value.
http://www.myhowto.org/java/60-understanding-the-primitive-numeric-type-conversions-in-java/
3. based on 2. we need to restrict configuration parameters using strict
type validation.
(clojure seems to use long instead of int, so it should be with range
check.)
I checked parameter's type.
int is enough for most of these, topology sample rate needs double.
So I introduce IntegerValidator, IntegersValidator (for ports, etc),
DoubleValidator.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/HeartSaVioR/incubator-storm STORM-328
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-storm/pull/187.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #187
----
commit 214ee7454548b884c591991b1faea770d1478cec
Author: Jungtaek Lim <[email protected]>
Date: 2014-07-11T15:59:01Z
STORM-328 More restrictive to Config, strict range check within Utils.getInt
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---