Uploaded image for project: 'Apache Storm'
  1. Apache Storm
  2. STORM-1729

Get rid of reflections while recording stats

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.0.0
    • 1.0.1
    • storm-core
    • None

    Description

      I don't set affects version to 2.0.0 since it only occurs on Clojure.

      (set! *warn-on-reflection* true)
      (load-file "src/clj/org/apache/storm/stats.clj")
      

      Reflection warning, /Users/jlim/WorkArea/JavaProjects/storm/storm-core/src/clj/org/apache/storm/stats.clj:119:3 - call to method incBy can't be resolved (target class is unknown).
      Reflection warning, /Users/jlim/WorkArea/JavaProjects/storm/storm-core/src/clj/org/apache/storm/stats.clj:123:3 - call to method incBy can't be resolved (target class is unknown).
      Reflection warning, /Users/jlim/WorkArea/JavaProjects/storm/storm-core/src/clj/org/apache/storm/stats.clj:149:3 - call to method incBy can't be resolved (target class is unknown).
      Reflection warning, /Users/jlim/WorkArea/JavaProjects/storm/storm-core/src/clj/org/apache/storm/stats.clj:150:3 - call to method record can't be resolved (target class is unknown).
      Reflection warning, /Users/jlim/WorkArea/JavaProjects/storm/storm-core/src/clj/org/apache/storm/stats.clj:154:3 - call to method incBy can't be resolved (target class is unknown).

      https://github.com/apache/storm/blob/1.x-branch/storm-core/src/clj/org/apache/storm/stats.clj#L119

      We expect there's no reflection since we give a type hint while calling, but it doesn't work.
      (I don't know why it doesn't work. Does generic type matter?)
      Anyway, defining them into let makes them avoid reflection.

      Even though we sample while recording stats, it does hurt performance with fast & high-traffic components.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: