Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-27697

Create a dummy metric implementation in ConnectionImplementation.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.5.0
    • None
    • metrics
    • None

    Description

      This Jira is for branch-2 only.

      If CLIENT_SIDE_METRICS_ENABLED_KEY conf is set to true, then we initialize metrics to MetricsConnection, otherwise it is set to null.

            if (conf.getBoolean(CLIENT_SIDE_METRICS_ENABLED_KEY, false)) {        
                this.metricsScope = MetricsConnection.getScope(conf, clusterId, this);        
                this.metrics = MetricsConnection.getMetricsConnection(this.metricsScope, this::getBatchPool, this::getMetaLookupPool);
            } else {
                this.metrics = null;      
            }
      

      Whenever we want to update metrics, we always do a null check. We can improve this by creating a dummy metrics object and have an empty implementation. When we want to populate the metrics, we can check if metrics is an instance of dummy metrics.

      Attachments

        Activity

          People

            Unassigned Unassigned
            shahrs87 Rushabh Shah
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: