[ https://issues.apache.org/jira/browse/STORM-1729?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jungtaek Lim updated STORM-1729: -------------------------------- Description: I don't set affects version to 2.0.0 since it only occurs on Clojure. {code} (set! *warn-on-reflection* true) (load-file "src/clj/org/apache/storm/stats.clj") {code} {quote} 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). {quote} 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. was: I don't add this to 2.0.0 since it only occurs on Clojure. {code} (set! *warn-on-reflection* true) (load-file "src/clj/org/apache/storm/stats.clj") {code} {quote} 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). {quote} 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. > Get rid of reflections while recording stats > -------------------------------------------- > > Key: STORM-1729 > URL: https://issues.apache.org/jira/browse/STORM-1729 > Project: Apache Storm > Issue Type: Bug > Components: storm-core > Affects Versions: 1.0.1 > Reporter: Jungtaek Lim > Assignee: Jungtaek Lim > > I don't set affects version to 2.0.0 since it only occurs on Clojure. > {code} > (set! *warn-on-reflection* true) > (load-file "src/clj/org/apache/storm/stats.clj") > {code} > {quote} > 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). > {quote} > 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. -- This message was sent by Atlassian JIRA (v6.3.4#6332)