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

Avoid NPE in MetricsConnection’s construction

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.0.0
    • 1.4.0, 2.0.0
    • None
    • None
    • Reviewed

    Description

      a) The batch pool may not be assigned a value in the ConnectionImpl’s construction.
      b) The meta pool always be null in the ConnectionImpl’s construction.
      For reasons outlined above, the NPE may happen in MetricsConnection’s construction

          final ThreadPoolExecutor batchPool = (ThreadPoolExecutor) conn.getCurrentBatchPool();
          final ThreadPoolExecutor metaPool = (ThreadPoolExecutor) conn.getCurrentMetaLookupPool();
      
          this.registry.register(name(this.getClass(), "executorPoolActiveThreads", scope),
              new RatioGauge() {
                @Override
                protected Ratio getRatio() {
                  return Ratio.of(batchPool.getActiveCount(), batchPool.getMaximumPoolSize());
                }
              });
          this.registry.register(name(this.getClass(), "metaPoolActiveThreads", scope),
              new RatioGauge() {
                @Override
                protected Ratio getRatio() {
                  return Ratio.of(metaPool.getActiveCount(), metaPool.getMaximumPoolSize());
                }
              });
      

      Attachments

        1. HBASE-16855.v0.patch
          6 kB
          Chia-Ping Tsai
        2. HBASE-16855.v1.patch
          7 kB
          Chia-Ping Tsai
        3. HBASE-16855.branch-1.v0.patch
          7 kB
          Chia-Ping Tsai

        Activity

          People

            chia7712 Chia-Ping Tsai
            chia7712 Chia-Ping Tsai
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: