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)