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

ASF GitHub Bot commented on FLINK-4167:
---------------------------------------

Github user zentol commented on the issue:

    https://github.com/apache/flink/pull/2210
  
    It gets an IOMG because in the past it would forward this group to its 
deserializers, for Input byte counting etc. . I didn't change it cause i forgot 
about my own convention on how to use the IOMG.
    
    The IOMG only exist for the purpose of keeping details out of the TaskMG 
(the getters mostly), and to prevent users of the IMOG to be able to access 
other SubGroups of the TaskMG (separation of concerns). There is de-facto no 
difference between a metric registered on a TaskMG or IOMG.
    
    Thus, the underlying issue imo is that the IOMG extends 
AbstractMetricGroup; giving it more functionality than it should have. Instead 
it should extend a class as outlined below.
    
    ```
    public abstract class SubMetricGroup<P extends MetricGroup> implements 
MetricGroup {
        private P parent;
        
        public SubMetricGroup(P parent) {
                this.parent = parent;
        }
    
        @Override
        public Counter counter(int name) {
                return parent.counter(name);
        }
    
        @Override
        public Counter counter(String name) {
                return parent.counter(name);
        }
    
        @Override
        public <C extends Counter> C counter(int name, C counter) {
                return parent.counter(name, counter);
        }
    
        @Override
        public <C extends Counter> C counter(String name, C counter) {
                return parent.counter(name, counter);
        }
    
        @Override
        public <T, G extends Gauge<T>> G gauge(int name, G gauge) {
                return parent.gauge(name, gauge);
        }
    
        @Override
        public <T, G extends Gauge<T>> G gauge(String name, G gauge) {
                return parent.gauge(name, gauge);
        }
    
        @Override
        public <H extends Histogram> H histogram(String name, H histogram) {
                return parent.histogram(name, histogram);
        }
    
        @Override
        public <H extends Histogram> H histogram(int name, H histogram) {
                return parent.histogram(name, histogram);
        }
    
        @Override
        public MetricGroup addGroup(int name) {
                return parent.addGroup(name);
        }
    
        @Override
        public MetricGroup addGroup(String name) {
                return parent.addGroup(name);
        }
    ```


> TaskMetricGroup does not close IOMetricGroup
> --------------------------------------------
>
>                 Key: FLINK-4167
>                 URL: https://issues.apache.org/jira/browse/FLINK-4167
>             Project: Flink
>          Issue Type: Bug
>          Components: Metrics
>    Affects Versions: 1.1.0
>            Reporter: Till Rohrmann
>            Assignee: Till Rohrmann
>             Fix For: 1.1.0
>
>
> The {{TaskMetricGroup}} does not close the {{ioMetrics}} metric group. This 
> causes that metrics registered under the {{ioMetrics}} are not deregistered 
> after the termination of a job.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to