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);
        }
    ```


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to