You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Chesnay Schepler (Jira)" <ji...@apache.org> on 2022/11/11 09:22:00 UTC

[jira] [Closed] (FLINK-6490) Explicitly support dynamic defaults in ConfigOption

     [ https://issues.apache.org/jira/browse/FLINK-6490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chesnay Schepler closed FLINK-6490.
-----------------------------------
    Resolution: Won't Fix

> Explicitly support dynamic defaults in ConfigOption
> ---------------------------------------------------
>
>                 Key: FLINK-6490
>                 URL: https://issues.apache.org/jira/browse/FLINK-6490
>             Project: Flink
>          Issue Type: Improvement
>          Components: Runtime / Configuration
>            Reporter: Chesnay Schepler
>            Priority: Minor
>
> 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
(v8.20.10#820010)