flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chesnay Schepler (JIRA)" <j...@apache.org>
Subject [jira] [Created] (FLINK-6490) Explicitly support dynamic defaults in ConfigOption
Date Mon, 08 May 2017 14:33:04 GMT
Chesnay Schepler created FLINK-6490:
---------------------------------------

             Summary: Explicitly support dynamic defaults in ConfigOption
                 Key: FLINK-6490
                 URL: https://issues.apache.org/jira/browse/FLINK-6490
             Project: Flink
          Issue Type: Wish
            Reporter: Chesnay Schepler


While reviewing FLINK-5781 i stumbled upon an inconsistencyy as to how defaults for tmp directory
are defined.

The JM web tmp dir, and the python Distributed cache tmpdir options both have a default value
defined as {{System.getProperty("java.tmpdir")}}.

In contrast, the HistoryServer web tmp dir is defined as having no default value.

The first approach causes issues for FLINK-5781 which generates HTML tables for the documentation
based on the ConfigOptions, as they now include the resolved value for "java.tmpdir". Ideally
it would actually show "System.getProperty("java.tmpdir")"

The second approach is a bit odd; as having no default isn't particularly accurate since a
default does exist, whatever "java.tmpdir" resolves to.

my idea is to add a new method to the {{OptionBuilder}} for case where a default value is
determined at runtime.

It could look like this:
{code}
public <T> ConfigOption<T> derivedDefaultValue(T value, String origin)

// example usage
key(abc).derivedDefaultValue(System.getProperty("java.tmpdir"), "System.getProperty("java.tmpdir")");
{code}

Alternatively we could opt to not having a default value, but mention the "java.tmpdir" usage
in the description. But ti seems odd to not have this somehow as part of the default, hence
my proposal.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message