Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Deprecate getXXX(String key, XXX defaultValue) and setXXX(String key, XXX value), discussed in the preview thread, except the following:
    • getString(String key, String defaultValue)
    ,
    • setString(String key, String value)
    ,
    • getBytes(String key, byte[] defaultValue)
    , and
    • setBytes(String key, byte[] bytes)
    .
    Update the comment in getString

    • getClass(String key,

    String defaultValue), setString
    • Class<? extends T> defaultValue, ClassLoader classLoader)

    • setClass(String key, Class<?> klazz)
  • Update the comment in getString String value), getBytes(String key, byte[] String defaultValue) , and setBytessetString(String key, byte[] bytesString value) to encourage users to use ConfigOption.

...

Code Block
languagejava
titleConfiguration.java
@Public
public class Configuration extends ExecutionConfig.GlobalJobParameters
        implements IOReadableWritable,
                java.io.Serializable,
                Cloneable,
                ReadableConfig,
                WritableConfig {
...      

	/**
     * Returns the value associated with the given key as a string. We encourage users and
     * developers to always use ConfigOption for getting the configurations if possible, for its
     * rich description, type, default-value and other supports. The string-key-based getter should
     * only be used when ConfigOption is not applicable, e.g., the key is programmatically generated
     * in runtime.
     *
     * @param key the key pointing to the associated value
     * @param defaultValue the default value which is returned in case there is no value associated
     *     with the given key
     * @return the (default) value associated with the given key
     */     
	public String getString(String key, String defaultValue) {
		...
    }


    /**
     * Adds the given key/value pair to the configuration object. We encourage users and developers
     * to always use ConfigOption for setting the configurations if possible, for its rich
     * description, type, default-value and other supports. The string-key-based setter should only
     * be used when ConfigOption is not applicable, e.g., the key is programmatically generated in
     * runtime.
     *
     * @param key the key of the key/value pair to be added
     * @param value the value of the key/value pair to be added
     */
    public void setString(String key, String value) {
        ...
    }


     * Returns the value associated with the given key as a byte array. We encourage users and
     * developers to always use ConfigOption for getting the configurations if possible, for its
     * rich description, type, default-value and other supports. The string-key-based getter should
     * only be used when ConfigOption is not applicable, e.g., the key is programmatically generated
     * in runtime.
     *
     * @param key The key pointing to the associated value.
     * @param defaultValue The default value which is returned in case there is no value associated
     *     with the given key.
     * @return the (default) value associated with the given key.
     */
    public byte[] getBytes(String key, byte[] defaultValue) {
		...
    }

    /**
     * Adds the given byte array to the configuration object. We encourage users and developers to
     * always use ConfigOption for setting the configurations if possible, for its rich description,
     * type, default-value and other supports. The string-key-based setter should only be used when
     * ConfigOption is not applicable, e.g., the key is programmatically generated in runtime.
     *
     * @param key The key under which the bytes are added.
     * @param bytes The bytes to be added.
     */
    public void setBytes(String key, byte[] bytes) {
        ...
    }

		...	
	...			
}

2.2.2 Deprecate some unnecessary setXxx and getXxx methods in Configuration

...