[jira] [Created] (FLINK-14748) Migrate duration and memory size related ConfigOptions to typed options

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-14748) Migrate duration and memory size related ConfigOptions to typed options

Shang Yuanchun (Jira)
Dawid Wysakowicz created FLINK-14748:
----------------------------------------

             Summary: Migrate duration and memory size related ConfigOptions to typed options
                 Key: FLINK-14748
                 URL: https://issues.apache.org/jira/browse/FLINK-14748
             Project: Flink
          Issue Type: Improvement
          Components: Runtime / Configuration
            Reporter: Dawid Wysakowicz


The goal of this task is to migrate ConfigOptions that describe intervals or memory sizes to the typed ConfigOptions. We should also regenerate the documentation after migrating.

Example:
{code}
public static final ConfigOption<String> RESTART_STRATEGY_FAILURE_RATE_DELAY = ConfigOptions
                .key("restart-strategy.failure-rate.delay")
                .defaultValue("1 s")
                .withDescription(...);
{code}

should become
{code}
public static final ConfigOption<Duration> RESTART_STRATEGY_FAILURE_RATE_DELAY = ConfigOptions
                .key("restart-strategy.failure-rate.delay")
                .durationType()
                .defaultValue(Duration.ofSeconds(1))
                .withDescription(...);
{code}

We should also migrate other types whenever possible.
For example we should migrate:

{code}
public static final ConfigOption<Integer> CONNECT_TIMEOUT =
                key("blob.client.connect.timeout")
                        .defaultValue(0)
                        .withDescription("The connection timeout in milliseconds for the blob client.");
{code}

but we should not migrate, because it is expressed in seconds which is not the default unit:
{code}
public static final ConfigOption<Long> CLEANUP_INTERVAL =
                key("blob.service.cleanup.interval")
                        .defaultValue(3_600L) // once per hour
                        .withDeprecatedKeys("library-cache-manager.cleanup.interval")
                        .withDescription("Cleanup interval of the blob caches at the task managers (in seconds).");
{code}





--
This message was sent by Atlassian Jira
(v8.3.4#803005)