Parses a given JSON string into a TunableMap.
TunableMap loaded through com.twitter.app.LoadService
.
A Tunable is an abstraction for an object that produces a Some(value) or None when applied.
A Tunable is an abstraction for an object that produces a Some(value) or None when applied. Implementations may enable mutation, such that successive applications of the Tunable produce different values.
For more information about Tunables, see https://twitter.github.io/finagle/guide/Configuration.html#tunables
type of value this Tunable holds
A Map that can be used to access Tunables using TunableMap.Keys.
A TunableMap that returns a Tunable.none for every TunableMap.Key
Parses a given JSON string into a TunableMap. The expected format is:
{ "tunables": [ { "id" : "$id1", "value" : $value, "type" : "$class" }, { "id" : "$id2", "value" : $value, "type" : "$class" } ] }
Where $id1 and $id2 are unique identifiers used to access the Tunable, $value is the value, and $class is the fully-qualified class name (e.g. com.twitter.util.Duration)
If the JSON is invalid, or contains duplicate ids for Tunables,
parse
will return a Throw. Otherwise,parse
returns Return[TunableMap