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 2020/05/18 07:10:00 UTC

[jira] [Comment Edited] (FLINK-17789) DelegatingConfiguration should remove prefix instead of add prefix in toMap

    [ https://issues.apache.org/jira/browse/FLINK-17789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17109957#comment-17109957 ] 

Chesnay Schepler edited comment on FLINK-17789 at 5/18/20, 7:09 AM:
--------------------------------------------------------------------

I disagree. The current behavior is simple; take an option, apply prefix, look it up in the backing config.

If you now start removing trimming stuff that _happens_ to match the configured prefix you just introduce additional edge-cases.

Following your example, an option `k0.prefix.prefix.v1` would never work since you're removing the second `prefix`.


was (Author: zentol):
I disagree. The current behavior is simple; take an option, apply prefix, look it up in the backing config.

If you now start removing trimming stuff that _happens_ to match the configured prefix you just introduce additional edge-cases.

Following your example, an option `k0.prefix.prefix.v1` will never work since you're removing the second `prefix`.

> DelegatingConfiguration should remove prefix instead of add prefix in toMap
> ---------------------------------------------------------------------------
>
>                 Key: FLINK-17789
>                 URL: https://issues.apache.org/jira/browse/FLINK-17789
>             Project: Flink
>          Issue Type: Bug
>          Components: API / Core
>            Reporter: Jingsong Lee
>            Priority: Major
>             Fix For: 1.11.0
>
>
> {code:java}
> Configuration conf = new Configuration();
> conf.setString("k0", "v0");
> conf.setString("prefix.k1", "v1");
> DelegatingConfiguration dc = new DelegatingConfiguration(conf, "prefix.");
> System.out.println(dc.getString("k0", "empty")); // empty
> System.out.println(dc.getString("k1", "empty")); // v1
> System.out.println(dc.toMap().get("k1")); // should be v1, but null
> System.out.println(dc.toMap().get("prefix.prefix.k1")); // should be null, but v1
> {code}



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