Sanghyun Yun created HBASE-12327:
------------------------------------

             Summary: MetricsHBaseServerSourceFactory#createContextName has 
wrong conditions
                 Key: HBASE-12327
                 URL: https://issues.apache.org/jira/browse/HBASE-12327
             Project: HBase
          Issue Type: Bug
            Reporter: Sanghyun Yun


MetricsHBaseServerSourceFactory#createContextName has wrong conditions.

It checks serverName contains "HMaster" or "HRegion".

{code:title=MetricsHBaseServerSourceFactory.java}
...
  protected static String createContextName(String serverName) {
    if (serverName.contains("HMaster")) {
      return "Master";
    } else if (serverName.contains("HRegion")) {
      return "RegionServer";
    }
    return "IPC";
  }
...
{code}

But, passed serverName actually contains "master" or "regionserver" by 
HMaster#getProcessName and HRegionServer#getProcessName.

{code:title=HMaster.java}
...
  // MASTER is name of the webapp and the attribute name used stuffing this
  //instance into web context.
  public static final String MASTER = "master";
...
  protected String getProcessName() {
    return MASTER;
  }
...
{code}

{code:title=HRegionServer.java}
...
  /** region server process name */
  public static final String REGIONSERVER = "regionserver";
...
  protected String getProcessName() {
    return REGIONSERVER;
  }
...
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to