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

[branch-1] getNumOpenConnections is not effective

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.7.0
    • metrics
    • None
    • Reviewed

    Description

      In MetricsHBaseServerWrapperImpl

        @Override
        public int getNumOpenConnections() {
          if (!isServerStarted() || this.server.connectionList == null) {
            return 0;
          }
          return server.connectionList.size();
        }
      

      But connectionList is created by Collections.synchronizedList(new LinkedList<Connection>());
      So each connectionList.size() will compete for the mutex, we can easily replace it with another parameter numConnections, as for metrics, it is enough.

      Attachments

        Issue Links

          Activity

            People

              reidchan Reid Chan
              reidchan Reid Chan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: