[
https://issues.apache.org/jira/browse/FLINK-13406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16908931#comment-16908931
]
Till Rohrmann commented on FLINK-13406:
---------------------------------------
Isn't the problem that {{Configuration}} uses {{HashMap<String, Object>
confData}} to store values. Hence, depending on whether you load the
{{Configuration}} from disk or set it programmatically, the internal state of
it looks different (storing an {{Integer}} object instead of a {{String}}).
Hence, I can understand the confusion.
As a quick fix, I would propose to simply use
{{configuration.setString("metrics.reporter.my.foo", "42")}} [~oripwk].
But we should discuss whether the behaviour of the {{Configuration}} is
actually correct or not.
> MetricConfig.getInteger() always returns null
> ---------------------------------------------
>
> Key: FLINK-13406
> URL: https://issues.apache.org/jira/browse/FLINK-13406
> Project: Flink
> Issue Type: Bug
> Components: Runtime / Metrics
> Affects Versions: 1.6.3
> Reporter: Ori Popowski
> Priority: Major
>
> {{MetricConfig}}'s {{getInteger}} will always return the default value.
> The reason is, since it delegates to Java's {{Properties.getProperty}} which
> returns null if the type of the value is not {{String}}.
> h3. Reproduce
> # Create a class {{MyReporter}} implementing {{MetricReporter}}
> # Implment the {{open()}} method so that you do {{config.getInteger("foo",
> null)}}
> # Start an {{ExecutionEnvironment}} with and give it the following
> Configuration object:
> {code:java}
> configuration.setString("metrics.reporters", "my");
> configuration.setClass("metrics.reporter.my.class", MyReporter.class)
> configuration.setInteger("metrics.reporter.my.foo", 42);{code}
> # In {{open()}} the value of {{foo}} is null.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)