[jira] [Commented] (FLINK-4695) Separate configuration parsing from MetricRegistry
[ https://issues.apache.org/jira/browse/FLINK-4695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15526820#comment-15526820 ] ASF GitHub Bot commented on FLINK-4695: --- Github user asfgit closed the pull request at: https://github.com/apache/flink/pull/2555 > Separate configuration parsing from MetricRegistry > -- > > Key: FLINK-4695 > URL: https://issues.apache.org/jira/browse/FLINK-4695 > Project: Flink > Issue Type: Improvement > Components: Metrics >Affects Versions: 1.2.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann >Priority: Minor > > In order to decouple the {{MetricRegistry}} object instantiation from the > global configuration, we could introduce a {{MetricRegistryConfiguration}} > object which encapsulates all necessary information for the > {{MetricRegistry}}. The {{MetricRegistryConfiguration}} could have a static > method to be generated from a {{Configuration}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FLINK-4695) Separate configuration parsing from MetricRegistry
[ https://issues.apache.org/jira/browse/FLINK-4695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15526805#comment-15526805 ] ASF GitHub Bot commented on FLINK-4695: --- Github user tillrohrmann commented on the issue: https://github.com/apache/flink/pull/2555 Thanks for the review @StephanEwen. Build passed locally. Will merge the PR. > Separate configuration parsing from MetricRegistry > -- > > Key: FLINK-4695 > URL: https://issues.apache.org/jira/browse/FLINK-4695 > Project: Flink > Issue Type: Improvement > Components: Metrics >Affects Versions: 1.2.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann >Priority: Minor > > In order to decouple the {{MetricRegistry}} object instantiation from the > global configuration, we could introduce a {{MetricRegistryConfiguration}} > object which encapsulates all necessary information for the > {{MetricRegistry}}. The {{MetricRegistryConfiguration}} could have a static > method to be generated from a {{Configuration}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FLINK-4695) Separate configuration parsing from MetricRegistry
[ https://issues.apache.org/jira/browse/FLINK-4695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15526182#comment-15526182 ] ASF GitHub Bot commented on FLINK-4695: --- Github user tillrohrmann commented on the issue: https://github.com/apache/flink/pull/2555 True, the benefit of this is only marginal in the current master. It is actually part of the `TaskManager` services start up logic in Flip-6. In this branch, the services will be generated by providing component specific configurations objects. These objects are generated from the global configuration and only contain component specific fields. That way, we decouple components from the global configuration object. In order to avoid future merge conflicts between Flip-6 and the master branch, I wanted to merge this specific commit to the master. I should have stated this earlier. > Separate configuration parsing from MetricRegistry > -- > > Key: FLINK-4695 > URL: https://issues.apache.org/jira/browse/FLINK-4695 > Project: Flink > Issue Type: Improvement > Components: Metrics >Affects Versions: 1.2.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann >Priority: Minor > > In order to decouple the {{MetricRegistry}} object instantiation from the > global configuration, we could introduce a {{MetricRegistryConfiguration}} > object which encapsulates all necessary information for the > {{MetricRegistry}}. The {{MetricRegistryConfiguration}} could have a static > method to be generated from a {{Configuration}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FLINK-4695) Separate configuration parsing from MetricRegistry
[ https://issues.apache.org/jira/browse/FLINK-4695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15526169#comment-15526169 ] ASF GitHub Bot commented on FLINK-4695: --- Github user tillrohrmann commented on a diff in the pull request: https://github.com/apache/flink/pull/2555#discussion_r80695131 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/metrics/MetricRegistryConfiguration.java --- @@ -0,0 +1,168 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.runtime.metrics; + +import org.apache.flink.api.java.tuple.Tuple2; +import org.apache.flink.configuration.ConfigConstants; +import org.apache.flink.configuration.Configuration; +import org.apache.flink.configuration.DelegatingConfiguration; +import org.apache.flink.runtime.metrics.scope.ScopeFormat; +import org.apache.flink.runtime.metrics.scope.ScopeFormats; +import org.apache.flink.util.Preconditions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.regex.Pattern; + +/** + * Configuration object for {@link MetricRegistry}. + */ +public class MetricRegistryConfiguration { + + private static final Logger LOG = LoggerFactory.getLogger(MetricRegistryConfiguration.class); + + private static MetricRegistryConfiguration DEFAULT_CONFIGURATION; --- End diff -- Good point. It's not strictly necessary but will avoid "some" unnecessary object creations in case of concurrent accesses. > Separate configuration parsing from MetricRegistry > -- > > Key: FLINK-4695 > URL: https://issues.apache.org/jira/browse/FLINK-4695 > Project: Flink > Issue Type: Improvement > Components: Metrics >Affects Versions: 1.2.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann >Priority: Minor > > In order to decouple the {{MetricRegistry}} object instantiation from the > global configuration, we could introduce a {{MetricRegistryConfiguration}} > object which encapsulates all necessary information for the > {{MetricRegistry}}. The {{MetricRegistryConfiguration}} could have a static > method to be generated from a {{Configuration}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FLINK-4695) Separate configuration parsing from MetricRegistry
[ https://issues.apache.org/jira/browse/FLINK-4695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15526109#comment-15526109 ] ASF GitHub Bot commented on FLINK-4695: --- Github user StephanEwen commented on a diff in the pull request: https://github.com/apache/flink/pull/2555#discussion_r80688384 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/metrics/MetricRegistryConfiguration.java --- @@ -0,0 +1,168 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.runtime.metrics; + +import org.apache.flink.api.java.tuple.Tuple2; +import org.apache.flink.configuration.ConfigConstants; +import org.apache.flink.configuration.Configuration; +import org.apache.flink.configuration.DelegatingConfiguration; +import org.apache.flink.runtime.metrics.scope.ScopeFormat; +import org.apache.flink.runtime.metrics.scope.ScopeFormats; +import org.apache.flink.util.Preconditions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.regex.Pattern; + +/** + * Configuration object for {@link MetricRegistry}. + */ +public class MetricRegistryConfiguration { + + private static final Logger LOG = LoggerFactory.getLogger(MetricRegistryConfiguration.class); + + private static MetricRegistryConfiguration DEFAULT_CONFIGURATION; --- End diff -- The double-check-locking trick will not be safe unless this field is volatile. If no strictly "only once" initialization is needed, then there is probably no need for locking anyways. > Separate configuration parsing from MetricRegistry > -- > > Key: FLINK-4695 > URL: https://issues.apache.org/jira/browse/FLINK-4695 > Project: Flink > Issue Type: Improvement > Components: Metrics >Affects Versions: 1.2.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann >Priority: Minor > > In order to decouple the {{MetricRegistry}} object instantiation from the > global configuration, we could introduce a {{MetricRegistryConfiguration}} > object which encapsulates all necessary information for the > {{MetricRegistry}}. The {{MetricRegistryConfiguration}} could have a static > method to be generated from a {{Configuration}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FLINK-4695) Separate configuration parsing from MetricRegistry
[ https://issues.apache.org/jira/browse/FLINK-4695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15526103#comment-15526103 ] ASF GitHub Bot commented on FLINK-4695: --- Github user zentol commented on the issue: https://github.com/apache/flink/pull/2555 I don't really see the benefit here. Instead of the MetricRegistry being coupled got the globalconfig the MetricRegistryConfiguration now is. This looks a lot like moving code around for the sake of moving it around. > Separate configuration parsing from MetricRegistry > -- > > Key: FLINK-4695 > URL: https://issues.apache.org/jira/browse/FLINK-4695 > Project: Flink > Issue Type: Improvement > Components: Metrics >Affects Versions: 1.2.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann >Priority: Minor > > In order to decouple the {{MetricRegistry}} object instantiation from the > global configuration, we could introduce a {{MetricRegistryConfiguration}} > object which encapsulates all necessary information for the > {{MetricRegistry}}. The {{MetricRegistryConfiguration}} could have a static > method to be generated from a {{Configuration}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FLINK-4695) Separate configuration parsing from MetricRegistry
[ https://issues.apache.org/jira/browse/FLINK-4695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15526004#comment-15526004 ] ASF GitHub Bot commented on FLINK-4695: --- GitHub user tillrohrmann opened a pull request: https://github.com/apache/flink/pull/2555 [FLINK-4695] Introduce MetricRegistryConfiguration to encapsulate MetricRegistry parameters In order to decouple the MetricRegistry object instantiation from the global configuration the MetricRegistryConfiguration class has been introduced. This class encapsulates all required information to create a MetricRegistry object. Furthermore, it encapsulates the configuration parsing logic by offering a static method fromConfiguration, which constructs a MetricRegistryConfiguration object from a Configuration. You can merge this pull request into a Git repository by running: $ git pull https://github.com/tillrohrmann/flink metricRegistryConfig Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/2555.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2555 commit 8e722cfa9b9301e4cb49ccc41a334d684ff2eb1f Author: Till RohrmannDate: 2016-09-26T14:49:23Z [FLINK-4695] Introduce MetricRegistryConfiguration to encapsulate MetricRegistry parameters In order to decouple the MetricRegistry object instantiation from the global configuration the MetricRegistryConfiguration class has been introduced. This class encapsulates all required information to create a MetricRegistry object. Furthermore, it encapsulates the configuration parsing logic by offering a static method fromConfiguration, which constructs a MetricRegistryConfiguration object from a Configuration. > Separate configuration parsing from MetricRegistry > -- > > Key: FLINK-4695 > URL: https://issues.apache.org/jira/browse/FLINK-4695 > Project: Flink > Issue Type: Improvement > Components: Metrics >Affects Versions: 1.2.0 >Reporter: Till Rohrmann >Assignee: Till Rohrmann >Priority: Minor > > In order to decouple the {{MetricRegistry}} object instantiation from the > global configuration, we could introduce a {{MetricRegistryConfiguration}} > object which encapsulates all necessary information for the > {{MetricRegistry}}. The {{MetricRegistryConfiguration}} could have a static > method to be generated from a {{Configuration}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)