You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by tillrohrmann <gi...@git.apache.org> on 2016/09/27 12:44:26 UTC

[GitHub] flink pull request #2555: [FLINK-4695] Introduce MetricRegistryConfiguration...

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 Rohrmann <tr...@apache.org>
Date:   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.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2555: [FLINK-4695] Introduce MetricRegistryConfiguration...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/2555


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #2555: [FLINK-4695] Introduce MetricRegistryConfiguration to enc...

Posted by tillrohrmann <gi...@git.apache.org>.
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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #2555: [FLINK-4695] Introduce MetricRegistryConfiguration to enc...

Posted by tillrohrmann <gi...@git.apache.org>.
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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2555: [FLINK-4695] Introduce MetricRegistryConfiguration...

Posted by StephanEwen <gi...@git.apache.org>.
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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2555: [FLINK-4695] Introduce MetricRegistryConfiguration...

Posted by tillrohrmann <gi...@git.apache.org>.
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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #2555: [FLINK-4695] Introduce MetricRegistryConfiguration to enc...

Posted by zentol <gi...@git.apache.org>.
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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---