hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yongjun Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HADOOP-13339) MetricsSourceAdapter#updateAttrCache may throw NPE due to NULL lastRecs
Date Mon, 04 Jul 2016 22:50:10 GMT
Yongjun Zhang created HADOOP-13339:
--------------------------------------

             Summary: MetricsSourceAdapter#updateAttrCache may throw NPE due to NULL lastRecs
                 Key: HADOOP-13339
                 URL: https://issues.apache.org/jira/browse/HADOOP-13339
             Project: Hadoop Common
          Issue Type: Bug
            Reporter: Yongjun Zhang
            Assignee: Yongjun Zhang


The for loop below may find lastRecs NULL
{code}
  private int updateAttrCache() {
    LOG.debug("Updating attr cache...");
    int recNo = 0;
    int numMetrics = 0;
    for (MetricsRecordImpl record : lastRecs) {
      for (MetricsTag t : record.tags()) {
        setAttrCacheTag(t, recNo);
        ++numMetrics;
      }
      for (AbstractMetric m : record.metrics()) {
        setAttrCacheMetric(m, recNo);
        ++numMetrics;
      }
      ++recNo;
    }
    LOG.debug("Done. # tags & metrics="+ numMetrics);
    return numMetrics;
  }
{code}
and throws NPE. 





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

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message