nathanmarz/storm — pull request #583 by d2r (2013-06-04 17:47:33+00:00)
Title: Add config schema validation

For issue #581

This pull request supersedes #582

This is a prototype implementation to continue along the path suggested in this comment https://github.com/nathanmarz/storm/pull/582#issuecomment-18880232

Adds a schema to each config, and validates on reading the config yaml.

Just looking for comments and direction at this point.

TODO:
* There should be a single validation function: `validate-configs-with-schemas` should just call this function and not have to test for `nil` or `instanceof FieldValidator`. The mapping created in `b.s.config` should map the field value to this function instead of to the schema.
* We should validate on `findAndReadConfigFile`, and not on `readStormConfig`, since it will unnecessarily validate the defaults.yaml. (It is currently there for testing.)
* Some of the types are not sufficient. Some cases of `java.lang.Number` might need to be `Integer` instead
* Some reorganization of code (Do we want `FieldValidator`s in `Config`?)
* Lots of code intended for debugging needs to be removed.