GitHub user jerrypeng opened a pull request:
https://github.com/apache/storm/pull/785
[STORM-1084] - Improve Storm config validation process to use java
annotations instead of *_SCHEMA format
So currently we specify validators:
public static final String STORM_MESSAGING_NETTY_MIN_SLEEP_MS =
"storm.messaging.netty.min_wait_ms";
public static final Object STORM_MESSAGING_NETTY_MIN_SLEEP_MS_SCHEMA =
ConfigValidation.IntegerValidator;
A better way to do this is using annotations. Something like:
@IntegerValidator
public static final String STORM_MESSAGING_NETTY_MIN_SLEEP_MS =
"storm.messaging.netty.min_wait_ms";
Do this has many advantages. For one you can stack multiple annotations:
@IntegerValidator
@NotNull
public static final String STORM_MESSAGING_NETTY_MIN_SLEEP_MS =
"storm.messaging.netty.min_wait_ms";
And we don't have to write another validator for strings that cannot be null
And we can pass parameters into the annotations:
@PositiveIntegerValidator(notNull=true)
public static final String DRPC_REQUEST_TIMEOUT_SECS =
"drpc.request.timeout.secs";
instead of having to write another validator:
ConfigValidation.NotNullPosIntegerValidator for checking for not null
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jerrypeng/storm STORM-1084
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/storm/pull/785.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 #785
----
commit cfc11637132320b18208bb463d21f33665faf2c1
Author: Boyang Jerry Peng <[email protected]>
Date: 2015-10-06T23:01:25Z
[STORM-1084] - Improve Storm config validation process to use java
annotations instead of *_SCHEMA format
----
---
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.
---