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

[branch-1] getNumOpenConnections is not effective

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.0
    • Component/s: metrics
    • Labels:
      None
    • Hadoop Flags:
      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

          Activity

            People

            • Assignee:
              reidchan Reid Chan
              Reporter:
              reidchan Reid Chan

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment