Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-16949

Metrics Collector API shows NPE if we use wildcard (%25 for '%') for metric name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.4.0
    • 2.4.0
    • ambari-metrics
    • None

    Description

      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.

      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)
      

      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.

      Attachments

        1. AMBARI-16949-trunk-v1.patch
          3 kB
          Jungtaek Lim

        Issue Links

          Activity

            People

              kabhwan Jungtaek Lim
              kabhwan Jungtaek Lim
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: