[ 
https://issues.apache.org/jira/browse/AMBARI-16949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15306476#comment-15306476
 ] 

Jungtaek Lim commented on AMBARI-16949:
---------------------------------------

PhoenixHBaseAccessor.appendMetricFromResultSet() doesn't throw NPE but it 
doesn't match proper functions when both wildcard and functions are used.
https://github.com/apache/ambari/blob/branch-2.2.2/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java#L668-L693

I guess this is not expected behavior. What do others think?

> Metrics Collector API shows NPE if we use wildcard (%25 for '%') for metric 
> name
> --------------------------------------------------------------------------------
>
>                 Key: AMBARI-16949
>                 URL: https://issues.apache.org/jira/browse/AMBARI-16949
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-metrics
>    Affects Versions: 2.4.0
>            Reporter: Jungtaek Lim
>
> When we request '/ws/v1/timeline/metrics' with metric name which contains %25 
> (escaped '%'), response for the API is json describing there's NPE.
> And NPE is logged for ambari-metrics-collector log file.
> {code}
> 2016-05-30 09:15:05,061 WARN 
> org.apache.hadoop.yarn.webapp.GenericExceptionHandler: INTERNAL_SERVER_ERROR
> java.lang.NullPointerException
>       at 
> org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.PhoenixHBaseAccessor.appendAggregateMetricFromResultSet(PhoenixHBaseAccessor.java:810)
>       at 
> org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.PhoenixHBaseAccessor.getAggregateMetricRecords(PhoenixHBaseAccessor.java:772)
>       at 
> org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.HBaseTimelineMetricStore.getTimelineMetrics(HBaseTimelineMetricStore.java:178)
>       at 
> org.apache.hadoop.yarn.server.applicationhistoryservice.webapp.TimelineWebServices.getTimelineMetrics(TimelineWebServices.java:372)
>       at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
> {code}
> Reason of NPE: 
> Metrics are properly fetched with wildcard. But when applying functions to 
> result set, actual metric name is not exist from map of metric name to list 
> of function.



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

Reply via email to