This class also provides constants for all the configurations possible on a Storm cluster and Storm topology. Default values for these configs can be found in defaults.yaml.
Note that you may put other configurations in any of the configs. Storm will ignore anything it doesn't recognize, but your topologies are free to make use of them by reading them in the prepare method of Bolts or the open method of Spouts. .
cantine/install/path/.config
. It also creates a default config file if no one exists ; and display configuration window in the GUI.
@author Johan CWIKLINKSI
@since 2005-05-31
@version 1.1
The API for a {@code Config} is in terms of path expressions, while the APIfor a {@code ConfigObject} is in terms of keys. Conceptually, {@code Config}is a one-level map from paths to values, while a {@code ConfigObject} is a tree of nested maps from keys to values.
Use {@link ConfigUtil#joinPath} and {@link ConfigUtil#splitPath} to convertbetween path expressions and individual path elements (keys).
Another difference between {@code Config} and {@code ConfigObject} is thatconceptually, {@code ConfigValue}s with a {@link ConfigValue#valueType() valueType()} of {@link ConfigValueType#NULL NULL} exist in a{@code ConfigObject}, while a {@code Config} treats null values as if theywere missing.
{@code Config} is an immutable object and thus safe to use from multiplethreads. There's never a need for "defensive copies."
The "getters" on a {@code Config} all work in the same way. They never returnnull, nor do they return a {@code ConfigValue} with{@link ConfigValue#valueType() valueType()} of {@link ConfigValueType#NULL NULL}. Instead, they throw {@link ConfigException.Missing} if the value iscompletely absent or set to null. If the value is set to null, a subtype of {@code ConfigException.Missing} called {@link ConfigException.Null} will bethrown. {@link ConfigException.WrongType} will be thrown anytime you ask fora type and the value has an incompatible type. Reasonable type conversions are performed for you though.
If you want to iterate over the contents of a {@code Config}, you can get its {@code ConfigObject} with {@link #root()}, and then iterate over the {@code ConfigObject} (which implements java.util.Map
). Or, youcan use {@link #entrySet()} which recurses the object tree for you and buildsup a Set
of all path-value pairs where the value is not null.
Do not implement {@code Config}; it should only be implemented by the config library. Arbitrary implementations will not work because the library internals assume a specific concrete implementation. Also, this interface is likely to grow new methods over time, so third-party implementations will break.
The API for a {@code Config} is in terms of path expressions, while the APIfor a {@code ConfigObject} is in terms of keys. Conceptually, {@code Config}is a one-level map from paths to values, while a {@code ConfigObject} is a tree of nested maps from keys to values.
Use {@link ConfigUtil#joinPath} and {@link ConfigUtil#splitPath} to convertbetween path expressions and individual path elements (keys).
Another difference between {@code Config} and {@code ConfigObject} is thatconceptually, {@code ConfigValue}s with a {@link ConfigValue#valueType() valueType()} of {@link ConfigValueType#NULL NULL} exist in a{@code ConfigObject}, while a {@code Config} treats null values as if theywere missing.
{@code Config} is an immutable object and thus safe to use from multiplethreads. There's never a need for "defensive copies."
The "getters" on a {@code Config} all work in the same way. They never returnnull, nor do they return a {@code ConfigValue} with{@link ConfigValue#valueType() valueType()} of {@link ConfigValueType#NULL NULL}. Instead, they throw {@link ConfigException.Missing} if the value iscompletely absent or set to null. If the value is set to null, a subtype of {@code ConfigException.Missing} called {@link ConfigException.Null} will bethrown. {@link ConfigException.WrongType} will be thrown anytime you ask fora type and the value has an incompatible type. Reasonable type conversions are performed for you though.
If you want to iterate over the contents of a {@code Config}, you can get its {@code ConfigObject} with {@link #root()}, and then iterate over the {@code ConfigObject} (which implements java.util.Map
). Or, youcan use {@link #entrySet()} which recurses the object tree for you and buildsup a Set
of all path-value pairs where the value is not null.
Do not implement {@code Config}; it should only be implemented by the config library. Arbitrary implementations will not work because the library internals assume a specific concrete implementation. Also, this interface is likely to grow new methods over time, so third-party implementations will break.
The object is designed so that you can use method chaining during creation. For example:
Config config = new Config().uiColor("#aed0ea").language("fr").width("500px");
This config object can now be bound to the tag like so:
<ck:editor value="#{editorBean.contents}" config="#{editorBean.config}"/>
{@link Config} are immutable instance, so threadsafe. @author oldratlee @since 0.1.0
NOTE: Delimeter parsing is disabled. @author jpk
Paths, keys, and Config vs. ConfigObject
Config
is a view onto a tree of {@link ConfigObject}; the corresponding object tree can be found through {@link Config#root()}. ConfigObject
is a map from config keys, rather than paths, to config values. Think of ConfigObject
as a JSON object and Config
as a configuration API.
The API tries to consistently use the terms "key" and "path." A key is a key in a JSON object; it's just a string that's the key in a map. A "path" is a parseable expression with a syntax and it refers to a series of keys. Path expressions are described in the spec for Human-Optimized Config Object Notation. In brief, a path is period-separated so "a.b.c" looks for key c in object b in object a in the root object. Sometimes double quotes are needed around special characters in path expressions.
The API for a {@code Config} is in terms of path expressions, while the APIfor a {@code ConfigObject} is in terms of keys. Conceptually, {@code Config}is a one-level map from paths to values, while a {@code ConfigObject} is a tree of nested maps from keys to values.
Use {@link ConfigUtil#joinPath} and {@link ConfigUtil#splitPath} to convertbetween path expressions and individual path elements (keys).
Another difference between {@code Config} and {@code ConfigObject} is thatconceptually, {@code ConfigValue}s with a {@link ConfigValue#valueType() valueType()} of {@link ConfigValueType#NULL NULL} exist in a{@code ConfigObject}, while a {@code Config} treats null values as if theywere missing.
Getting configuration values
The "getters" on a {@code Config} all work in the same way. They never returnnull, nor do they return a {@code ConfigValue} with{@link ConfigValue#valueType() valueType()} of {@link ConfigValueType#NULL NULL}. Instead, they throw {@link ConfigException.Missing} if the value iscompletely absent or set to null. If the value is set to null, a subtype of {@code ConfigException.Missing} called {@link ConfigException.Null} will bethrown. {@link ConfigException.WrongType} will be thrown anytime you ask fora type and the value has an incompatible type. Reasonable type conversions are performed for you though.
Iteration
If you want to iterate over the contents of a {@code Config}, you can get its {@code ConfigObject} with {@link #root()}, and then iterate over the {@code ConfigObject} (which implements java.util.Map
). Or, youcan use {@link #entrySet()} which recurses the object tree for you and buildsup a Set
of all path-value pairs where the value is not null.
Resolving substitutions
Substitutions are the ${foo.bar}
syntax in config files, described in the specification. Resolving substitutions replaces these references with real values.
Before using a {@code Config} it's necessary to call {@link Config#resolve()}to handle substitutions (though {@link ConfigFactory#load()} and similarmethods will do the resolve for you already).
Merging
The full Config
for your application can be constructed using the associative operation {@link Config#withFallback(ConfigMergeable)}. If you use {@link ConfigFactory#load()} (recommended), it merges systemproperties over the top of application.conf
over the top of reference.conf
, using withFallback
. You can add in additional sources of configuration in the same way (usually, custom layers should go either just above or just below application.conf
, keeping reference.conf
at the bottom and system properties at the top).
Serialization
Convert a Config
to a JSON or HOCON string by calling {@link ConfigObject#render()} on the root object,myConfig.root().render()
. There's also a variant {@link ConfigObject#render(ConfigRenderOptions)} which allows you to controlthe format of the rendered string. (See {@link ConfigRenderOptions}.) Note that Config
does not remember the formatting of the original file, so if you load, modify, and re-save a config file, it will be substantially reformatted.
As an alternative to {@link ConfigObject#render()}, the toString()
method produces a debug-output-oriented representation (which is not valid JSON).
Java serialization is supported as well for Config
and all subtypes of ConfigValue
.
This is an interface but don't implement it yourself
Do not implement {@code Config}; it should only be implemented by the config library. Arbitrary implementations will not work because the library internals assume a specific concrete implementation. Also, this interface is likely to grow new methods over time, so third-party implementations will break.
Config
provides configuration information read from a configuration file. It implements the singleton design pattern.
Config
provides configuration information read from a configuration file. It implements the singleton design pattern.
Plugins can extend this class and copy the properties from the main TSDB.config instance. Plugins should never change the main TSD's config properties, rather a plugin should use the Config(final Config parent) constructor to get a copy of the parent's properties and then work with the values locally. @since 2.0
Sub-interfaces may also extend {@link Accessible} to allow some debugging facility, or {@link Reloadable} to allow theuser to programmatically reload properties. @author Luigi R. Viggiano @see java.util.Properties
Numeric property containing ":", e.g. "10:100:5" is interpreted as array of numeric values. It is extracted once, on first use, and maintain a round number to return the appropriate value.
The config property "work.dir" tells where is the root of docs data dirs and indexes dirs. It is set to either of:
When an event is transferred to a processing element, the generated proxy finds the corresponding onEvent
method with the event type argument matching the current parameter and calls this method.
If there is no exact match, the closest type in the hierarchy of events is used.
If there is still no match, an error statement is logged and the event is ignored (not processed).
The properties are described below under.
Config
represents the config tag.
@author Jason T. Greene
@version $Revision: 10006 $
This class is applied Singleton pattern, you can not create instance twice in an application. How to use this class for generally is,
$Id$ @author Masatoshi Sato
An instance of the Config class must be created through the transfer objects {@link ConfigTO} and {@link RepoTO}.
@author Philipp C. Heckel
[sectionName1] key=value key2=value2 [sectionName2] key=value key2=value2 key_with_equals\=still_key=value3everything after the first '#' is considered a comment. blank lines are ignored. If you want keys with '=' in them escape it to '\=' and you should be fine.
Numeric peroperty containing ":", e.g. "10:100:5" is interpreted as array of numeric values. It is extracted once, on first use, and maintain a round number to return the appropriate value.
The config property "work.dir" tells where is the root of docs data dirs and indexes dirs. It is set to either of:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|