hadoop-common-issues mailing list archives

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

     [ https://issues.apache.org/jira/browse/HADOOP-13339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Tsuyoshi Ozawa resolved HADOOP-13339.
-------------------------------------
    Resolution: Duplicate

Dup of HADOOP-11361. Closing this.

> 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