elasticsearch/elasticsearch — pull request #7633 by mikemccand (2014-09-07 10:04:21+00:00)
Title: Require units for time and byte sized settings

I fixed ImmutableSettings (and the time/byte size value parsers it uses) to by default require units for time and byte/memory-size settings, and fixed a bunch of tests that were missing units in their settings.

SizeValue I left alone since the "singles" inherently has no unit.

I also added a boolean bwc setting `settings_require_units` (defaults to true) that you can set to false to get back to lenient default units. I put this in InternalSettingsPreparer so it runs "early on", and it's a static boolean in ImmutableSettings. Hopefully most users don't need to set this (i.e. they simply add the missing units to their settings on upgrade), but if they need to, they can just set it in config/elasticsearch.yml.

I fixed the parsing APIs to optionally take a setting name, so that the resulting ElasticsearchIllegalArgumentException includes the name of the troubled setting.

We still accept 0 and -1 without units...

Closes #7616